Typed values and string values of nodes
Each node has both a typed value and a string value. These two node properties are used in the definitions of certain XQuery operations (such as atomization) and functions (such as fn:data, fn:string, and fn:deep-equal).
| Node kind | String value | Typed value |
|---|---|---|
| Document | An instance of the xs:string data type that is the concatenated contents of all its descendant text nodes, in document order. | An instance of the xdt:untypedAtomic data type that is the concatenated contents of all its descendant text nodes, in document order. |
| Element in an XML document | An instance of the xs:string data type that is the concatenated contents of all its text node descendants in document order. | An instance of the xdt:untypedAtomic data type that is the concatenated contents of all its text node descendants in document order. |
| Attribute in an XML document | An instance of the xs:string data type that represents the attribute value in the original XML document. | An instance of the xdt:untypedAtomic data type that represents the attribute value in the original XML document. |
| Text | The content as an instance of the xs:string data type. | The content as an instance of the xdt:untypedAtomic data type. |
| Comment | The content as an instance of the xs:string data type. | The content as an instance of the xs:string data type. |
| Processing instruction | The content as an instance of the xs:string data type. | The content as an instance of the xs:string data type. |