Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > How to show XML data in web pages?

Reply
Thread Tools

How to show XML data in web pages?

 
 
starfoxsb@gmail.com
Guest
Posts: n/a
 
      01-16-2008
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
 
Reply With Quote
 
 
 
 
Joe Fawcett
Guest
Posts: n/a
 
      01-17-2008
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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\CurrentVersio n" _
&"\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\CurrentVersio n" _
&"\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


 
Reply With Quote
 
 
 
 
starfoxsb@gmail.com
Guest
Posts: n/a
 
      01-17-2008
On Jan 17, 9:01*am, "Joe Fawcett" <(E-Mail Removed)> wrote:
> <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > 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\CurrentVersio n" _
> *&"\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\CurrentVersio n" _
> *&"\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
 
Reply With Quote
 
Joe Fawcett
Guest
Posts: n/a
 
      01-18-2008


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Jan 17, 9:01 am, "Joe Fawcett" <(E-Mail Removed)> wrote:
>> <(E-Mail Removed)> wrote in message
>>
>> news:(E-Mail Removed)...
>>
>>
>>
>> > 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\CurrentVersio n" _
>> &"\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\CurrentVersio n" _
>> &"\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

 
Reply With Quote
 
Sam Hobbs
Guest
Posts: n/a
 
      02-24-2008
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to show XML data on web pages? starfoxsb@gmail.com Javascript 1 01-16-2008 04:37 PM
[Announce] Stylus Studio 2007 XML Enterprise Suite Released: XML Pipeline, XML Publishing and Data Conversion API's stylusstudio@gmail.com Java 0 09-26-2006 05:04 PM
[ANN] Stylus Studio 2007 XML Enterprise Suite Released: XML Pipeline, XML Publishing and Data Conversion API's Stylus Studio XML 0 09-26-2006 04:49 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM



Advertisments