[DM]: in some way a resumption of Issue-0079: String-value vs. string-value of the typed-value

In xpath-datamodel, 6.2.4 I don't agree with the typed-value
calculation for Element Node from a PSVI:

"...Otherwise, the element must be a complex type with element-only
content. The typed-value of such an element is undefined. Attempting
to access this property with the dm:typed-value accessor always
raises an error."

Why not define here the typed-value as the elements string-value as
an xdt:untypedAtomic, as in '6.2.3 Construction from an Infoset'
(like '6.1.4 Construction from a PSVI' for Document Nodes) ? The
string-value is still defined in the above case.

I think this would be in line with one of Michael Kay's conclusions
in
http://lists.w3.org/Archives/Public/public-qt-comments/2002Dec/0012:

"So my own preference is that we should keep the lexical value and
treat the typed value as being derived from it."


If 6.2.4 is not changed like that, following should be changed
slightly in xpath20, 2.5.2, to avoid misunderstanding:

"An implementation may store both the typed value and the string
value of a node, or it may store only one of these and derive the
other from it as needed. The string value of a node must be a valid
lexical representation of the typed value of the node, but the node
is not required to preserve the string representation from the
original source document. For example, if the typed value of a node
is the xs:integer value 30, its string value might be "30" or
"0030"."


If 6.2.4 is not changed, can someone please explain the reason for
such a different typed-value handling?


-----------------------------------------------------------------
see also:

xpath20, 2.5.2:

1.

"For text and document nodes, the typed value of the node is the
same as its string value, as an instance of the type
xdt:untypedAtomic. The string value of a document node is formed by
concatenating the string values of all its descendant text nodes, in
document order."

4.d

"If the type annotation denotes a complex type with element-only
content, then the typed value of the node is undefined. The fn:data
function raises a type error [err:FOTY0012] when applied to such a
node. The string value of such a node is equal to the concatenated
string values of all its text node descendants, in document order."

and

xslt20, 2.1:

"[Definition: The term typed value is defined in Section 5.15
typed-value AccessorDM. Every node except an element defined in the
schema with element-only content has a typed value. For example, the
typed value of an attribute of type xs:IDREFS is a sequence of zero
or more xs:IDREF values.]"

-----------------------------------------------------------------------------

Regards
Klaus Bosse

Received on Thursday, 27 April 2006 14:31:58 UTC