[xsl] Re: [XSL] Footnotes Display

Subject: [xsl] Re: [XSL] Footnotes Display
From: "Ilya Konanykhin" <ilya.konanykhin.ml@xxxxxxxxx>
Date: Fri, 30 Nov 2007 17:05:47 +0600
Hi, Alice!


   I am in the middle of producing something with footnotes of a
particular section. The a tags are produced nicely, but I am having
problems putting the heading around the page.

This is what I have in the XSLT:

    <xsl:template match="to_do">
        <xsl:apply-templates select="list"/>
        <xsl:call-template name="notes"/>

      <xsl:template match="item">
            Some processing list the items

<xsl:template name="notes">
                <xsl:when test="p/@xml:id='authnote'">


    <item>See the Dentist</item>
    <item>Return Library Book</item>
    <item>Research about XSLT<ref target="authnote">*</ref></item>
    <p xml:id="authnote">* Check out books on XPath 2.0 and XSLT 2.0 by
Tennison, Kay published by Wrox.</p>

  My plan is that the output for the footnte section in the notes
template would be something like

<p>*  Check out books on XPath 2.0 and XSLT 2.0 by Tennison, Kay
published by Wrox.</p>

However, my current output is that the <h3> tag is placed above the
<xsl:apply-templates/> Can anyone please tell me what I have done wrong

Thanks a lot for your help. I am using XSLT 2.0.


Alice Wei
School of Library and Information Science
Indiana University Bloomington

I follow the list with lag of several days, but your question seems to stay without answer yet. I don't know whether you've solved this issue, but in case you haven't I'll make a couple of guesses/comments.

First, you have <xsl:apply-templates select="list"/>, but in the input there is no <list> elements under <to_do>, only <item>s. It might be, that <xsl:apply-templates select="list"/> is what you need.

Next, as far as I can see, the actual list items are still being printed since in the named template you have <xsl:apply-templates/> (in both xsl:choose branches), and as the context node is not changed by the named template and it is still <to_do> node, templates matching <item> children do their job.

Third, I hardly can see how did you manage to get <h3>Note</h3>, since XPATH expression in <xsl:when test="p/@xml:id='authnote'"> (which contains the aforementioned H3 tag) checks <p> children of the current node, and in your example input <p xml:id="authnote">...</p> is definetely not among the kids of <to_do>. When I ran the test I got only textual representation of the <p> tag which was even out of <div>...</div> and was obviously going from the default copy template.

The last thing I have to say is that I haven't tested anything of what I said except for this H3 thing so I might be completely mistakening :)

Anyway, hope this will help you.


Current Thread