xsl-list
[Top] [All Lists]

Re: [xsl] XSL-FO to generate Footnotes

2012-10-01 04:30:14
On 10/01/2012 09:03 AM, Struijk, Toon van der wrote:

L.S.

On a project I'm working at, I want to generate footnotes. So far, I know how 
to autonumber the footnotes, and have the footnotes themselves a different 
styling. But I can't get them on the bottom of a page. The code I have so far 
looks like this:

A static content part in the page-sequence:
<fo:page-sequence master-reference="Brochure-Content" 
xsl:use-attribute-sets="font-body-normal">
        <fo:static-content flow-name="xsl-footnote-seperator">
                <fo:block space-before="8pt" space-after="8pt" 
text-align-last="justify">
                        <fo:leader leader-pattern="rule" leader-lenght="20pt" 
rule-thickness="0.25pt"/>
                </fo:block>
        </fo:static-content>
....
</fo:page-sequence>

And in the XSL(T) I use this, where 'voetnoot' refers to parts in the XML where 
a footnote is defined:

<xsl:template match="voetnoot">
        <xsl:variable name="footnote-number">
                <xsl:number count="voetnoot" format="1"/>
        </xsl:variable>
        <fo:footnote>
                <fo:inline space-before="10pt" baseline-shift="super" font-size="6pt" 
font-family="DINOT-Medium" color="#FF0000" >
                        <xsl:value-of select="$footnote-number"/>
                </fo:inline>
        <fo:footnote-body>
                <fo:list-block provisional-distance-between-starts="20pt">
                        <fo:list-item>
                                <fo:list-item-label end-indent="label-end()">
                                        <fo:block baseline-shift="super" 
font-size="6pt"><xsl:value-of select="$footnote-number"/></fo:block>
                                </fo:list-item-label>
                        <fo:list-item-body start-indent="body-start()">
                                <fo:block>
                                        <xsl:apply-templates/>
                                </fo:block>
                        </fo:list-item-body>
                        </fo:list-item>
                </fo:list-block>
        </fo:footnote-body>
</fo:footnote>
</xsl:template>

The footnotes in the XML looks like this:
<p>Just a paragraph of text with a footnote. <voetnoot>This is one 
footnote</voetnoot></p>
<p> Another paragraph. Maecenas sed diam eget risus varius blandit sit amet non magna. Praesent 
commodo cursus magna, vel scelerisque nisl consectetur et.<voetnoot>And another footnote to be 
added</voetnoot></p>

As far as I can see, this is the proper way to render footnotes.
We use the XSL-FO processor from Altsoft (http://bit.ly/JFV1MI) which should be 
capable of rendering footnotes.
Because I'm really new to XSL-FO, having no real programming experience, and 
just learn by doing, it might be that I'm missing some important part in the 
above example.
So if anyone would be so kind to point in the right direction, it would be very 
appreciated.

Met vriendelijke groet,

You haven't actually said what the problem is?
Are you getting the footnotes rendered as you want? What is missing?
There's a little at
http://www.dpawson.co.uk/xsl/sect3/footnotes.html

More in my book, http://shop.oreilly.com/product/9780596003555.do
page 154




regards

--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

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