[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: back-referencing footnotes?

Subject: Re: back-referencing footnotes?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 7 Jun 2005 00:32:58 +0100
referencing footnotes
> 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="*[@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[@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
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.