Re: [xsl] configuring a conditional

Subject: Re: [xsl] configuring a conditional
From: Bruce D'Arcus <bdarcus@xxxxxxxxx>
Date: Tue, 24 May 2005 12:22:30 -0400
On May 24, 2005, at 12:15 PM, David Carlisle wrote:

As Wendell said you want the linkend attribute of your $cite-ref element

so
        <xsl:if test="$cite-ref is
key('refs',$cite-ref/@linkend)[1]">FIRST</xsl:if>

That's what I have:


<xsl:message>
<xsl:value-of select="$cite-ref/@linkend"/>:
<xsl:if test="$cite-ref is key('refs',$cite-ref/@linkend)[1]">FIRST</xsl:if>
</xsl:message>


Result is:

TimesP2001a:

Veer1996a:

Tilly2000a:

Tilly2002a:

NW2000-0207:

NW2000-0424a:

Tremblay2001a:

Thrift1990a:

Tilly2000a:

incidentally it looks like that code requres  $cite-ref to be a single
element node, but you have declared it as

<xsl:param name="cite-ref" as="element()*"/>

ie you allow it to be the empty sequence or more than one element.

Yes, I think I had a comment there that indicated I originally defined it as just element(), but in one case (when I was formatting an entire book manuscript), I got an error about an empty sequence. Am not sure how that's possible in this case, but I just added that. I suppose a better hack would be "element()?"?


Bruce

Current Thread