Subject: Re: [xsl] XSL:FO - how to render a single footnote for multiple, identical footnotes in From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sun, 10 Sep 2006 20:45:08 -0400 |
Is there a way to output a single footnote for multiple, identical XML footnote entries in pdf?
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.
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).
-- UBL/XML/XSLT/XSL-FO training: Verx, 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@xxxxxxxxxxxxxxxxxxxx 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] XSL:FO - how to render a sing, Ann Marie Rubin \(an | Thread | [xsl] Truncate input, m.core |
[xsl] XSL:FO - how to render a sing, Ann Marie Rubin \(an | Date | RE: [xsl] Replace new lines by <br>, Ambika.Das |
Month |