xsl-list
[Top] [All Lists]

[xsl] "grouping" footnote numbers

2011-10-11 04:07:14
A bit of fun for you all. I have a bunch of XML documents containing footnote 
references in the form <xref href="footnote-xyz" type="fn" />.

When converting this to HTML, I am inserting a footnote reference like so:

<a href="footnote-xyz"><sup><xsl:number level="any" 
count="xref[@type='fn']"/></sup></a>

This is fine and I end up with little consecutively-numbered references as 
you'd expect.

However, it often happens that footnote references within a document refer to 
the same footnote - in that case, they'd like the footnotes to have the same 
reference number. I am not entirely sure how to go about this.

Presumably, I'd need to count the xrefs after grouping them based on their 
href, but I'm not clear on how to apply that to <xsl:number/>. Or should I go 
for a bespoke function or template that assigns a number to each xref/@href in 
the document and then allocate that to the current xref based on its @href? (I 
may have answered my own question there, but I thought I'd see what other 
people think :)

Thanks!



--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>