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

RE: xsl:variable problems: Error in XPATH Expression

Subject: RE: xsl:variable problems: Error in XPATH Expression
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Fri, 11 Jul 2003 16:16:54 -0400
variable contents xsl expression
[Greg Johnson]
> 
> What are the restrictions on using xsl:variables?
> Am I not allowed to use it in an xsl:sort element?
> I get the following error for the folowing xsl fragment:
> 
> <xsl:variable name="sortby">ARRIVED</xsl:variable>
> <xsl:variable name="ordering">descending</xsl:variable>
> 

Those sortby variable  contains a result tree fragments, and those
cannot be used instead of a node set - that is what  the error messages
tells you.  It has nothing to do with the use of a variable, but only
with the contents of the variable.

You can get the variables to contain the right things by a simple change
-

<xsl:variable name="sortby" select='ARRIVED'/>

Might as well do this also -
<xsl:variable name="ordering" select='"descending"'/>

Notice how the string has to be quoted, otherwise it would indicate
nodes named "descending".  The quotes signal that the thing is a string
instead of a set of nodes.

Cheers,

Tom P


 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.