• Advertisement
Sign in to follow this  

XML in a webpage - [Still questions unanswered]

This topic is 4341 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to use XML in a webpage like so: 1. I would like to create a news page which will get its data from the XML file. This is so instead of typing in the news for today into the HTML file itself, just type it into the XML file and the news will autoupdate. I want to hide the aspects of HTML to the news updater person (please excuse the term) pretty much. If all this is possible are there any websites that can show me how? I only know some basic XML. Thanks in advance. [Edited by - geekalert on March 27, 2006 10:57:20 PM]

Share this post


Link to post
Share on other sites
Advertisement
Rather then using XML for the medium for data management, you might want to use a backend database instead as that's what they're designed for. Along side this database, you'd use a server-side extensions like PHP or ASP.NET to render from this data.

If you really have to use XML, you could use XSLT to render the XML into HTML. There are some great examples right there on the wiki article of the basics of XSLT.

Share this post


Link to post
Share on other sites
XSLT and XML are simple and very robust and all browsers should support them both.

Share this post


Link to post
Share on other sites
My Windows 2000 does not seem to support XSLT? (Windows XP is fine)

This is a potential problem because of the audience of the website I intend to target.

Are there any ways around this?

Share this post


Link to post
Share on other sites
You can process the XSLT on the server side, using mod_xslt, PHP, or any of a number of other tools.

[Edited by - igni ferroque on March 28, 2006 2:46:35 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by geekalert
My Windows 2000 does not seem to support XSLT? (Windows XP is fine)

This is a potential problem because of the audience of the website I intend to target.

Are there any ways around this?
I thought XSLT was browser dependent (assuming you're doing client side)

Share this post


Link to post
Share on other sites
Quote:
I thought XSLT was browser dependent (assuming you're doing client side)


By Windows 2000 I mean Internet Explorer 5.0

Share this post


Link to post
Share on other sites
Quote:
Original post by C J W
XSLT and XML are simple and very robust and all browsers should support them both.


But nearly no browser does?!

Share this post


Link to post
Share on other sites
IE 5 sucks for XSLT, don't use it. In fact, client-side XSLT is finicky enough, even with IE 6+ and Firefox 1.5+ that I would recommend against it.

However, you can use server-side XSLT, either using mod_xslt, or using static transform using something like Xalan. That will convert XML to HTML according to rules that you set up.

Another way of doing it would be to generate the page using a PHP script, and have that script read the XML data file and spit out the corresponding XML. That may involve less new technologies, if you already know PHP.

Share this post


Link to post
Share on other sites
Quote:
Original post by Konfusius
Quote:
Original post by C J W
XSLT and XML are simple and very robust and all browsers should support them both.


But nearly no browser does?!


To my best knowledge only opera does not support it.

Share this post


Link to post
Share on other sites
The versions of Opera, Firefox and IE that I use regularly all support an XML webpage styled with XSLT.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement