Document nodes

A document node encapsulates an XML document.

A document node cannot have parent nodes and can have zero or more child nodes. The child nodes can include element nodes, text nodes, processing instruction nodes, or comment nodes. To be a well-formed document, the document node must have exactly one child element node and no child text nodes.

A document node has the following node properties:

  • children
  • string value
  • typed value

For a document node, the string value is the concatenation of all of the string values of all of its descendent text nodes, in document order, and the typed value is the same as the string value of type xs:untypedAtomic.

For example, suppose that a document has the following textual representation:
<product xmlns="http://posample.org" pid="100-101-01"> 
 <description>                                            
   <name>Snow Shovel, Deluxe 24"</name>                    
   <details>A Deluxe Snow Shovel, 24 inches wide, ergonomic
curved handle with D-Grip</details>                                    
   <price>19.99</price>                                    
   <weight>2 kg</weight>                                   
 </description>                                           
</product>
The document node has the following property values:
Table 1. Properties of the document node
Node property Value Value type
children product node  
string value "Snow Shovel, Deluxe 24"A Deluxe Snow Shovel, 24 inches wide, ergonomic curved handle with D-Grip19.992 kg"  
typed value "Snow Shovel, Deluxe 24"A Deluxe Snow Shovel, 24 inches wide, ergonomic curved handle with D-Grip19.992 kg" xs:untypedAtomic