[xsl] XSL-FO to generate Footnotes

Subject: [xsl] XSL-FO to generate Footnotes
From: "Struijk, Toon van der" <aecvanderstruijk@xxxxxxxxx>
Date: Mon, 1 Oct 2012 08:03:25 +0000
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,

Toon van der Struijk
Art Director

Elektronicaweg 31
2628 XG Delft, Nederland
T 	+31 (0)15 - 251 37 00
F 	+31 (0)15 - 251 37 01
M 	+31 (0)6 - 1309 0937
E 	aecvanderstruijk@xxxxxxxxx
I 	www.seneca.nl

Current Thread