xsl-list
[Top] [All Lists]

Re: back-referencing footnotes?

2005-06-06 16:32:58


BTW, xt doesn't seem to like keys(), or I'm doing it wrong.

the original xt didn't implement keys although I remember a project
starting up a while back to complete xt's support for xslt, but most xt
users have long since switched to saxon or xalan, I would guess.

If you have keys then it's just
<xsl:key name="h" match="*[(_at_)HREF]" use="@HREF"/>
...
<xsl:template match="FN">
<p>
<xsl:apply-templates select="key('h',@ID)"/>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
</p>
</xsl:template>

If you have a DTD that declares the HREF attribute to be of type ID then
you can instead do


<xsl:template match="FN">
<p>
<xsl:apply-templates select="id(@ID)"/>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
</p>
</xsl:template>

alternatively of course you can always replace a key or id function by
its equivalent if slower xpath

<xsl:template match="FN">
<p>
<xsl:apply-templates select="//FNR[(_at_)HREF=current()/@ID]"/>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
</p>
</xsl:template>

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>