|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








