This is the mail archive of the xsl-list@mulberrytech.com 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]

Re: Dealing with footnotes


Scott,

At 05:03 PM 5/9/2002, you wrote:
>I'm trying to transform an xml document into html and having difficulties in
>keeping the content of the footnotes from appearing in the text of the
>document. Is there any way to present the content of the footnotes at the
>bottom vs. the way it is now.

Yup. Simply do something like

<xsl:template match="/">
   ...
         <xsl:apply-templates/>
         <hr/> <!-- putting in a rule just to separate off the notes -->
         <xsl:apply-templates select="//footnote" mode="notes"/>
   ...
</xsl:template>

<xsl:template match="footnote">
   <sup><xsl:value-of select="@id"/></sup>
   <!-- displays the value of the ID but nothing else -->
</xsl:template>

<xsl:template match="footnote" mode="notes">
   <p>
     <xsl:apply-templates select="."/>
     <!-- processing the node again in the default mode just to get the ID -->
     <xsl:apply-templates/>
     <!-- next just descending the tree to get the note's contents -->
   </p>
</xsl:template>

>  Also how can I display the value of the "id"
>attribute that references the actual footnote?

See above.

Modes on templates allow you to process a given set of nodes in more than 
one different way.

Cheers,
Wendell


======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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