Forum Moderators: open

Message Too Old, No Replies

XML file - generate RSS file using XSLT

Already have XML file but want to pull out an RSS feed

         

cazzzk

11:34 am on Feb 12, 2008 (gmt 0)

10+ Year Member



I'm completely new to XSL.

I have an XML file which contains news items. This file was created before its ultimate use was realised (i.e. using it as an RSS feed as well as a page on our website) so the tags within the file are not RSS compatible.

All I need is for someone to point me in the right direction so I know where to start reading!

Do I use XSLT to pull out the required information from the wrongly-named tags in the XML file and to spit it out again as a usable RSS file? Can I get XSLT to take, for example, a <mainhead> tag and put its content into a <title> tag?

Thanks for any help you can offer!

cmarshall

11:43 am on Feb 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Absolutely. That's exactly what XSLT is good for. The exact code you'd use would depend on the relationship between the source and the desired destination.

httpwebwitch

3:23 pm on Feb 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



take, for example, a <mainhead> tag and put its content into a <title> tag?

you'll end up doing something like this in your stylesheet:


<title>
<xsl:value-of select="mainhead">
</title>