xsl-list
[Top] [All Lists]

Re: [xsl] XSL:FO - how to render a single footnote for multiple, identical footnotes in

2006-09-11 06:40:19
At 2006-09-10 17:04 -0700, Ann Marie Rubin \(anrubin\) wrote:
Is there a way to output a single footnote for multiple, identical XML
footnote entries in pdf?

Yes, but in your XSLT work and not in your XSL-FO work.

For example, a document that has 2 identical footnotes:

foo <footnote notetext="footnote text" opid="fn1"/>
bar <footnote notetext="footnote text" opid="fn1"/>

outputs:

foo1
foo2
------------
1. footnote text
2. footnote text

instead of:

foo1
bar1
-------------
1. footnote text

I created an XML element that cross-references an existing, identical
footnote.

<xref toFootnote="yes id="fn1"/>

I want to write an XSL stylesheet that processes the xreftoFootnote
element by outputting the footnote number of the referenced footnote.

Good ... then whatever algorithm you are using for the footnote numbering you just use again for the referenced footnote. Remember that it is your stylesheet that calculates and presents the footnote in the first place, so you just have to do it every time you need it.

I
have the ID of the referenced footnote but can think of no way to access
the footnote number.

You can't "access" it, you have to recalculate it.

Is there a way to save the footnote IDs and
footnote numbers in memory so that the xreftoFootnote template could
retrieve the footnote number for a particular ID?

No ... but it is very common in XSLT to have to recalculate things because of the non-side-effect-freeness of the language. You might consider using a called template, perhaps based on the current node, then when you present the footnote it gets calculated with the current node ... then when it comes time to use the reference to the footnote, change your current node to the referenced footnote, then just call the template again and it is guaranteed to calculate to the same value (that's the feature of side-effect-freeness).

I hope this helps!

. . . . . . . . . . . . . Ken

--
UBL/XML/XSLT/XSL-FO training: Vårø, Denmark 2006-10-02/06,11-20/24
UBL International 2006  2006-11-13/17 http://www.ublconference.com
World-wide corporate, govt. & user group UBL, XSL, & XML training.
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal



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