[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Numbering in a hierarchy
Hi. I'm currently reading a number of of excellent resources on numbering (mostly archives from this list), but I'm still torn as to what's the best (OK, easiest) way to approach to number my elements. I want to put the numbering scheme in the elements' attributes recursively. My sample input: <top> <group> <item>test</item> <item>test</item> <item>test</item> <item>test</item> </group> <group> <item>test</item> <otheritem>test</otheritem> <item>test</item> <item>test</item> <item>test</item> </group> </top> My desired output: <top> <group number="1"> <item number="1-1">test</item> <item number="1-2">test</item> <item number="1-3">test</item> <item number="1-4">test</item> </group> <group number="2"> <item number="2-1">test</item> <otheritem>test</otheritem> <item number="2-2">test</item> <item number="2-3">test</item> <!-- etc --> </group> </top> My initial approach was to simply use <xsl:number/>, is it too much work or is it better to use saxon:assign for that? Further notes: It doesn't need to be recursive, just two levels are OK. Also other elements can be sometimes in between the nodes to be counted as shown in example. It seems my brain goes to sleep after 4pm and I need some pointers again. Thanks in advance, Lech
|
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
|