This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[docbook-apps] Re: [docbook] Footnote problem


Matej Cepl wrote:

I'm redirecting this issue to docbook-apps list.

this is another newbie problem which I have failed so far to solve. It is <footnote> element or "How to generate element somewhere else". I tried this (very raw draft, of course it would need polishing, but the basic issue is here):

If I understand you correctly, you want list all footnotes at the very end of HTML output. Then you must suppress footnotes from normal processing, they will just generate number (and possible link):


<xsl:template match="footnote">
  <sup><xsl:number level="any" count="footnote"/></sup>
</xsl:template>

And then you must collect and process all footnotes at the end of your document:

<xsl:template match="/">
  <html>
    ...
    <body>
      <xsl:apply-templates/>
      <hr/>
      <xsl:apply-templates select="//footnote" mode="process.footnote"/>
    </body>
   </html>
</xsl:template>

<xsl:template match="footnote" mode="process.footnote">
  <div class="footnote">
    <sup><xsl:number level="any" count="footnote"/></sup>
    <!-- Process content of footnote -->
    <xsl:appply-templates/>
  </div>
</xsl:template>

<xsl:template match="footnote">

<xsl:element name="{/html/div[last()]}">
   <xsl:attribute name="class">footnote</xsl:attribute>
      <xsl:apply-templates/>
   </xsl:element>

</xsl:template>

Processing model works in very different way then you expect. Due to your language ability you can try reading


http://www.kosek.cz/xml/xslt/zpracovani.html

--
-----------------------------------------------------------------
  Jirka Kosek  	
  e-mail: jirka@kosek.cz
  http://www.kosek.cz

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]