XML in a webpage - [Still questions unanswered]

Started by
10 comments, last by C J W 18 years ago
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]
A JPEG is worth a thousand and twenty four DWORD's. ;)
Note: Due to vacationing my website will not be updated till late-August. Of course I still have internet, but who wants to program during a vacation?
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.
Rob Loach [Website] [Projects] [Contact]
XSLT and XML are simple and very robust and all browsers should support them both.
ToDoList.GrowthRate = WorkRate*2, it's more efficient to not work.
You can include XML without xslt in any webpage using XML Islands

see XML data island

Note; may not be visible in all browsers
Game Engineering ResearcherSee www.helpyouplay.com
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?
A JPEG is worth a thousand and twenty four DWORD's. ;)
Note: Due to vacationing my website will not be updated till late-August. Of course I still have internet, but who wants to program during a vacation?
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]
Free Mac Mini (I know, I'm a tool)
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)

F-R-E-D F-R-E-D-B-U-R...G-E-R! - Yes!
Quote:I thought XSLT was browser dependent (assuming you're doing client side)


By Windows 2000 I mean Internet Explorer 5.0
A JPEG is worth a thousand and twenty four DWORD's. ;)
Note: Due to vacationing my website will not be updated till late-August. Of course I still have internet, but who wants to program during a vacation?
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?!
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.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement