Shelli D. Orton
2004-05-13 16:29:13 UTC
Hi,
I'm fairly new to XLST and have come across this problem. I have a template
that creates an image element as below:
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="Content/Title/image">
<xsl:value-of select="Content/Title/image" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$defaultImage"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="MetaData/title" disable-output-escaping="yes"/>
</xsl:attribute>
</xsl:element>
When the value of MetaData/title is "This & That", the & is escaped
resulting in a title of "This &amp; That" which the browser displays as
"This & That". Shouldn't the result be "This & That" which the
browser displays as "This & That"? I have used the disable-output-escaping
attribute in many other places and it has always worked before.
Thanks for any help.
Shelli
I'm fairly new to XLST and have come across this problem. I have a template
that creates an image element as below:
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="Content/Title/image">
<xsl:value-of select="Content/Title/image" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$defaultImage"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="MetaData/title" disable-output-escaping="yes"/>
</xsl:attribute>
</xsl:element>
When the value of MetaData/title is "This & That", the & is escaped
resulting in a title of "This &amp; That" which the browser displays as
"This & That". Shouldn't the result be "This & That" which the
browser displays as "This & That"? I have used the disable-output-escaping
attribute in many other places and it has always worked before.
Thanks for any help.
Shelli