Unable to get content value: encoded from Wordpress RSS

I have this XSLT file that I am using to translate Wordpress articles from a category RSS feed (namely this one ). Basically everything works as it should, expect when I try to get the value of the "content: encoded" element using xsl:value-of

. When using the following code, nothing is returned. Is there something I'm missing or the colon in "content: encoded" has messed up the XSLT?

<?xml version="1.0"?>


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0"
     exclude-result-prefixes="dc">
<xsl:output method = "html" omit-xml-declaration="yes" />
<xsl:param name="limit"></xsl:param>
<xsl:param name="hide">none</xsl:param>

<xsl:template match="/">
    <xsl:for-each select="rss/channel/item">
        <xsl:variable name="link" select="link"/>

        <xsl:element name="a">
            <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
            <xsl:value-of select="title" disable-output-escaping="yes"/>
        </xsl:element>
        <br />
        <xsl:value-of select="content:encoded" />

    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

      

Many thanks.

+3


source to share


1 answer


Ended up figuring out what the colon was doing funky. Silly Wordpress. So I used *[name()='content:encoded']

instead content:encoded

.



+10


source







All Articles