I hope this makes sense.
I have "flat" outline list structures, the numbering of which is
controlled by a "level" attribute, that I renumber based on name-spaced
change tracking tags where I need to output Accept-All and Reject-All
versions to be redlined in other application formats after
transformations. (They're good for unsophisticated users who have
trouble editing embedded lists.)
The best I've come up with is a recursive template to count previous
same level items and stop at a lower level (skipping adds/deletes as
needed).
Is there an XPATH-2 select that can count preceding-siblings up to the
first preceding @level = $lvl-1?
<xsl:variable name="lvl" select="@level"/>
...
... select="(count(preceding-sibling::section[@level=$lvl]) + 1) -
count(preceding-sibling::section[@level=$lvl][not(following-sibling::sec
tion[preceding-sibling::section[@level=number($lvl)-1][1]])])"
picks up all previous same-level items.
<flatOutline>
<item numDisplay="I." level="1" />
<item numDisplay="II." level="1" />
<item numDisplay="A." level="2" />
<item numDisplay="B." level="2" />
<item numDisplay="C." level="2" />
<item numDisplay="III." level="1"/>
<item numDisplay="A." level="2"/>
<item numDisplay="1." level="3" />
<item numDisplay="2." level="3" />
<item numDisplay="3." level="3" />
<item numDisplay="4." level="3" />
<item numDisplay="B." level="2"/>
<item numDisplay="1." level="3" />
<item numDisplay="2." level="3" />
<item numDisplay="3." level="3" />
<item numDisplay="C." level="2"/>
</flatOutline>
Lou Argyres
Continuing Education of the Bar - California
Oakland, CA
Lou(_dot_)Argyres(_at_)ceb(_dot_)ucla(_dot_)edu
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--