I transform some RSS XML feeds using XSLT. Basically there are two types I edit :
1. <rss><channel>some tags about the RSS<item></item></channel></rss>
2. <feed>some tags about the RSS<entry></entry></feed>
using this stylesheet. (It gets some files from a paths.xml file)
<xsl:stylesheet version="1.0" xmlns:f="http://www.w3.org/2005/Atom" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/*">
<NEWrss>
<xsl:for-each select="file">
<xsl:apply-templates
select="document(.)/*//channel | document(.)/f:feed/f:entry">
<xsl:with-param name="file" select="."/>
</xsl:apply-templates>
</xsl:for-each>
</NEWrss>
</xsl:template>
On the first RSS I get correctly the output with the tags between <channel> and first <item>. Those are some tags that contain info about the blog, like the title.
However, on the second, those tags (title of the blog… found between the <feed> and first <entry>) are gone after the transformation. The tags in appeared correctly.
My question is how can I get those tags too ?
A sample Feed like the 2nd structure is http://feeds.feedburner.com/EFENPRESS-
Thank you.
I think what you’re saying is you don’t see the text preceding the f:feed element. That’s because your select statement doesn’t include it – it only selects f:feed/f:entry and channel elements. Maybe you should try processing f:feed instead of f:feed/f:entry? or f:feed/node(), which will select both f:feed/text() and f:feed()/f:entry.