This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In the XQuery 1.0 document, http://www.w3.org/TR/xquery/, it's mentioned: Section: 2 Basics The typed value of a node is a sequence of zero or more atomic values. I am confused about this statement. Could somebody please help me understand this. For e.g., if the XML document is: <root> <x id="attrVal"> <y>123</y> </x> </root> Then what is the typed value of element node, say <x> according to this definition? Regards, Mukul
If there is no schema or the schema defines x as having mixed content, then the typed value is "123" (with some surrounding whitespace unless you chose to remove it), as an instance of xs:untypedAtomic. If the schema defines x as having element-only content, then attempting to get the typed value throws an error. This is explained in bullet 4 of the section that you refer to, which itself is a summary of the rules given in the XDM data model specification.
(In reply to comment #1) > If there is no schema or the schema defines x as having mixed content, then the > typed value is "123" (with some surrounding whitespace unless you chose to > remove it), as an instance of xs:untypedAtomic. If the schema defines x as > having element-only content, then attempting to get the typed value throws an > error. This is explained in bullet 4 of the section that you refer to, which > itself is a summary of the rules given in the XDM data model specification. > Thanks, Mike for the explanation. It helps me. Regards, Mukul