Subject: RE: [xsl] Filter nodelist From: Jarno.Elovirta@xxxxxxxxx Date: Thu, 7 Nov 2002 13:38:49 +0200 |
Hi, > 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. E.g. count($theCurrentProduct/preceding::product[@id = $theCurrentProduct/@id]) but it's very inefficient. Cheer, Jarno XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Filter nodelist, Martin Kupisch | Thread | RE: [xsl] Filter nodelist, Adam van den Hoven |
Re: [xsl] fastest way to do project, Kasper Nielsen | Date | Re: [xsl] XSL Doubt regarding refer, Vasu Chakkera |
Month |