I have a snippet of xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<sect>
<Link>3</Link>
<Link>4</Link>
<Link>5</Link>
<footnote>3 this is the footnote text</footnote>
<footnote>4 this is the footnote text</footnote>
<footnote>5 this is the footnote text</footnote>
</sect>
I want to transform it with xslt 1.0 to:
Code:
<span class="link" title="3 this is the footnote text">[3]</span>
<span class="link" title="4 this is the footnote text">[4]</span>
<span class="link" title="5 this is the footnote text">[5]</span>
What I have tried so far is:
Code:
<xsl:template match="Link">
<span class="link">
<xsl:attribute name="title"><xsl:value-of select="following::footnote[1]"/></xsl:attribute>
[<xsl:value-of select="."/>]
</span>
</xsl:template>
This returns
Code:
<span class="link" title="3 this is the footnote text">[3]</span>
<span class="link" title="3 this is the footnote text">[4]</span>
<span class="link" title="3 this is the footnote text">[5]</span>
I am not sure how to do a test on the following footnote in order to get past the first one and check the following ones.