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

Filter nodelist

Subject: Filter nodelist
From: Martin Kupisch <Kupisch@xxxxxxxxxxxxxx>
Date: Thu, 07 Nov 2002 12:11:25 +0100
xml node list
Hello everyone,

I have an XML document that contains a few 'product' elements with 'id'
attributes. Because I have to operate on these products a few times I
build a variable that just takes all products with the expression
'descendant::product'. Sometimes I have to iterate over all products.
But that is not all I do with the list. My problem: I have to get the
count of all products from this node-list that have the same id like a
certain product in the list  and that's position in the node-list is
lower. Example:

[product id="A",
 product id="B",
 product id="C",
 product id="B",
 product id="B",  <-
 product id="D",
 product id="E"]

So if I have the product at position 5 the result of the count should be
2, because of the products at position 2 and 4 with the same id.

Any ideas? Thanks.


 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.