[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Tree Fragment versus Node Set

Subject: RE: Tree Fragment versus Node Set
From: "Kevin L. Cobb" <kevin.cobb@xxxxxxxxxxxx>
Date: Thu, 15 Sep 2005 12:42:44 -0400
name variations kevin
Now I have a problem getting values out of my node-set which was
converted from the tree fragment.

   <xsl:variable name="myVar">
      <xsl:call-template name="buildMyVariableNode">
         <xsl:with-param name="arg1" select="'test1'"/>
         <xsl:with-param name="arg2" select="'test2'"/>
      </xsl:call-template>
   </xsl:variable>

   <xsl:value-of
select="xalan:nodeset($myVar)/result/firstElement/text()"/>

I get nothing back for the value-of tag. My XML snippet that is the
nodeset
would look something like this:

   <result>
      <firstElement>some value</firstElement>
      <secondtElement>some value</secondElement>
   </result>

I've tried variations on the XPATH expression but nothing is working.
This simply
ouput of the nodeset works as expected.

   <xsl:value-of select="$myVar"/>

And also ...

   <xsl:value-of select="xalan:nodeset($myVar)"/>

I know I must be missing something simple but I can't seem to
see if for the trees.

-Kevin

-----Original Message-----
From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Sent: Thursday, September 15, 2005 12:15 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Tree Fragment versus Node Set

> is there a
> better way to do this?

No, in 1.0 there isn't. You sometimes need to create result tree
fragments.
But don't do it when you don't need to.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Kevin L. Cobb [mailto:kevin.cobb@xxxxxxxxxxxx]
> Sent: 15 September 2005 15:33
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Tree Fragment versus Node Set
>
> I realize that its always better to form my variables into node-sets
> versus tree fragments by using the select attribute whenever possible.
> But, can one ALWAYS prevent (in XSLT 1.0) making a tree fragment? For
> example, if building my variable comes from a template call, is there
> a better way to do this?
>
>    <xsl:variable name="myVar">
>       <xsl:call-template name="buildMyVariableNode">
>          <xsl:with-param name="arg1" select="'test1'"/>
>          <xsl:with-param name="arg2" select="'test2'"/>
>       </xsl:call-template>
>    </xsl:variable>
>
> -Thanks,
>
> Kevin

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.