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

Re: xpath2 functions returning ()

Subject: Re: xpath2 functions returning ()
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 4 Jan 2002 08:52:24 -0800 (PST)
xpath2 string functions
> > I think that rubs up against the problem that the name() function
> > actually returns an empty sequence for the document node (new
> > terminology 'root node' is 'document node' in XPath 2.0), rather than
> > an empty string
> Yet another example of the rather bizarre affection and special
> attention shown to empty sequences in X*2.
> In Xpath 1 an empty node set was just a node set that happened to be
> empty and had no special semantics, although did coerce to false rather
> than true.
> Xpath 2 seems to want to treat () special in many contexts. Most of which
> seem unfortunate:-) The example above is one, sum() returning the empty
> sequence instead of 0 is another (that seems to be much worse, and will
> mean that you will almost always have to special case any value returned
> from sum() to check if it is empty and if so replace it with 0)

It is correct to define the empty string and the empty sequence to be the same
strings (the empty sequence naturally belongs to all sequence types). 

A string is a list (sequence) of characters. The empty string is an empty such
sequence. It is "no character" but it is still a string (sequence) -- the empty
string (sequence).

If this was accepted, we wouldn't have a paradox and at least in this case wouldn't
need to patch the language.

Dimitre Novatchev.

Do You Yahoo!?
Send your FREE holiday greetings online!

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

Current Thread


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.