|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Testing the type of the current node
> > <xsl:when test="self::text()">
>
> I can't see anything wrong with this, though I haven't had time to try it.
> Which product(s) have you tried it on - it's always worth telling us. And if
> you really think something should work and isn't working, it's always worth
> trying it on more than one product.
Though I did, and I thought that both XT and Saxon produced false in
this circumstance, I went back this morning and wrote the following test
case to be absolutely sure that I was right. Strange but true, Saxon
seems to have a bug in this department:
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:variable name="textnode">Text node</xsl:variable>
<xsl:template match="/">
<xsl:for-each select="document('')/*/xsl:variable">
<xsl:text>child::text() = </xsl:text>
<xsl:choose><xsl:when test="child::text()">true</xsl:when>
<xsl:otherwise>false</xsl:otherwise></xsl:choose>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:for-each select="document('')/*/xsl:variable/text()">
<xsl:text>self::text() = </xsl:text>
<xsl:choose><xsl:when test="self::text()">true</xsl:when>
<xsl:otherwise>false</xsl:otherwise></xsl:choose>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
>From Saxon:
child::text() = true
self::text() = false
>From XT:
child::text() = true
self::text() = true
Steve
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
|

Cart








