xsl-list
[Top] [All Lists]

RE: XSLT Disable-Output-Escaping Not Working

2004-05-13 09:36:57
Don't use disable-output-escaping if you don't understand it. It's a way of
generating invalid XML or HTML for use in the rare occasions where that's
what you need to do. It's doing just that here, which means it IS working,
and isn't what you want.

Michael Kay


-----Original Message-----
From: Shelli D. Orton [mailto:shelli(_dot_)orton(_at_)wmode(_dot_)com] 
Sent: 13 May 2004 16:29
To: XSL List
Subject: [xsl] XSLT Disable-Output-Escaping Not Working

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 &amp; That", the 
&amp; is escaped
resulting in a title of "This &amp;amp; That" which the 
browser displays as
"This &amp; That".  Shouldn't the result be "This &amp; 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


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--





<Prev in Thread] Current Thread [Next in Thread>