XML, XSL, RSS2 and image problems
-
Im at a bit of a dead end and I am looking for any help I can find.
I have a really nice install of WordPress and I am using FeedWordPress to feed RSS posts into WordPress.
One of the feeds I use is Amazons RSS feed which is great because it includes Images in with the RSS Description (using CDATA).
I have recently signed with Tradedoubler and intend to do the same thing.
They also have a rss feed but without images. They also have a standard XML feed which includes image data.
It should be a simple case of writing a XSL to transform the XML into a RSS. No matter what I try I cant seem to do it.
In the XML the tag that holds the image location is called imageUrl
Below is where I am at
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <rss version="2.0"> <channel> <title>TradeDoubler Product Feed RSS Feed</title> <link>http://www.tradedoubler.com</link> <description>TradeDoubler Product Feed RSS Feed</description> <xsl:for-each select="products/product"> <item> <title> <xsl:value-of select="name"/> </title> <link> <xsl:value-of select="productUrl"/> </link> <description> <xsl:value-of select="description"/> <xsl:text disable-output-escaping="yes"> </xsl:text> <xsl:value-of select="currency"/> <xsl:text disable-output-escaping="yes"> </xsl:text> <xsl:value-of select="price"/> <xsl:text disable-output-escaping="yes"><img src="</xsl:text><xsl:value-of select="imageUrl"/><xsl:text disable-output-escaping="yes">" /></xsl:text> </description> <xsl:for-each select="TDCategories/TDCategory"> <category> <xsl:value-of select="name"/> </category> </xsl:for-each> <guid isPermaLink="false"> <xsl:value-of select="TDProductId"/> <xsl:text disable-output-escaping="yes"> </xsl:text> at tradedoubler.com </guid> </item> </xsl:for-each> </channel> </rss> </xsl:template> </xsl:stylesheet>
Please help as its driving me scatty.
- The topic ‘XML, XSL, RSS2 and image problems’ is closed to new replies.