As pointed out, there are some ways to have third party sites parse the xml to html for you - ie google - but here's a way I've found to parse a feed using xsl and javascript.
First off - to give credit where credit is due - this idea was manipulated from the original found at http://www.daymap.net/blog/?p=5
For an example and for all the source files - the testing folder is at:
http://www.unl.edu/health/xml_test/
The files used:
http://www.unl.edu/health/xml_test/news.xml
http://www.unl.edu/health/xml_test/test.xsl
http://www.unl.edu/health/xml_test/test.js
Basically the way it works is that the javascipt calls up the xsl file (xsl is a kind of stylesheet (like css is to html) for xml files - for more info on xsl check out http://www.w3schools.com/xsl/) and the xml into an object within the body of your existing page.
Create a xml file based upon news.xml (this is pretty bare bones - you'll probably want to add more elements - and don't forget to fill in the <guid> element) Tweak the xsl file if you want the feed to show up differently or if you want more/less elements displayed on the page. Finally change the url's in the test.js file to point to your specific xsl and xml files.
Now for the html page - insert the styles for any classes from your xsl file into the <head> of the page - you're going to also need to change the <body> tag to to <body>. Then insert the following into the maincontent area.
- Code: Select all
<script></script>
<div></div>
Of course with the source pointing to your local copy of the javascript file. Upload all the files to your server and test it out. It will display all items in your feed so this might not be the most practical option for very long feeds but works splendidly for shorter feeds.
Any questions - or if my instructions have any errors - simply post a reply and I'll try to answer/fix anything that is confusing/wrong.
