How to show XML data in web pages?

S

starfoxsb

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
 
J

Joe Fawcett

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.
 
S

starfoxsb

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
 
J

Joe Fawcett

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.
 
S

Sam Hobbs

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top