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

RE: Conditional variable assignment with node-set as v

Subject: RE: Conditional variable assignment with node-set as value
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 18 Jul 2001 02:37:54 +0100
xsl variable conditional nodeset
>   I uses Saxon6.0.2 as XSLT processor.

Upgrade! The current version is 6.4.3.

>   I currently have a need to use conditional variable
> assignment with node-set as value.  I tried to use
> saxon:node-set, but still gets the error:

I suspect the error is from the way you are using this variable, not from
the way you are setting it up. Within this xsl:variable, the two calls on
saxon:node-set() seem to be unnecessary: it's never necessary to call
saxon:node-set on something that is already a node-set, which both these
expressions are.

I'm afraid I don't know quite what you mean by conditional variable
assigment. Have you considered the syntax:

<xsl:variable name="v" select="$ns1[$condition] | $ns2[not($condition)]"/>

Mike Kay
Software AG

> At XSLT 1.0, conversion of a result tree fragment to a
> node-set is not allowed.
>   My XSLT code looks like:
> <xsl:variable name="extended-attrs-bid">
> <xsl:choose>
> <xsl:when
> test="normalize-space(RFQDomainAttributeDefinition)">
> <xsl:value-of
> select="saxon:node-set(RFQDomainAttributeDefinition[@Domain
> = 'lbid']/ExtendedAttributeDefinition)" />
> </xsl:when>
> <xsl:otherwise>
> <xsl:value-of
> select="saxon:node-set(Bid/ExtendedAttribute[generate-id()
> = generate-id(key('extended-attrs-bid-index',
> @ExtendedAttributeCode))])" />
> </xsl:otherwise>
> </xsl:choose>
> </xsl:variable>
>   How to conditionally assign the node-set value I
> needed?
>
> Much thanks,
> Xiaocun
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.