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

RE: Scalar -> node-set conversion (was How to distinguish b/

Subject: RE: Scalar -> node-set conversion (was How to distinguish b/n
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Mon, 6 Nov 2000 08:09:53 -0800 (PST)
RE: Scalar -> node-set conversion (was How to distinguish b/
Mike Kay wrote:
>> Dmitre wrote:
>> 
>> > This is a good idea and it actually works in MSXML 3:
>> >
>> > count(node-set(nodeSet) | node-set(nodeSet)) returns 1.  
>> > count(node-set(Scalar) | node-set(Scalar)) returns 2.  
>> >
>> > Unfortunately, Saxon always returns 1.
>
>Actually, I'm getting the answer 2 when I run this in Saxon. Though I 
don't
>think this is a particularly good thing: in principle, running the
same
>function twice with the same argument should produce the same result;
>otherwise optimizations are likely to go wrong.
>> >
>> > Also, I've heard that the standard node-set() function in 
>> XSLT 1.1 will throw error when passed a scalar argument.
>
>It is currently proposed that RTF->nodeset conversion should be 
>implicit in
>XSLT 1.1, but there has been no proposal to allow string->nodeset
>conversion.
>
>Mike Kay
>> 

I got these results running Saxon 5.4.

Anyway, it appears that there isn't a reliable way of finding whether a
parameter is a node-set or a scalar -- it's a pity, because something
as simple as a function (defined over a nodeset like count()) returning
NaN for a scalar would do the job.

As of now one has to depend on the error number -- even on the exact
error message text from a particular vendor of an XSLT processor.

Dimitre.
 

__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one Place.
http://shopping.yahoo.com/


 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.