This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5640 - [XQuery] Typed value of a node
Summary: [XQuery] Typed value of a node
Status: RESOLVED WORKSFORME
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows XP
: P2 trivial
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL: http://www.w3.org/TR/xquery/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-12 14:15 UTC by Mukul Gandhi
Modified: 2008-04-12 18:09 UTC (History)
0 users

See Also:


Attachments

Description Mukul Gandhi 2008-04-12 14:15:59 UTC
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
Comment 1 Michael Kay 2008-04-12 14:39:01 UTC
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.
Comment 2 Mukul Gandhi 2008-04-12 18:09:53 UTC
(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