[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: number continuation problem
David, Thanks for your help so far, I could use it some more as Im really stuck converting what we have to multi-level... <root> <if> <node>(1)</node> </if> <else> <node>(1)</node> <node>(2)</node> <node>(3)</node> <node>(4)</node> <if> <node>(5)</node> <node>(6)</node> </if> <else> <node>(5)</node> </else> </else> <if> <node>(7)</node> <node>(8)</node> </if> <else> <node>(7)</node> </else> </root> Here the point of interest is the nested <if> in the first <else>. The numbering should follow from the parent (as in brackets). Im working with your last post: 1 + count(preceding-sibling::node) + count(parent::if/preceding-sibling::if[count(node)>count(following-sibling::*[1][self::else]/node)]/node) + count(parent::else/preceding-sibling::if[position()>1][count(node)>count(following-sibling::*[1][self::else]/node)]/node) + count(../preceding-sibling::else[count(node)>=count(preceding-sibling::*[1][self::if]/node)]/node Im going down the route of selecting all preceding <step>'s, then filtering the ones we don’t want, instead of counting in all the ones we do (as it works at the moment). Is that the right approach? I can virtually gurantee nesting only goes one deep, so I also tried adding another set of count()'s to the xpath that work on parents parents, but to no avail (and I think the preceding:: route is the preferred one). Any further assistance would be great, Cheers andrew --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|