xsl-list
[Top] [All Lists]

Re: Select nodes with equal position

2005-04-02 11:58:37


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
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--