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

Re: limit count() to nodes with a position() < the

Subject: Re: limit count() to nodes with a position() < the postion of the current node
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 9 Sep 2003 09:57:57 +0100
xsl count all nodes
> But I want to take this one step further and return the count of all nodes 
> that have a position()

Note that position() is not a property of the node, like name() it is a
function of the node and of the current node list that is being
processed. if you select  nodes with parent:: axis for example,
position() is always one.

<xsl:key name="linkCount" match="lid[position() &lt; 5]" use="."/>

That will index all lid elements that have less than four previous
sibling lid elements. Isn't that what you want?


> I expected it to return the count of the nodes that matched the current 
> context node as long as there postion was less than 5. 

It's hard to interpret this as a xsl:key itself doesn't return anything
and as I say above position() isn't a property of a node.

As xsl:key has to be top level the current context node is the root /
at that point.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. 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


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.