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

Re: index-of and empty stuff

Subject: Re: index-of and empty stuff
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Sat, 21 Dec 2013 21:18:32 +0000
Re:  index-of and empty stuff
On 21 Dec 2013, at 20:42, Ihe Onwuka <ihe.onwuka@xxxxxxxxx> wrote:

> Of course I was not in the room . There may be a very good reason - it
> is not at all apparent. If there is a good reason it's worth knowing
> (in fact it's also worth knowing if there isn't a good reason) so
> please bear with my question(s).

If you want a historical evidence-based answer to the question, why was it
designed like this, you won't get one. It's very rarely possible to find a
specific decision minuted in enough detail to reconstruct the decision

However, the general rationale for XPath 2.0 functions was:

* arguments are classified into "input" and "control" arguments. Input data is
data likely to come from the source document, while control arguments define
how the input data is to be processed.

* input data arguments generally accept an empty sequence, and the function
generally either (a) treats an empty sequence as a zero-length string, or (b)
returns an empty sequence if an empty sequence is supplied

* control arguments generally do not accept an empty sequence.

* in the case of index-of(), the first argument is considered a data argument,
and the second a control argument.

But of course there are inconsistencies, if only because this rationale was
not retrospectively applied to 1.0 functions for compatibility reasons.

Michael Kay

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.