This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Variable containing tree


  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]