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

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

Subject: Re: Re: How to distinguish b/n a scalar and a node-set having a single textnode
From: David_Marston@xxxxxxxxx
Date: Wed, 1 Nov 2000 09:59:15 -0400 (EST)
pvalue est
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




 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.