[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Finding and promoting footnotes
Hi I have a set of input documents which contain footnote elements at the very end of the document with forward references in <A> elements at the points in the document where they are relevant. I am trying to refactor these documents and one of the necessary changes is to "promote" the footnote so that its content is local to the item which references it. A typical input XML file will have pieces like these: ------------------------------------------ a. at various points in the document: <ROW> <TD> <Cell>Format<A href="#id(abcdefg)" xml:link="simple" show="replace" actuate="user" CLASS="footnote">1</A> </Cell> </TD> ... </ROW> b. and at the end of the document: <FOOTNOTES> <FOOTNOTE> <TableFootnote> <A ID="abcdefg"></A> Assuming standard configuration is selected.</TableFootnote> </FOOTNOTE> <FOOTNOTE> <TableFootnote> <A ID="hijklmn"></A> Assuming jiggery pokery configuration has been set.</TableFootnote> </FOOTNOTE> ... </FOOTNOTES> ------------------------------------------ I am attempting to merge the footnotes into the body of the document, giving something like the following result: ------------------------------------------ <ROW> <TD> <Cell>Format <footnote>Assuming standard configuration is selected.</footnote> </Cell> </TD> ... </ROW> ------------------------------------------ My XSL templates include: ------------------------------------------ <!-- Footnotes --> <xsl:template match="A[@CLASS='footnote']"> <xsl:variable name="fnr"><xsl:value-of select="substring-after(@href,'(')" /></xsl:variable> <xsl:variable name="fid"><xsl:value-of select="substring-before($fnr,')')" /></xsl:variable> <xsl:apply-templates select="/XML/FOOTNOTES" mode="body" /> </xsl:template> <xsl:template match="FOOTNOTES: mode="body"> <xsl:for-each select="FOOTNOTE"> <xsl:if test="*/A[@ID={$fid}]"> <footnote>Test footnote matching: <xsl:apply-templates /></footnote> </xsl:if> </xsl:for-each> </xsl:template> <xsl:template match="FOOTNOTES"></xsl:template> ------------------------------------------ It's the test immediately before <footnote>..</footnote> that is giving me trouble. What is the recommended way to process this so that the content of the single FOOTNOTE which contains an <A ID="x"> which matches the document body's <A href="id(x)"> is output here? This could well be an FAQ but if so, not under the keywords I tried! Thanks in advance 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
|