Subject: Re: [xsl] configuring a conditional From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 24 May 2005 10:55:52 -0400 |
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
OK, I tried to implement this in my rather complicated code, but am stuck.
<xsl:param name="cite-ref" as="element()*"/> <xsl:message> <xsl:if test="$cite-ref is key('refs',@linkend)[1]">FIRST</xsl:if> </xsl:message>
The message is result is always blank.
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] configuring a conditional, Bruce D'Arcus | Thread | Re: [xsl] configuring a conditional, Bruce D'Arcus |
[xsl] XML / XSLT Transformations wi, dti mail | Date | Re: [xsl] RE: xsl-list Digest 24 Ma, Wendell Piez |
Month |