This is related to a question I asked awhile ago. Given this xml:
<?xml version="1.0"?>
<paper>
<section><title>My Main Section</title>
<para>My para with a <footnote num="a">text</footnote> footnote.</para>
<section><title>my subsection</title>
<para>more text with another <empty/><footnote num="b">more fn text. </footnote> footnote.</para>
</section>
</section>
</paper>
I want an xpath, from the /paper/section node that will give me just the first footnote (@num="a")
I have tried something along the lines of:
<xsl:template match="/paper/section">
<section>
<xsl:apply-templates select="//footnote[1]"/>
</section>
</xsl:template>
but that returns both fn's. I assume because each fn is the first footnote node in its respective parent.
I tried a few variations:
<xsl:apply-templates select="//footnote[position() = 1 ]"/>
that will return a footnote that is the first child of its parent, or the same as 1? The testing I did indicated they were the same.
I also tried a for-each loop, but wasn't able to pick anything up...
any ideas? bp