[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: "grouping" footnote numbers
From: David Carlisle [mailto:davidc@xxxxxxxxx] >> count="xref[@type='fn']"/></sup></a> > The secret for numbering any kind of cross reference in xslt is to > number the thing being referenced, not the reference. Here you want to > number the footnotes, and you want the cross reference to use the numbr > of teh references footnote, so Thank you very much for your solution. I realise I forgot to specify where the goalposts were in my original post, as I'm dealing with XML chunked up into fragments in a CMS, so the footnote text, scattered into little documents, is not that readily available. Fortunately, the requirement is to restart numbering on each page, so I think pursuing a solution that numbers the xrefs within the current document based on their @href is still what I want. So I am hereby moving the goalposts to a more suitable location. :) Your example still got me nearly there: Given this XML: --------------- <p>blah blah <xref href="footnote-xyz"/></p> <p>more blah <xref href="footnote-xyz"/></p> <p>last blah <xref href="footnote-abc"/></p> This XSL: --------- <xsl:key name="fn" match="xref" use="@href"/> ... <sup> <xsl:for-each-group select="key('fn', @href)" group-by="@href"> <xsl:number level="any"/> </xsl:for-each-group> </sup> Produces this output: --------------------- <p>blah blah <sup>1</sup></p> <p>more blah <sup>1</sup></p> <p>last blah <sup>3</sup></p> But I would like to get: ------------------------ <p>blah blah <sup>1</sup></p> <p>more blah <sup>1</sup></p> <p>last blah <sup>2</sup></p> So the desired output is for the references to "footnote-xyz" to both be numbered "1", but the reference to "footnote-abc" to be numbered "2". I'm sooo close. :)
|
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
|