W3C home > Mailing lists > Public > www-xml-query-comments@w3.org > February 2002

elements with children vs typed-value

From: Per Bothner <per@bothner.com>
Date: Tue, 26 Feb 2002 21:39:02 -0800
Message-ID: <3C7C70F6.9090802@bothner.com>
To: www-xml-query-comments@w3.org
[I gather, from the Ed Notes in 2.8.1 the Query Language draft of 12/20
that these are known issue, but I'm hoping to get a feel for current
thinking - and perhaps suggest my own.)

 From my reading of the XQuery Data Model document, there seems to be two
distict non-overlapping kinds of element:  Nodes that have children and
nodes that have a typed-value.  Specifically, the 'children' propery can
never include a SimpleTypedValue and the 'typed-value' property can
never include a Node.  Correspondingly, the Data Model specifies two
differet constructors:  element-complex-node (takes a sequence of Nodes)
and element-simple-node (takes a sequence of SimpleTypedValue).

However, this seems inconsistent with the Language specification, where
the specification of element constructors is unclear and does not
indicate which of element-complex-node and element-simple-node is
used when.  Specifically, the first example in 2.8.2 uses "Crockett"
and the content, which is a string, whlle the earlier example it claims
to be the same presumably has Crockett as a text node.

Specifically, what is the result of evaluating the following:
children(<foo>{3,4,5}</foo>)
The intuitive answer is that it should evaluate to the sequence
(3,4,5)
However, that is not allowed by the specification.  It would require
us to change the children property to a be an arbitrary sequence
of simple values, or comment, element, process-instruction, or
text nodes.  I must confess that I don't have a good picture of
the complications, including compatibility issues, but it does seem
to be the most natural model.  Altenatively, the result could be:
text("3 4 5")
or it could be the empty sequence (if element-simple-node is used
to construct the node).
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/
Received on Wednesday, 27 February 2002 00:39:46 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:21:15 UTC