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

Re: Re: Re: How to distinguish b/n a scalar and a node-set h

Subject: Re: Re: Re: How to distinguish b/n a scalar and a node-set having
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 3 Nov 2000 14:43:01 -0400 (EST)
count node set
David,

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.

Also, I've heard that the standard node-set() function in XSLT 1.1 will
throw error when passed a scalar argument.

Thanks once again,

Dimitre Novatchev.
-------------------- Original message --------------------
Date: Wed, 1 Nov 2000 09:59:15 -0400 (EST)
From: David_Marston@xxxxxxxxx
Subject: Re: Re: How to distinguish b/n a scalar and a node-set having 
a single text node

Dimitre Novatchev wrote:
>> I am trying to determine whether the value of a parameter is a
>> scalar [boolean/number/string]
>> or a node-set, and to do so without using extension functions (I
>> consider node-set() to be "standard", as it will be in XSLT 1.1).
>...
>>The only unsolved case remains when $pValue contains exactly one
>>text node.

Depending on what node-set(string) does, you may be able to build
something based on unions. If $pValue is a node-set, then
   ($pValue | $pValue)
is a node-set with the same count, because it's a union of two
references to the same node-set. Unfortunately, putting a "scalar"
string in either a union or count() is an error.

If node-set($pValue) for a scalar $pValue produces a different
node-set on each invocation, then the union of two of them will
yield a node-set with a count() of 2. If node-set($pValue) for
$pValue being a node-set already simply passes through the same
node-set, then the union of two of them will yield a node-set
with a count() of 1.
.................David Marston


__________________________________________________
Do You Yahoo!?
>From homework help to love advice, Yahoo! Experts has your answer.
http://experts.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.