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

Re: configuring a conditional

Subject: Re: configuring a conditional
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 24 May 2005 12:22:12 -0400
Re:  configuring a conditional
Bruce,

At 12:22 PM 5/24/2005, you wrote:
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:

Well if the @linkend is correct, the next things to check are the key declaration and the document context. Since I gather your call to key() is happening in a document context that doesn't contain your $cite-ref (the mods:mods current node is in a separate tree), you'll need to establish the correct context for your call to key().


In the old days this would have been

<xsl:for-each select="$cite-ref">
  <xsl:if test="count(.|key('refs',@linkend)[1])=1">FIRST</xsl:if>
</xsl:for-each>

But since you're using that newfangled 2.0-thang, you could do

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


Note the third argument to establish the document context for key().

I hope that helps,
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

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.