This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Variable containing tree
- From: "Filipe Correia" <filipe dot correia at paradigmaxis dot pt>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 07 Jun 2002 09:49:17 +0100
- Subject: [xsl] Variable containing tree
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi,
I'm assigning a set of nodes to a variable like this:
<xsl:variable name="var">
<xsl:apply-templates/>
</xsl:variable>
wich I would like to output later on only if the variable is not empty.
I've tried outputing it like this:
<xsl:if test="$restFormElements != '' ">
<result>
<xsl:apply-templates select="$restFormElements"/>
</result>
</xsl:if>
but the test is never true. I'm not sure how to test this...
But beyond the test part... If I just try to output my variable:
<xsl:apply-templates select="$restFormElements"/>
xalan exits with an exception: "Can not convert #RTREEFRAG to a NodeList!"
so I tried to convert the tree fragmente to a node list using xalan's built in "nodeset()"
function. like this:
<xsl:apply-templates select="xalan:nodeset($restFormElements)"/>
but I only get the the resulting tree's root node... and not the entire tree as I was expecting.
How is this behavior explained?
thks in advance!
Filipe
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list