This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Testing for CDATA
To follow my previous question up...
Can I test for a text node?
I've tried using,
<xsl:choose>
<xsl:when test="text()">
<xsl:call-template name="displayText"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
.
.
.
<xsl:template name="displayText">
<xsl:value-of select="." display-output-escaping="yes"/>
</xsl:template>
But since there is a text node as a child, it's always true.
Any ideas?
Allen
Kay Michael wrote:
>
> > Is there a way to test for a CDATA section?
>
> No, text in a CDATA section looks exactly the same to the XSLT processor as
> text outside a CDATA section. For example,
>
> <![CDATA[xxx]]> looks exactly like xxx
> <![CDATA[<>]]> looks exactly like <>
>
> This is because they are intended to be equivalent ways of writing the same
> thing.
>
> Mike Kay
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
--
*******************************************
Allen Haws
Unicon Inc.
Email: joeshmoe@unicon.net
Phone: 480.926.2368 ext 343
Direct: 480.558.2445
*******************************************
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list