- From: Jim Melton <jim.melton@acm.org>
- Date: Sun, 29 May 2005 13:06:19 -0600
- To: Martin Duerst <duerst@it.aoyama.ac.jp>
- Cc: Arnt Gulbrandsen <arnt@gulbrandsen.priv.no>, public-ietf-collation@w3.org
Indeed, XQuery and XSLT make a distinction here. However, the term "null
value" is not used by those languages nor by the data model on which they
depend (the XPath 2.0 and XQuery 1.0 Data Model). The closest analog to
"null value" in that Data Model is "empty sequence", which is a sequence
with nothing at all in it. That is very clearly different from a value of
xs:string type that contains exactly zero characters. The term used by the
Data Model for such a string value is "zero-length string". Note that the
Data Model does *not* use the term "empty value" nor "empty string" because
of the proven potential for confusion with "empty sequence".
There is also recognition, but no semantic use made, of XML Schema
declarations of types that are nillable and of instances of complex types
that are "nilled" (that is, they consist of an element, presumably with no
content, containing an attribute named xs:nil whose value is
"true"). There were literally months of debate about whether
nillable/nilled "things" should be treated as though they were close
analogs of SQL's null value, but it was determined eventually that such
treatment was the provenance of applications and not of the Data Model or
the XPath/XQuery/XSLT language specifications.
Because of the specific choice of vocabulary ("empty sequence" and
"zero-length string") used by the Data Model, versus the choice of
vocabulary used by Arnt below ("NULL/NIL string" and "empty string"), and
the absence of any statement by Arnt of what his terms mean, I cannot
address his actual question. Sorry!
I should also mention that XQuery's order by clause (part of the FLWOR
expression) allows query authors to specify whether empty sequences sort
less than or greater than all non-empty-sequence values.
Hope this helps,
Jim
At 5/28/2005 02:52 AM, Martin Duerst wrote:
>XML Schema allows instances to distinguish between null values and
>empty values. XQuery and XSLT are most probably using this.
>Their WGs were in meetings the past week; I hope we'll hear
>from some experts in the comming week.
>
>Regards, Martin.
>
>
>At 21:38 05/05/25, Arnt Gulbrandsen wrote:
> >
> >Hi,
> >
> >does any of you have a real example where NULL/NIL strings occur and
> need to be sorted differently than empty strings?
> >
> >I know one (IMAP SORT HEADER BLAH), but it's a little contrived. Also I
> suspect that if an IMAP client issues SORT SUBJECT, the need to
> differentiate between empty-string subject and no subject is less than
> overwhelming.
> >
> >I'd like to have a better example to justify the feature.
> >
> >Arnt
> >
>
========================================================================
Jim Melton --- Editor of ISO/IEC 9075-* (SQL) Phone: +1.801.942.0144
Co-Chair, W3C XML Query WG; F&O (etc.) editor Fax : +1.801.942.3345
Oracle Corporation Oracle Email: jim dot melton at oracle dot com
1930 Viscounti Drive Standards email: jim dot melton at acm dot org
Sandy, UT 84093-1063 USA Personal email: jim at melton dot name
========================================================================
= Facts are facts. But any opinions expressed are the opinions =
= only of myself and may or may not reflect the opinions of anybody =
= else with whom I may or may not have discussed the issues at hand. =
========================================================================
Received on Sunday, 29 May 2005 20:15:43 UTC