[Home] [By Thread] [By Date] [Recent Entries]
At 2013-03-11 18:31 -0400, Wendell Piez wrote:
Could someone please remind me the most graceful way in XPath 2.0 of determining dynamically whether any arbitrary $n is bound to a node or sequence of nodes (i.e., no atomic values)? instance of node()* There's some furious parameterization going on and I just can't remember this. (It's not the kind of thing easy to search for either.) Not sure what you are referring to regarding parameterization. I hope the illustration below helps. . . . . . . . . Ken t:\ftemp>type wendell.xsl
<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0"><xsl:output method="text"/> <xsl:template match="/">
<xsl:variable name="test1" select="doc(''),doc('')/*/xsl:*"/>
<xsl:value-of select="count($test1),$test1 instance of node()*,'
'"/>
<xsl:variable name="test2" select="$test1,'hello',$test1"/>
<xsl:value-of select="count($test2),$test2 instance of node()*,'
'"/>
</xsl:template></xsl:stylesheet> t:\ftemp>xslt2 wendell.xsl wendell.xsl 3 true 7 false t:\ftemp>
|

Cart



