Subject: Re: Testing for CDATA From: Allen Haws <joeshmoe@xxxxxxxxxx> Date: Tue, 08 Aug 2000 09:57:41 -0700 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Testing for CDATA, Kay Michael | Thread | Re: Testing for CDATA, Jeni Tennison |
RE: FAQ for this list, Spychalski, Frank | Date | XMTP XML file breaks Saxon and XT, Philip Gooch |
Month |