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

RE: xsl:variable and key

Subject: RE: xsl:variable and key
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 11 Jun 2004 08:28:33 +0100
xsl variable key
In XSLT 1.0 use the "Carlisle workaround" for this:

<xsl:variable select="key('XXX', YYY)[test] | ancestor::*[1][not(test)]" />

Michael Kay

> -----Original Message-----
> From: Sameer N [mailto:samooo_vc@xxxxxxxxxxx] 
> Sent: 11 June 2004 02:35
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  xsl:variable and key
> 
> I want to assign a node-set returned by key() to a variable.
> 
> This works fine : <xsl:variable name="foo" 
> select=3D"key('XXX', YYY)"/>
> 
> But now I have a condition and I have to use <xsl:choose>. 
> And in such case 
> I am not able to set the variable.
> The pseudo for what I want is something like this:
> <xsl:variable name="foo">
>   <xsl:choose>
>      <xsl:when test="SOME-TEST">
>           SELECT node-set returned by key('XXX', YYY)
>      </xsl:when>
>      <xsl:otherwise>
>            SELECT node-set ancestor::*[1]
>      <xsl:otherwise>
>   </xsl:choose>
> </xsl:variable>
> 
> Any suggesstions? Thanks.
> 
> Sameer.
> 
> _________________________________________________________________
> Is your PC infected? Get a FREE online computer virus scan 
> from McAfeeR 
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> 
> 
> --+------------------------------------------------------------------
> 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@xxxxxxxxxxxxxxxxxxxxxx>
> --+--
> 
> 



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.