How to show XML data in web pages?

Discussion in 'XML' started by starfoxsb@gmail.com, Jan 16, 2008.

  1. Guest

    Hi all.

    I have a huge amount of data burnt on a CD-Rom (coming from a DB),
    written on XML files.

    I would like to show them to the user, by a web page.
    In my first version, I build the Html page by picking data from XML
    files and trasforming them by an XSL Transformation.

    It works well, but as the data are quite a lot, it would be much
    better to have them in different pages (besides the trasformation is
    very slow).

    I then tried to use Ajax.
    My thought was to open the XML file and then build the different pages
    with the right data range (es. 1 to 20 on the first page, 21 to 40 on
    the second, and so on...) by a javascript function.

    Unfortunately since my script is not running under a web server, when
    I try to use the "open" method I get the error "Access is denied" (I'm
    using IE 7)

    XMLHttpReqObj = new ActiveXObject("Microsoft.XMLHTTP");
    XMLHttpReqObj.open('GET', 'MyFile.xml', true);

    Does anyone have any suggestion for solving the problem?
    How could I arrange my data into different pages?

    Thanks a lot for your help...
    Bye!


    Matteo
     
    , Jan 16, 2008
    #1
    1. Advertising

  2. Joe Fawcett Guest

    <> wrote in message
    news:...
    > Hi all.
    >
    > I have a huge amount of data burnt on a CD-Rom (coming from a DB),
    > written on XML files.
    >
    > I would like to show them to the user, by a web page.
    > In my first version, I build the Html page by picking data from XML
    > files and trasforming them by an XSL Transformation.
    >
    > It works well, but as the data are quite a lot, it would be much
    > better to have them in different pages (besides the trasformation is
    > very slow).
    >
    > I then tried to use Ajax.
    > My thought was to open the XML file and then build the different pages
    > with the right data range (es. 1 to 20 on the first page, 21 to 40 on
    > the second, and so on...) by a javascript function.
    >
    > Unfortunately since my script is not running under a web server, when
    > I try to use the "open" method I get the error "Access is denied" (I'm
    > using IE 7)
    >
    > XMLHttpReqObj = new ActiveXObject("Microsoft.XMLHTTP");
    > XMLHttpReqObj.open('GET', 'MyFile.xml', true);
    >
    > Does anyone have any suggestion for solving the problem?
    > How could I arrange my data into different pages?
    >
    > Thanks a lot for your help...
    > Bye!
    >
    >
    > Matteo

    If you do not have a web server then you can't use XmlHttpRequest, just use
    mxsml2.domdocument.x.0 where x is the latest version available. 6 is the
    best but 3 should be installed on most machines. You can then load the
    DomDocument using the load() method.

    You may also need to lower the security settings for the "My Computer" zone
    in IE.
    First you need to make the zone available by tinkering with the registry or
    running the following script, courtesy of Michael Harris:

    'A vbscript (ShowMyComputerZone.vbs) that will "unhide"
    'the "My Computer" security zone in IE, allowing you to
    'customize the security settings for local HTML files.
    '
    'See MS KB article Q182569 for details.
    '
    'Description of Internet Explorer Security Zones Registry Entries
    'http://support.microsoft.com/support/kb/articles/q182/5/69.asp
    '
    'A much better soution for IE5+ is to save local .htm/html files
    'with the .hta extension instead and execute them as trusted HTML
    'Applications.
    '================================================================


    set shell = createobject("wscript.shell")
    '=====
    'Changing this under the HKLM makes it effective for all users
    'at next logon...
    '=====
    HKLM_MyComputer_key = _
    "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion" _
    &"\Internet Settings\Zones\0\"
    valuename = "Flags"
    shell.RegWrite HKLM_MyComputer_key & valuename, 1, "REG_DWORD"
    '=====
    'Changing this under the HKCU makes it effective for this user
    'immediately and at every logon...
    '=====
    HKCU_MyComputer_key = _
    "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion" _
    &"\Internet Settings\Zones\0\"
    valuename = "Flags"
    shell.RegWrite HKCU_MyComputer_key & valuename, 1, "REG_DWORD"


    msgbox "The 'My Computer' zone security " & vbcrlf _
    & "is now visible on the IE Security tab..."


    wscript.quit


    Obviously this may not be a practical option if other people need to use the
    app, in that case consider using an HTA which has lower security
    restrictions.
    Detaisl of HTAs, which are essentially web pages saved with an HTA extension
    instead of HTML are available of msdn.com.

    --

    Joe Fawcett (MVP - XML)

    http://joe.fawcett.name
     
    Joe Fawcett, Jan 17, 2008
    #2
    1. Advertising

  3. Guest

    On Jan 17, 9:01 am, "Joe Fawcett" <> wrote:
    > <> wrote in message
    >
    > news:...
    >
    >
    >
    > > Hi all.

    >
    > > I have a huge amount of data burnt on a CD-Rom (coming from a DB),
    > > written on XML files.

    >
    > > I would like to show them to the user, by a web page.
    > > In my first version, I build the Html page by picking data from XML
    > > files and trasforming them by an XSL Transformation.

    >
    > > It works well, but as the data are quite a lot, it would be much
    > > better to have them in different pages (besides the trasformation is
    > > very slow).

    >
    > > I then tried to use Ajax.
    > > My thought was to open the XML file and then build the different pages
    > > with the right data range (es. 1 to 20 on the first page, 21 to 40 on
    > > the second, and so on...) by a javascript function.

    >
    > > Unfortunately since my script is not running under a web server, when
    > > I try to use the "open" method I get the error "Access is denied" (I'm
    > > using IE 7)

    >
    > > XMLHttpReqObj = new ActiveXObject("Microsoft.XMLHTTP");
    > > XMLHttpReqObj.open('GET', 'MyFile.xml', true);

    >
    > > Does anyone have any suggestion for solving the problem?
    > > How could I arrange my data into different pages?

    >
    > > Thanks a lot for your help...
    > > Bye!

    >
    > > Matteo

    >
    > If you do not have a web server then you can't use XmlHttpRequest, just use
    > mxsml2.domdocument.x.0 where x is the latest version available. 6 is the
    > best but 3 should be installed on most machines. You can then load the
    > DomDocument using the load() method.
    >
    > You may also need to lower the security settings for the "My Computer" zone
    > in IE.
    > First you need to make the zone available by tinkering with the registry or
    > running the following script, courtesy of Michael Harris:
    >
    > 'A vbscript (ShowMyComputerZone.vbs) that will "unhide"
    > 'the "My Computer" security zone in IE, allowing you to
    > 'customize the security settings for local HTML files.
    > '
    > 'See MS KB article Q182569 for details.
    > '
    > 'Description of Internet Explorer Security Zones Registry Entries
    > 'http://support.microsoft.com/support/kb/articles/q182/5/69.asp
    > '
    > 'A much better soution for IE5+ is to save local .htm/html files
    > 'with the .hta extension instead and execute them as trusted HTML
    > 'Applications.
    > '================================================================
    >
    > set shell = createobject("wscript.shell")
    > '=====
    > 'Changing this under the HKLM makes it effective for all users
    > 'at next logon...
    > '=====
    > HKLM_MyComputer_key = _
    >   "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion" _
    >  &"\Internet Settings\Zones\0\"
    > valuename = "Flags"
    > shell.RegWrite HKLM_MyComputer_key & valuename, 1, "REG_DWORD"
    > '=====
    > 'Changing this under the HKCU makes it effective for this user
    > 'immediately and at every logon...
    > '=====
    > HKCU_MyComputer_key = _
    >   "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion" _
    >  &"\Internet Settings\Zones\0\"
    > valuename = "Flags"
    > shell.RegWrite HKCU_MyComputer_key & valuename, 1, "REG_DWORD"
    >
    > msgbox "The 'My Computer' zone security " & vbcrlf _
    >      & "is now visible on the IE Security tab..."
    >
    > wscript.quit
    >
    > Obviously this may not be a practical option if other people need to use the
    > app, in that case consider using an HTA which has lower security
    > restrictions.
    > Detaisl of HTAs, which are essentially web pages saved with an HTA extension
    > instead of HTML are available of msdn.com.
    >
    > --
    >
    > Joe Fawcett (MVP - XML)
    >
    > http://joe.fawcett.name- Hide quoted text -
    >
    > - Show quoted text -


    Thanks a lot for your help, Joe!

    I'll try to use MSXML2.DomDocument.

    I also read something about HTAs (which I didn't know since now), and
    I'm actually thinking to use them, though, as far as I have
    understood, HTA Applications are restricted to be used with Internet
    Explorer.

    Bye!

    Matteo
     
    , Jan 17, 2008
    #3
  4. Joe Fawcett Guest

    <> wrote in message
    news:...
    > On Jan 17, 9:01 am, "Joe Fawcett" <> wrote:
    >> <> wrote in message
    >>
    >> news:...
    >>
    >>
    >>
    >> > Hi all.

    >>
    >> > I have a huge amount of data burnt on a CD-Rom (coming from a DB),
    >> > written on XML files.

    >>
    >> > I would like to show them to the user, by a web page.
    >> > In my first version, I build the Html page by picking data from XML
    >> > files and trasforming them by an XSL Transformation.

    >>
    >> > It works well, but as the data are quite a lot, it would be much
    >> > better to have them in different pages (besides the trasformation is
    >> > very slow).

    >>
    >> > I then tried to use Ajax.
    >> > My thought was to open the XML file and then build the different pages
    >> > with the right data range (es. 1 to 20 on the first page, 21 to 40 on
    >> > the second, and so on...) by a javascript function.

    >>
    >> > Unfortunately since my script is not running under a web server, when
    >> > I try to use the "open" method I get the error "Access is denied" (I'm
    >> > using IE 7)

    >>
    >> > XMLHttpReqObj = new ActiveXObject("Microsoft.XMLHTTP");
    >> > XMLHttpReqObj.open('GET', 'MyFile.xml', true);

    >>
    >> > Does anyone have any suggestion for solving the problem?
    >> > How could I arrange my data into different pages?

    >>
    >> > Thanks a lot for your help...
    >> > Bye!

    >>
    >> > Matteo

    >>
    >> If you do not have a web server then you can't use XmlHttpRequest, just
    >> use
    >> mxsml2.domdocument.x.0 where x is the latest version available. 6 is the
    >> best but 3 should be installed on most machines. You can then load the
    >> DomDocument using the load() method.
    >>
    >> You may also need to lower the security settings for the "My Computer"
    >> zone
    >> in IE.
    >> First you need to make the zone available by tinkering with the registry
    >> or
    >> running the following script, courtesy of Michael Harris:
    >>
    >> 'A vbscript (ShowMyComputerZone.vbs) that will "unhide"
    >> 'the "My Computer" security zone in IE, allowing you to
    >> 'customize the security settings for local HTML files.
    >> '
    >> 'See MS KB article Q182569 for details.
    >> '
    >> 'Description of Internet Explorer Security Zones Registry Entries
    >> 'http://support.microsoft.com/support/kb/articles/q182/5/69.asp
    >> '
    >> 'A much better soution for IE5+ is to save local .htm/html files
    >> 'with the .hta extension instead and execute them as trusted HTML
    >> 'Applications.
    >> '================================================================
    >>
    >> set shell = createobject("wscript.shell")
    >> '=====
    >> 'Changing this under the HKLM makes it effective for all users
    >> 'at next logon...
    >> '=====
    >> HKLM_MyComputer_key = _
    >> "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion" _
    >> &"\Internet Settings\Zones\0\"
    >> valuename = "Flags"
    >> shell.RegWrite HKLM_MyComputer_key & valuename, 1, "REG_DWORD"
    >> '=====
    >> 'Changing this under the HKCU makes it effective for this user
    >> 'immediately and at every logon...
    >> '=====
    >> HKCU_MyComputer_key = _
    >> "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion" _
    >> &"\Internet Settings\Zones\0\"
    >> valuename = "Flags"
    >> shell.RegWrite HKCU_MyComputer_key & valuename, 1, "REG_DWORD"
    >>
    >> msgbox "The 'My Computer' zone security " & vbcrlf _
    >> & "is now visible on the IE Security tab..."
    >>
    >> wscript.quit
    >>
    >> Obviously this may not be a practical option if other people need to use
    >> the
    >> app, in that case consider using an HTA which has lower security
    >> restrictions.
    >> Detaisl of HTAs, which are essentially web pages saved with an HTA
    >> extension
    >> instead of HTML are available of msdn.com.
    >>
    >> --
    >>
    >> Joe Fawcett (MVP - XML)
    >>
    >> http://joe.fawcett.name- Hide quoted text -
    >>
    >> - Show quoted text -

    >
    > Thanks a lot for your help, Joe!
    >
    > I'll try to use MSXML2.DomDocument.
    >
    > I also read something about HTAs (which I didn't know since now), and
    > I'm actually thinking to use them, though, as far as I have
    > understood, HTA Applications are restricted to be used with Internet
    > Explorer.
    >
    > Bye!
    >
    > Matteo


    Actually I'm not sure if they are IE only, they use the underlying rendering
    engine of IE but Windows has that even if they run Firefox, as any European
    Commission will tell you :)
    However no browser is going to take happily to you reading file from a local
    drive so it maybe worth experimenting.

    --

    Joe Fawcett (MVP - XML)
    http://joe.fawcett.name
     
    Joe Fawcett, Jan 18, 2008
    #4
  5. Sam Hobbs Guest

    <> wrote in message
    news:...
    > Hi all.
    >
    > I have a huge amount of data burnt on a CD-Rom (coming from a DB),
    > written on XML files.
    >
    > I would like to show them to the user, by a web page.
    > In my first version, I build the Html page by picking data from XML
    > files and trasforming them by an XSL Transformation.
    >
    > It works well, but as the data are quite a lot, it would be much
    > better to have them in different pages (besides the trasformation is
    > very slow).


    I don't know what the data looks like and I don't know what the requirements
    are in terms of what software can be used but perhaps the data could be
    converted to some other format such as Access or SQL Server or MySQL and
    then formatted from that.
     
    Sam Hobbs, Feb 24, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathan Sokalski
    Replies:
    5
    Views:
    1,044
    Gaurav Vaish \(www.Edujini-Labs.com\)
    Jan 10, 2007
  2. Replies:
    4
    Views:
    321
    Bruno Desthuilliers
    Mar 3, 2007
  3. Nathan Sokalski
    Replies:
    4
    Views:
    314
    Nathan Sokalski
    Dec 21, 2006
  4. Nathan Sokalski
    Replies:
    4
    Views:
    353
    Nathan Sokalski
    Dec 21, 2006
  5. Replies:
    1
    Views:
    129
    Martin Honnen
    Jan 16, 2008
Loading...

Share This Page