Subject: Counting siblings... From: Giles Smith <Giles.Smith@xxxxxxxxxxxx> Date: Tue, 13 Jun 2000 11:31:22 +0100 |
Hi, I have an interesting problem, and wondered if your clever people might be able to offer some possible solutions: I have an XML file structure like this: <root> <item level=0> </item> <item level=1> </item> <item level=2> </item> <item level=1> </item> <item level=2> </item> <item level=0> </item> <item level=1> </item> </root> Considering the first 5 item elements, both items with a level=1 are direct replies to the first item with a level=0. The first item with a level=2 is a direct reply to the first item with a level=1, and so on. The second four items are all classed as replies to the first item with a level=0. Had the XML been nested, the 1st 5 would have looked like this; <item level=0> <item level=1> <item level=2> </item> </item> <item level=1> <item level=2> </item> </item> </item> Now, the problem comes as a result of the flat-file structure. I need to count the number of replies to each item element. Had it been nested, I could have counted the descendants. Now, I need to count the following-siblings, who's level is higher than that of the context element, but only where the following-siblings continue to have a higher level (i.e., stop the count when the level decreases again). As you can probably gauge from my poor phraseology, I'm a bit confused! Any help would be gratefully accepted! Thanks, Giles Smith XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Unique set values, Carlos Sanchez | Thread | Re: Counting siblings..., Nick Browne |
RE: escaping problems with URL, juggy | Date | Re: what if use of up-to-date xslt , Dan Morrison |
Month |