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

RE: Selecting and printing certain nodes

Subject: RE: Selecting and printing certain nodes
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Fri, 20 Feb 2004 19:04:49 +0100
tia andreas
> -----Original Message-----
> From: Andreas L. Delmelle
>
<snip />
> So, make the variable
> <xsl:variable name="vdo" select="node()" />
>

Come to think of it, I'm wondering what difference the intermediate variable
makes:

<xsl:variable name="somevar" select="node()" />

<xsl:for-each select="../element">
  <xsl:apply-templates select="$somevar">
    <xsl:with-param name="p" select="." />
...

Or

<xsl:for-each select="../element">
  <xsl:apply-templates select="../body/node()">
    <xsl:with-param name="p" select="." />


My inclination would be to assume that in the latter the expression
'../body/node()' would be evaluated for each ../element, where in the first
case the corresponding expression from a different context would be
evaluated only once, and the result is then readily available as a literal
for the context of the xsl:for-each. (making the first the better option
only in cases where the node-set is small but the expression to match it is
complex?)

Anyone to confirm/reject this assumption?

TIA

Andreas


 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.