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

Re: Select nodes with equal position

Subject: Re: Select nodes with equal position
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 2 Apr 2005 19:58:37 +0100
xsl select position
using a variable is a sensible way to go But don't do this

  <xsl:variable name="mypos">
    <xsl:value-of select="position()"/>
  </xsl:variable>

It doesn't store a number in $mypos it stores a result tree fragment
with a root node with child a text node with string value the decimal
expansion of teh number. This is expensive to build, and has to be
converted back to a number before you use it.

  <xsl:variable name="mypos" select="position()"/>

stores a number in $mypos.

If you really object to variables

  <xsl:value-of select="../../colspec[position() = count(current()/preceding-sibling::entry)+1]/@colname"/>

but that's likely to be slower

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.