[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: "grouping" footnote numbers

Subject: RE: "grouping" footnote numbers
From: Emma Burrows <Emma.Burrows@xxxxxxxxxxx>
Date: Tue, 11 Oct 2011 11:06:16 +0100
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. :)

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.