Subject: Re: [xsl] configuring a conditional From: Bruce D'Arcus <bdarcus@xxxxxxxxx> Date: Mon, 23 May 2005 21:54:06 -0400 |
Aside: I've still not worked out HOW to deal with this first/subsequent
business generally.
It's easy enough (although possibly expensive) to know if you are the first citation to a particular reference, eg you could use xsl:number and see if you get the number 1, or perhaps better havs an xsl:key that matches all references, keyed on the reference id then you just have to ask if the current node is the first node in document order in the sequence returned by the key for this reference. so for example if the syntax is
<xref linkend="foo"/>
and you want to know if this is the first such reference
<xsl:key name="xr" match="xref use="@linkend"/> .. <xsl:template match="xref">
<xsl:if test=". is key('xr',@linkend)[1]"> I'm first
<xsl:param name="cite-ref" as="element()*"/> <xsl:message> <xsl:if test="$cite-ref is key('refs',@linkend)[1]">FIRST</xsl:if> </xsl:message>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] configuring a conditional, Bruce D'Arcus | Thread | Re: [xsl] configuring a conditional, Wendell Piez |
Re: [xsl] How to get to the XML Dec, James Fuller | Date | Re: [xsl] Conditional display, omprakash . v |
Month |