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

RE: Re: $nodeset=true()

Subject: RE: Re: $nodeset=true()
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 2 Jan 2002 18:07:31 -0000
RE:  Re: $nodeset=true()
> >The rules for comparing a node-set to a boolean have
> changed. ... In XPath 2.0, this expression is
> handled in
> >the same way as other comparisons between a sequence and a
> singleton: it is true if
> >$nodeset contains at least one node whose typed value is true.
> >----------------------------------------
> >
> This bothers me. What if the node set contains multiple nodes, some
> of which are true, some of which are false, and some of which are
> indeterminate?

As with $node-set='somestring" or $node-set=42 in XPath 1.0,
$node-set=true() will return true if there is at least one node $N in
$node-set such that $N=true().

In other words, the XPath 1.0 "existential" meaning of "=" (A=B is true if
some a in A is equal to some b in B) now covers all cases, removing this
awkward exception of comparison to a boolean. This change was necessary
because a singleton boolean is equivalent in the XPath 2.0 data model to a
sequence of length 1 whose only item is a boolean.

Those who are uncomfortable with the implicit existential semantics of "="
can now use "eq" instead, using "some" and "every" where necessary to make
the quantification explicit.

Mike Kay

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

Current Thread
  • Re:
    • Elliotte Rusty Harold - Wed, 2 Jan 2002 12:38:17 -0500 (EST)
      • Michael Kay - Wed, 2 Jan 2002 13:07:17 -0500 (EST) <=
        • Evan Lenz - Wed, 2 Jan 2002 13:39:24 -0500 (EST)


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.
First Name
Last Name
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.