This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Variable : string or temporary tree
Hello,
What is the best way to find out whether a variable is a string or a tree ?
For example,
<xsl:variable name="cmdRequest" select='Z_ShowFile'>
or
<xsl:variable name="cmdRequest">
<request>Z_ShowFile</request>
<request>Z_GetPips</request>
</xsl:variable>
As I'm new to XSLT, the only way I can think of is :
<xsl:variable name="treeTest">
<node>
<xsl:copy-of select="$cmdRequest"/>
</node>
</xsl:variable>
<xsl:choose>
<xsl:when test="$treeTest/node/node()">
<!-- $cmdRequest is a tree -->
</xsl:when>
<xsl:otherwise>
<!-- $cmdRequest is a string -->
</xsl:otherwise>
</xsl:choose>
Is there a shorter way to test it ?
Thank you
Siarhei Biarozkin
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list