RE: [xsl] Finding and promoting footnotes

Subject: RE: [xsl] Finding and promoting footnotes
From: "Trevor Nicholls" <trevor@xxxxxxxxxxxxxxxxxx>
Date: Thu, 1 Dec 2005 21:54:26 +1300

> Hi,=20
> > <xsl:if test="*/A[@ID={$fid}]">
> This should throw an error. I think your intention is
>   <xsl:if test="*/A[@ID=$fid]">

That's what I started with and it too threw an error. But reverting to it
knowing that it was the valid test to use I spotted what my error was: the
<xsl:variable name="fid"> was being instantiated in the A[@class='footnote']
template and then I was testing it in the FOOTNOTES template.

I had assumed that this variable would remain accessible while I called
<xsl:apply-templates select="/XML/FOOTNOTES"> within the A template. Not so,
but when I passed the value of $fid through as a parameter it worked

Thanks to those who replied with solutions using keys. I think I understand
how these would operate, but (like my original xsl) they make an assumption
which is not valid, namely that we know in advance exactly what entities are
defined inside the footnotes. But we don't (unfortunately my example gave
the wrong impression, sorry):

The XML file ends
    <something><A id="..."/>text</something>
    <something><A id="..."/>text</something>

where <something> may be <TableFootnote>, <FootnoteA>, <TableNote>, or any
of a zillion other variations on the same theme.


Current Thread