Sign in to follow this  
geekalert

XML in a webpage - [Still questions unanswered]

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
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
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
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:
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this