always in any cross referencing in xslt the trick is to always generate
the number on the _referenced_ node, often just using <xsl:number/> does
the job, sometimes you need to use count() but whatever it is just code
it once.
then to make a cross reference (whether the reference text is a number
or a section heading or short id etc) the method is the same _go to teh
referenced node_ and generate the text.
so in this case
<xsl:key name="bib" match="To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
In-reply-to:
<20060913211639(_dot_)15613(_dot_)qmail(_at_)web50113(_dot_)mail(_dot_)yahoo(_dot_)com>
(message
from siarom egrub on Wed, 13 Sep 2006 14:16:39 -0700 (PDT))
Subject: Re: [xsl] Bibliography References
FCC: ~/Mail/sent
References:
<20060913211639(_dot_)15613(_dot_)qmail(_at_)web50113(_dot_)mail(_dot_)yahoo(_dot_)com>
--text follows this line--
always in any cross referencing in xslt the trick is to always generate
the number on the _referenced_ node, often just using <xsl:number/> does
the job, sometimes you need to use count() but whatever it is just code
it once.
then to make a cross reference (whether the reference text is a number
or a section heading or short id etc) the method is the same _go to teh
referenced node_ and generate the text.
so in this case
<xsl:key name="bib" match="bibliomixed" use="@id"/>
<!-- make a numbered listing at the end -->
<xsl:template match="bibliomixed">
[<xsl:number/>] <xsl:apply-templates/>
</xsl:template>
<!--make xref-->
<xsl:template match="xref">
see [<xsl:for-each
select="key('bib',@xref)"><xsl:number/></xsl:for-each>]
</xsl:template>
see xsl:number is evaluated in both cases on the bibliomixed element,so
it makes the same number on both cases. If instead of [3] you wanted
[National Committee...]or [NatCom2006] or any other format you'd use the
smae basic idea, go the the bibliomixed node then (instead of
xsl:number) generate the same text for both the xref and the listing.
David
--~------------------------------------------------------------------
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>
--~--