[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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@xxxxxxxxxx Phone: 480.926.2368 ext 343 Direct: 480.558.2445 ******************************************* XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|