[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Finding and promoting footnotes
Jarno > 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 perfectly. 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 --------------- <FOOTNOTES> <FOOTNOTE> <something><A id="..."/>text</something> </FOOTNOTE> <FOOTNOTE> <something><A id="..."/>text</something> </FOOTNOTE> ... </FOOTNOTES> --------------- where <something> may be <TableFootnote>, <FootnoteA>, <TableNote>, or any of a zillion other variations on the same theme. Cheers Trevor
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|