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

Re: getting the node position in source xml in a varia

Subject: Re: getting the node position in source xml in a variable
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 27 Feb 2002 15:11:58 +0000
select node position
Hi Gurvinder,

> I have one more query... you said that i am not passing the result
> tree fragment what does it mean... i thought when i select nodes and
> pass it as parameter is is passing result tree fragment

No - when you select nodes and pass them using the select attribute of
xsl:with-param, then you pass those nodes as a *node set*. It's only
if you use the *content* of the xsl:with-param that you create a
result tree fragment. For example, if you did:

  <xsl:call-template name="lookup">
    <xsl:with-param name="name">test</xsl:with-param>
    <xsl:with-param name="nodes">
      <xsl:copy-of select="/test/Level2" />
    </xsl:with-param>
  </xsl:call-template>

With this call, both $name and $nodes are result tree fragments.

It doesn't matter too much with $name, because it's a result tree
fragment whose root node only has one child - a text node with the
value 'test' - although a result tree fragment is a little more
unweildy for the processor than a plain string would be.

On the other hand, the $nodes parameter is set to a result tree
fragment whose root node has a number of Level2 element children.
Because that result tree fragment has structure, you usually have to
convert it back into a node set (e.g. using msxsl:node-set()) to do
anything useful with it.

This means that in general you should use the select attribute to set
the values of variable-binding elements, such as xsl:variable,
xsl:param and xsl:with-param.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.