|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Simple m-n numbering within deeper m-m-...-n structure
Hi
Doubtless this is trivial to anyone but a novice - but I'm a novice.
I have a document structure that contains sections nested to arbitrary
depth. Sections may have complex content but their ancestry will consist
only of sections (up to the document root).
I can number my sections (1, 2, 2-1, 2-1-1, 2-2, 3 etc.) but my problem is
where I want to generate labels for some of the components within the
sections (namely figures and tables). The numbers I generate for these need
to reflect their sequence within the top-level section (in other words, if
each of the sections in the above list contains a single table, then these
tables should be labelled 1-1, 2-1, 2-2, 2-3, 3-1).
I'm using the following expression:
Table<xsl:text> </xsl:text>
<xsl:number count="/document/section" level="single"/>
<xsl:text>-</xsl:text>
followed by another <xsl:number>; but I can't figure out the right
expression for it:
<xsl:number level="any"/>
gives me 1-1, 2-2, 2-3, 2-4, 3-5
<xsl:number count="/document/section//table"/>
gives me 1-1, 2-1, 2-1, 2-1, 3-1
I expected both of those results but they aren't what I want.
I imagine that what I really want is
<xsl:number count="table" from="{the /document/section node which is in
the context node's ancestral set}"/>
I'm sure there's an elegant way of putting that, but it is eluding me.
Cheers
Trevor
|
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
|

Cart








