On 03/10/2011 11:40, Andrew Welch wrote:
More empty sequence 'fun':
What is the base type of (), is it a node or an atomic, or something else?
() is not a type, so it does not have a base type.
A sequence in itself does not carry a type label; only items carry type
information. A sequence is tested against a sequence type by comparing
the items in the sequence against the item type, and the length of the
sequence against the cardinality.
I can specify empty-sequence() as the sequence type:
<xs:variable name="foo" select="()" as="empty-sequence()"/>
It's convenient to think of empty-sequence() as being a SequenceType
whose item type is item() and whose cardinality is "exactly zero".
...but its not mentioned in the type hierarchy:
http://www.w3.org/TR/xquery-operators/#datatypes
That diagram (which I hate) actually shows two type hierarchies: the
hierarchy of XDM item types (rooted at item()), and the hierarchy of XSD
schema types (rooted at xs:anyType). It doesn't show SequenceTypes.
Michael Kay
Saxonica
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--