ConceptioArchiveW3C TR
W3C TRopen access

xpath datamodel 30

W3C · w3c_tr
W3C TR · Standards · License: Open Access
Open Source ↗
w3c, standard

XQuery and XPath Data Model 3.0 /**/ /* from xsl:query.xsl (C) */ code { font-family: monospace; }

div.constraint, div.issue, div.note, div.notice { margin-left: 2em; }

div.issue p.title { margin-left: -2em; }

ol.enumar { list-style-type: decimal; } ol.enumla { list-style-type: lower-alpha; } ol.enumlr { list-style-type: lower-roman; } ol.enumua { list-style-type: upper-alpha; } ol.enumur { list-style-type: upper-roman; }

li p { margin-top: 0.3em; margin-bottom: 0.3em; }

sup small { font-style: italic; color: #8F8F8F; } /* from xsl:query.xsl (D) */ div.exampleInner pre { margin-left: 1em; margin-top: 0em; margin-bottom: 0em} div.exampleOuter {border: 4px double gray; margin: 0em; padding: 0em} div.exampleInner { background-color: #d5dee3; border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; border-bottom-width: 4px; border-bottom-style: double; border-bottom-color: #d3d3d3; padding: 4px; margin: 0em } div.exampleWrapper { margin: 4px } div.exampleHeader { font-weight: bold; margin: 4px}

div.issue { border-bottom-color: black; border-bottom-style: solid; border-bottom-width: 1pt; margin-bottom: 20pt; }

th.issue-toc-head { border-bottom-color: black; border-bottom-style: solid; border-bottom-width: 1pt; }

.termdef { color: rgb(133,0,033); } .aside { border-left: 4px solid green; background-color: #EEFFEE; padding-left: 1em; font-size: small; }

.node-summary table { margin-left: 1em; } .node-summary thead td { font-weight: bold; } .node-summary td { padding-left: 1em; padding-right: 1em; border-bottom: 1px solid gray; }

.infoset-mapping table { margin-left: 1em; } .infoset-mapping thead td { font-weight: bold; } .infoset-mapping td { padding-left: 1em; padding-right: 1em; }

.issue-closed { color: green; }

.issue-resolved { color: red; }

.issue-open { color: red; }

div.schemaComp { border: 4px double gray; margin: 0em 1em; padding: 0em; } div.compHeader { margin: 4px; font-weight: bold; } span.schemaComp { background-color: white; color: #A52A2A; } div.compBody { border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; padding: 4px; margin: 0em; }

div.exampleInner { background-color: #d5dee3; color: black; border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; border-bottom-width: 4px; border-bottom-style: double; border-bottom-color: #d3d3d3; padding: 4px; margin: 0em; }

div.issueBody { margin-left: 0.25in; }

code.function { font-weight: bold; } code.return-type { font-style: italic; } code.type { font-style: italic; } code.as { font-style: normal; } code.arg { } code.strikeout { text-decoration: line-through; } p.table.footnote { font-size: 8pt; }

span.function { font-family: monospace; }

span.prefix { font-style: italic; }

table.hierarchy { font-size: x-small; }

td.castOther { background-color: yellow; color: black; }

tr.document { background-color: #FFD4EA; } tr.element { background-color: #96E3D1; } tr.attribute { background-color: #E7E6FF; } tr.text { background-color: #FFFFC2; } tr.processing-instruction { background-color: #E5FDFE; } tr.comment { background-color: #E1E1E1; } tr.namespace { background-color: #E7E6FF; }

/* from xsl-query.xsl (B) */ table.small { font-size: x-small; } a.judgment:visited, a.judgment:link { font-family: sans-serif; color: black; text-decoration: none } a.processing:visited, a.processing:link { color: black; text-decoration: none } a.env:visited, a.env:link { color: black; text-decoration: none } /** Advisement Box ************************************************************/ /* for attention-grabbing normative statements */

.advisement { border-color: orange; border-style: none solid; background: #fec; color: black; padding: .5em; border-width: .5em; page-break-inside: avoid; margin: 1em auto; }

/**/ Status Update (6 April 2021): Feedback, comments, error reports on this specification should be sent via GitHub https://github.com/w3c/qtspecs/issues [email protected] This version: http://www.w3.org/TR/2014/REC-xpath-datamodel-30-20140408/ Latest version of XQuery and XPath Data Model 3.0: http://www.w3.org/TR/xpath-datamodel-30/ Previous versions of XQuery and XPath Data Model 3.0: http://www.w3.org/TR/2013/PR-xpath-datamodel-30-20131022/ http://www.w3.org/TR/2013/CR-xpath-datamodel-30-20130108/ http://www.w3.org/TR/2011/WD-xpath-datamodel-30-20111213/ http://www.w3.org/TR/2011/WD-xpath-datamodel-30-20110614/ http://www.w3.org/TR/2010/WD-xpath-datamodel-30-20101214/ http://www.w3.org/TR/2009/WD-xpath-datamodel-11-20091215/ Most recent version of XQuery and XPath Data Model 3: http://www.w3.org/TR/xpath-datamodel-3/ Most recent Recommendation of XQuery and XPath Data Model: http://www.w3.org/TR/2010/REC-xpath-datamodel-20101214/ Editors: Norman Walsh (XML Query WG), MarkLogic Corporation <[email protected]> Anders Berglund (XSL WG), BC&TF <http://www.albconsults.com> John Snelson <[email protected]> Please check the errata See also translations This document is also available in these non-normative formats: XML Change markings relative to previous edition Copyright W3C ® MIT ERCIM Keio Beihang liability trademark document use This document defines the XQuery and XPath Data Model 3.0, which is the data model of [XML Path Language (XPath) 3.0] [XSL Transformations (XSLT) Version 3.0] [XQuery 3.0: An XML Query Language] [XSL Working Group] [XML Query Working Group] This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index This is one document in a set of six documents that have been progressed to Recommendation together (XQuery 3.0, XQueryX 3.0, XPath 3.0, Data Model 3.0, Functions and Operators 3.0, and Serialization 3.0). This is a Recommendation XML Query Working Group XSLT Working Group XML Activity This Recommendation of XQuery and XPath Data Model 3.0 represents the second version of a previous W3C Recommendation This specification is designed to be referenced normatively from other specifications defining a host language for it; it is not intended to be implemented outside a host language. The implementability of this specification has been tested in the context of its normative inclusion in host languages defined by the XQuery 3.0 XQuery 3.0 implementation report This document incorporates minor changes made against the Proposed Recommendation Proposed Recommendation G Change Log Please report errors in this document using W3C's public Bugzilla system http://www.w3.org/XML/2005/04/qt-bugzilla [email protected] http://lists.w3.org/Archives/Public/public-qt-comments/ This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web. This document was produced by groups operating under the 5 February 2004 W3C Patent Policy public list of any patent disclosures public list of any patent disclosures Essential Claim(s) section 6 of the W3C Patent Policy 1 Introduction Concepts Terminology Notation Node Identity Document Order Sequences Namespace Names Schema Information Representation of Types Predefined Types XML and XSD Versions Type System Atomic Values String Values Negative Zero Other Items Functions Data Model Construction Direct Construction Construction from an Infoset Construction from a PSVI Mapping PSVI Additions to Node Properties Element and Attribute Node Types Typed Value Determination Relationship Between Typed-Value and String-Value Pattern Facets Dates and Times QNames and NOTATIONS Infoset Mapping Accessors attributes Accessor base-uri Accessor children Accessor document-uri Accessor is-id Accessor is-idrefs Accessor namespace-nodes Accessor nilled Accessor node-kind Accessor node-name Accessor parent Accessor string-value Accessor type-name Accessor typed-value Accessor unparsed-entity-public-id Accessor unparsed-entity-system-id Accessor Nodes Document Nodes Overview Accessors Construction from an Infoset Construction from a PSVI Infoset Mapping Element Nodes Overview Accessors Construction from an Infoset Construction from a PSVI Infoset Mapping Attribute Nodes Overview Accessors Construction from an Infoset Construction from a PSVI Infoset Mapping Namespace Nodes Overview Accessors Construction from an Infoset Construction from a PSVI Infoset Mapping Processing Instruction Nodes Overview Accessors Construction from an Infoset Construction from a PSVI Infoset Mapping Comment Nodes Overview Accessors Construction from an Infoset Construction from a PSVI Infoset Mapping Text Nodes Overview Accessors Construction from an Infoset Construction from a PSVI Infoset Mapping Conformance A XML Information Set Conformance References Normative References Other References Schema for the Extended XS Namespace Glossary Example Implementation-Defined and Implementation-Dependent Items Implementation-Defined Items Implementation-Dependent Items Change Log Accessor Summary Infoset Construction Summary PSVI Construction Summary Infoset Mapping Summary This document defines the XQuery and XPath Data Model 3.0, which is the data model of [XML Path Language (XPath) 3.0] [XSL Transformations (XSLT) Version 3.0] [XQuery 3.0: An XML Query Language] In this document, examples and material labeled as "Note" are provided for explanatory purposes and are not normative. The XQuery and XPath Data Model 3.0 (henceforth "data model") serves two purposes. First, it defines the information contained in the input to an XSLT or XQuery processor. Second, it defines all permissible values of expressions in the XSLT, XQuery, and XPath languages. A language is closed XSLT 3.0, XQuery 3.0, and XPath 3.0 The data model is based on the [Infoset] [XQuery 3.0 Requirements] Support for XML Schema types. The XML Schema recommendations define features, such as structures ( [Schema Part 1] [Schema Part 2] Representation of collections of documents and of complex values. ( [XQuery 3.0 Requirements] Support for typed atomic values. Support for ordered, heterogeneous sequences. As with the Infoset, the XQuery and XPath Data Model 3.0 specifies what information in the documents is accessible, but it does not specify the programming-language interfaces or bindings used to represent or access the data. The data model can represent various values including not only the input and the output of a stylesheet or query, but all values of expressions used during the intermediate calculations. Examples include the input document or document repository (represented as a Document Node or a sequence of Document Nodes), the result of a path expression (represented as a sequence of nodes), the result of an arithmetic or a logical expression (represented as an atomic value), a sequence expression resulting in a sequence of items, etc. This document provides a precise definition of the properties of nodes in the XQuery and XPath Data Model 3.0, how they are accessed, and how they relate to values in the Infoset and PSVI. This section outlines a number of general concepts that apply throughout this specification. In this document, examples and material labeled as "Note" are provided for explanatory purposes and are not normative. For a full glossary of terms, see D Glossary In this specification the words must must not should should not may recommended [RFC 2119] This specification distinguishes between the data model as a general concept and specific items (documents, elements, atomic values, etc.) that are concrete examples of the data model by identifying all concrete examples as instances of the data model [ Definition instance of the data model sequence [ Definition sequence items 2.5 Sequences [ Definition item node function atomic value Sometimes it is necessary to distinguish the case where a particular property has no value in the data model. The canonical example of such a case is the namespace URI property of an expanded QName Definition absent Every node is one of the seven kinds of nodes defined in 6 Nodes dm: dm: dm: dm: Definition root node Note: The term “root node” is merely a designator, based on position, for one of the nodes in the tree without implying what kind of a node it is. In the XPath 1.0 datamodel the root node was a kind of node. [ Definition document [ Definition fragment [ Definition atomic value atomic type [ Definition atomic type primitive simple type [ Definition primitive simple types Section 3.2 Primitive datatypes XS2 [Schema Part 2] xs:untypedAtomic xs:anyAtomicType 2.7 Schema Information A type is represented in the data model by an expanded-QName [ Definition expanded-QName 3.3.3 QNames and NOTATIONS [ Definition Implementation-defined [ Definition Implementation-dependent Within this specification, the term URI refers to a Universal Resource Identifier as defined in [RFC 3986] [RFC 2987] In all cases where this specification leaves the behavior implementation-defined or implementation-dependent, the implementation has the option of providing mechanisms that allow the user to influence the behavior. In addition to prose, this specification defines a set of accessor functions to explain the data model. The accessors are shown with the prefix dm: Several prefixes are used throughout this document for notational convenience. The following bindings are assumed. xs: http://www.w3.org/2001/XMLSchema xsi: http://www.w3.org/2001/XMLSchema-instance fn: http://www.w3.org/2005/xpath-functions In practice, any prefix that is bound to the appropriate URI may be used. The signature of accessor functions is shown using the same style as [XQuery and XPath Functions and Operators 3.0] Section 1.4 Function signatures and descriptions FO30 This document relies on the [Infoset] Post-Schema-Validation Infoset information item [infoset property] Some aspects of type assignment rely on the ability to access properties of the schema components. Such properties are indicated by the style {component property}. Note that this does not mean a lightweight schema processor cannot be used, it only means that the application must have some mechanism to access the necessary properties. Each node has a unique identity. Every node Atomic values Note: The concept of node identity should not be confused with the concept of a unique ID, which is a unique name assigned to an element by the author to represent references using ID/IDREF correlation. [ Definition document order Definition stable Within a tree, document order satisfies the following constraints: The root node is the first node. Every node occurs before all of its children and descendants. Namespace Nodes immediately follow the Element Node with which they are associated. The relative order of Namespace Nodes is stable but implementation-dependent. Attribute Nodes immediately follow the Namespace Nodes of the element with which they are associated. If there are no Namespace Nodes associated with a given element, then the Attribute Nodes associated with that element immediately follow the element. The relative order of Attribute Nodes is stable but implementation-dependent. The relative order of siblings is the order in which they occur in the children Children and descendants occur before following siblings. The relative order of nodes in distinct trees is stable but implementation-dependent, subject to the following constraint: If any node in a given tree, T1 T2 T1 T2 An important characteristic of the data model is that there is no distinction between an item (a node, function, or atomic value) and a singleton sequence containing that item. An item is equivalent to a singleton sequence containing that item and vice versa. A sequence may contain any mixture of nodes, functions, and atomic values. When a node is added to a sequence its identity remains the same. Consequently a node may occur in more than one sequence and a sequence may contain duplicate items. Sequences never contain other sequences; if sequences are combined, the result is always a “flattened” sequence. In other words, appending “(d e)” to “(a b c)” produces a sequence of length 5: “(a b c d e)”. It does not Note: Sequences replace node-sets from XPath 1.0. In XPath 1.0, node-sets do not contain duplicates. In generalizing node-sets to sequences in XPath 3.0, duplicate removal is provided by functions on node sequences. The specifications [Namespaces in XML] [Namespaces in XML 1.1] [Namespaces in XML] [Namespaces in XML 1.1] [ Definition Namespace URI [Namespaces in XML] [Namespaces in XML 1.1] may [Namespaces in XML] [Namespaces in XML 1.1] not required In some interfaces, namespace names are held as values of type xs:anyURI xs:anyURI [Schema Part 2] xs:anyURI [Schema 1.1 Part 2] xs:anyURI xs:anyURI may not required The data model supports strongly typed languages such as [XML Path Language (XPath) 3.0] [XQuery 3.0: An XML Query Language] [Schema Part 1] To achieve this, the data model includes (by reference) the Schema Component Model described in [Schema Part 1] Note: The Schema Component Model includes a number of kinds of component, such as type definitions and element and attribute declarations, and defines the properties and relationships of these components. Many of these components and properties are not used by the language specifications that rely on XDM, and where this is the case, there is no requirement for implementations to make them visible. However, this specification makes no attempt to define the minimal subset of the schema component model that is needed to support the semantics of XPath and XQuery processing. There are two main areas where the language semantics depend on information in schema components: Expressions are evaluated with respect to a static context, which includes schema components, specifically type definitions, element declarations, and attribute declarations. The names of such components may be used in language constructs only if the components are present in the static context. Values including element and attribute nodes, and atomic values, have a property called a type annotation whose value is a type: this is a reference to a type definition in the Schema Component Model. Every item The property that holds the type is sometimes referred to as the type annotation: its value is a type definition component as defined in the Schema Component Model. This may be a built-in type (a type with a name such as xs:integer xs:string There is a constraint that the total set of components used during expression processing (both statically and dynamically) must constitute a valid schema. This implies, for example, that this total set does not include two different types with the same expanded name. Note: This makes it the responsibility of the processor to ensure that the schema components used in the static context of a query or expression during static analysis are consistent with the schema components used to validate documents during query or expression evaluation. This specification does not say how this should be achieved. It is also a constraint that the schema available to the processor must contain at least the components and properties needed to correctly implement the semantics of the XPath and XQuery language. For example, this means that given a node with a particular type annotation T, and a function that expects an argument of type S, there must be sufficient information available to the processor to establish whether or not T is derived from S. As with other consistency constraints described in this data model, it is a precondition that these constraints are satisfied; the specifications do not speculate on what happens if they are not. The data model uses expanded-QNames [Schema Part 2] For XML Schema types, the namespace name of the expanded-QName is the {target namespace} property of the type definition, and its local name is the {name} property of the type definition. The data model relies on the fact that an expanded-QName uniquely identifies every named type. Although it is possible for different schemas to define different types with the same expanded-QName, at most one of them can be used in any given validation episode. The data model cannot support environments where different types with the same expanded-QName are available. The scope over which the names of anonymous types must be meaningful and distinct is depends on the processing context. It is the responsibility of the host language to define the size and scope of the processing context. In addition to the 19 types defined in Section 3.2 Primitive datatypes XS2 [Schema Part 2] xs:anyAtomicType xs:untyped xs:untypedAtomic xs:dayTimeDuration xs:yearMonthDuration These types are defined in the XML Schema namespace with permission of the XML Schema Working Group; in implementations which support [Schema 1.1 Part 2] xs:anyAtomicType xs:dayTimeDuration xs:yearMonthDuration xs:untyped The datatype xs:untyped The properties of xs:untyped xs:anyType xs:untyped xs:anyType xs:untyped and no such derivations are allowed xs:untypedAtomic The datatype xs:untypedAtomic xs:untypedAtomic xs:untypedAtomic and no such derivations are allowed xs:anyAtomicType The datatype xs:anyAtomicType xs:anySimpleType xs:decimal xs:string xs:anyAtomicType No type may be derived from xs:anyAtomicType xs:dayTimeDuration The type xs:dayTimeDuration xs:duration xs:dayTimeDuration xs:dayTimeDuration [ISO 8601] xs:dayTimeDuration xs:duration <xs:simpleType name='dayTimeDuration'> <xs:restriction base='xs:duration'> <xs:pattern value="[^YM]*[DT].*"/> </xs:restriction> </xs:simpleType> xs:yearMonthDuration The type xs:yearMonthDuration xs:duration xs:yearMonthDuration xs:integer xs:yearMonthDuration [ISO 8601] The type xs:yearMonthDuration xs:duration <xs:simpleType name='yearMonthDuration'> <xs:restriction base='xs:duration'> <xs:pattern value="[^DT]*"/> </xs:restriction> </xs:simpleType> A schema for xs:dayTimeDuration xs:yearMonthDuration C Schema for the Extended XS Namespace Some of the types defined in XML Schema have differing definitions in XSD 1.0 and XSD 1.1; furthermore, some types are defined by reference to other specifications including XML and XML Namespaces, and these too may vary from one version of the specification to the next. As a general policy, implementations of data types should This means, for example, that the xs:string data type should should should In practice interoperability problems can arise both because specifications are not always in synchronization with each other (for example, XSD 1.0 contains referenced to dated versions of XML 1.0 other than the latest version), and also because implementations may recommended required [ Definition string xs:string characters [ Definition character Char recommended XML 1.1 Second Edition The diagrams below show how nodes, functions, primitive simple types The xs:IDREFS xs:NMTOKENS xs:ENTITIES user-defined list and union types The first diagram and its corresponding table illustrate the relationship of various item types. Item types in the data model form a lattice rather than a hierarchy: in the relationship defined by the derived-from(A, B) function(xs:string) as xs:int function(xs:NCName) as xs:int function(xs:string) as xs:decimal A union(A, B) union(A, C) In the table, each type whose name is indented is derived from the type whose name appears nearest above it with one less level of indentation. item xs:anyAtomicType node attribute user-defined attribute types comment document user-defined document types element user-defined element types namespace processing-instruction text function(*) function() as item()* function(item()*) as item()* function(item()*) as item() function(item()*) as item()? function(item()*) as item()+ … function(item()*, item()*) as item()* function(item()*, item()*) as item() … … The next diagram and table illustrate the "any type" type hierarchy, in which all types are derived from distinguished type xs:anyType In the table, each type whose name is indented is derived from the type whose name appears nearest above it with one less level of indentation. xs:anyType user-defined complex types xs:untyped xs:anySimpleType user-defined list and union types xs:IDREFS xs:NMTOKENS xs:ENTITIES xs:anyAtomicType The final diagram and table show all of the atomic types, including the primitive simple types and the built-in types derived from the primitive simple types. This includes all the built-in datatypes defined in [Schema Part 2] 2.7 Schema Information In the table, each type whose name is indented is derived from the type whose name appears nearest above it with one less level of indentation. xs:untypedAtomic xs:dateTime xs:dateTimeStamp xs:date xs:time xs:duration xs:yearMonthDuration xs:dayTimeDuration xs:float xs:double xs:decimal xs:integer xs:nonPositiveInteger xs:negativeInteger xs:long xs:int xs:short xs:byte xs:nonNegativeInteger xs:unsignedLong xs:unsignedInt xs:unsignedShort xs:unsignedByte xs:positiveInteger xs:gYearMonth xs:gYear xs:gMonthDay xs:gDay xs:gMonth xs:string xs:normalizedString xs:token xs:language xs:NMTOKEN xs:Name xs:NCName xs:ID xs:IDREF xs:ENTITY xs:boolean xs:base64Binary xs:hexBinary xs:anyURI xs:QName xs:NOTATION An atomic value can be constructed from a lexical representation. Given a string and an atomic type, the atomic value is constructed in such a way as to be consistent with schema validation xs:untypedAtomic Section 17 Constructor functions FO30 Section 18 Casting FO30 [XQuery and XPath Functions and Operators 3.0] A string value can be constructed from an atomic value. Such a value is constructed by converting the atomic value to its string representation as described in Section 18 Casting FO30 Section I Backwards Compatibility with XPath 1.0 (Non-Normative) XP30 The xs:float xs:double [Schema 1.1 Part 2] To accommodate this difference, when converting from an xs:string xs:float xs:double The XPath Data Model is the abstraction over which XPath expressions are evaluated. Historically, all of the items in the data model could be derived directly (nodes) or indirectly (typed values, sequences) from an XML document. However, as the XPath expression language has matured, new features have been added which require additional types of items to appear in the data model. These items have no direct XML serialization, but they are never the less part of the data model. [ Definition function called A function has the following properties: name ( xs:QName absent parameter names ( xs:QName* signature (a FunctionTest Annotation* TypedFunctionTest The TypedFunctionTest XP30 SequenceType XP30 Definition function signature function The presence of annotations is language dependent; functions defined in languages, such as XPath, that have no mechanism for defining annotations will create functions in the data model with zero annotations. implementation The implementation is either: a host language expression, which is always associated with a static context, or an implementation-dependent function implementation, which is optionally associated with both a static and a dynamic context. nonlocal variable bindings (a mapping from xs:QName item()* [ Definition arity The space of all possible function signatures function(*) item() function(*) functions Section 2.5.6 SequenceType Subtype Relationships XP30 function(item()) as item() function(*) function(item()) as xs:integer function(item()) as item() function(item()) as item() function(xs:string) as item() This section describes the constraints on instances of the data model. The data model supports well-formed XML documents conforming to [Namespaces in XML] [Namespaces in XML 1.1] [Namespaces in XML] [Namespaces in XML 1.1] [Infoset] In other words, the data model supports the following classes of XML documents: Well-formed documents conforming to [Namespaces in XML] [Namespaces in XML 1.1] DTD-valid documents conforming to [Namespaces in XML] [Namespaces in XML 1.1] W3C XML Schema-validated documents. This document describes how to construct an instance of the data model from an infoset ( [Infoset] An instance of the data model can also be constructed directly through application APIs, or from non-XML sources such as relational tables in a database. Data model construction from sources other than an Infoset or PSVI is implementation-defined. Regardless of how an instance of the data model is constructed, every node and atomic value in the data model must have a typed-value that is consistent with its type. The data model supports some kinds of values that are not supported by [Infoset] document fragments atomic values Although this document describes construction of an instance of the data model in terms of infoset properties, an infoset is not a necessary precondition for building an instance of the data model. There are no constraints on how an instance of the data model may be constructed directly, save that the resulting instance must An instance of the data model can be constructed from an infoset that satisfies the following general constraints: All general and external parsed entities must be fully expanded. The Infoset must not contain any unexpanded entity reference information items The infoset must An instance of the data model constructed from an information set must An instance of the data model can be constructed from a PSVI, whose element and attribute information items have been strictly assessed, laxly assessed, or have not been assessed. Constructing an instance of the data model from a PSVI must Data model construction requires that the PSVI provide unique names for all anonymous schema types. Note: [Schema Part 1] [ Definition incompletely validated [validity] The data model supports incompletely validated documents. Elements and attributes that are not valid are treated as having unknown types. The most significant difference between Infoset construction and PSVI construction occurs in the area of schema type assignment. Other differences can also arise from schema processing: default attribute and element values may be provided, white space normalization of element content may occur, and the user-supplied lexical form of elements and attributes with atomic schema types may be lost. A PSVI element or attribute information item may have a [validity] [validity] valid invalid notKnown valid valid The precise definition of the schema type of an element or attribute information item depends on the properties of the PSVI. In the PSVI, [Schema Part 1] [type definition] [type definition namespace] [type definition name] [type definition anonymous] [element declaration] [attribute declaration] [type definition] [type definition] [type definition] The type depends on the declared type, the actual type, and the [validity] [validation attempted] The [validity] [validation attempted] valid full expanded-QName If the declared type exists and is a union and the actual type is (not the same as the declared type, and not a type derived from the declared type, but) one of the member types of the union, or derived from one of its member types: If the {name} property of the declared type is present: the {target namespace} and {name} properties of the declared type. If the {name} property of the declared type is absent: the namespace and local name of the anonymous type name supplied for the declared type. If there is no declared type, and the actual type is a union, then: If the {name} property of the actual type is present: the {target namespace} and {name} properties of the actual type. If the {name} property of the actual type is absent: the namespace and local name of the anonymous type name supplied for the actual type. Otherwise: If [type definition anonymous] If [type definition anonymous] The [validity] invalid [validation attempted] partial xs:anyType xs:anySimpleType The [validity] notKnown xs:anyType xs:anySimpleType The [validity] [validation attempted] xs:untyped xs:untypedAtomic The prefix associated with the type names is implementation-dependent. This section describes how the typed value of an Element or Attribute Node is computed from an element or attribute PSVI information item, where the information item has either a simple type or a complex type with simple content. For other kinds of Element Nodes, see 6.2.4 Construction from a PSVI 6.3.4 Construction from a PSVI The typed value of Attribute Nodes and some Element Nodes is a sequence of atomic values. The types of the items in the typed value of a node may differ from the type of the node itself. This section describes how the typed value of a node is derived from the properties of an information item in a PSVI. The types of the items in the typed value of a node are determined as follows. The process begins with a type, T T T T M Note: For atomic and list types, the mapping is the “lexical mapping” defined for T [Schema Part 2] [Schema Part 2] [Schema Part 1] The typed value is determined as follows: If the nilled true If T xs:anySimpleType xs:anyAtomicType [schema normalized value] xs:untypedAtomic Otherwise, the typed value is the result of applying M [member type definition] T T The typed value determination process is guaranteed to result in a sequence of atomic values, each having a well-defined atomic type. This sequence of atomic values, in turn, determines the typed-value property of the node in the data model. Element and attribute nodes have both typed-value and string-value properties. However, implementations are allowed some flexibility in how these properties are stored. An implementation may choose to store the string-value only and derive the typed-value from it, or to store the typed-value only and derive the string-value from it, or to store both the string-value and the typed-value. In order to permit these various implementation strategies, some variations in the string value of a node are defined as insignificant. Implementations that store only the typed value of a node are permitted to return a string value that is different from the original lexical form of the node content. For example, consider the following element: <offset xsi:type="xs:integer">0030</offset> Assuming that the node is valid, it has a typed value of 30 as an xs:integer If an implementation stores only the string-value of a node, the following considerations apply: Where union types occur, the implementation must be able to deliver the typed-value as an instance of the appropriate member type. For example, if the type an element node is my:integer-or-string, which is defined as a union of xs:integer and xs:string, and the string-value of the node is "47", the implementation must be able to deliver the typed-value of the node as either the integer 47 or the string "47", depending on which member type validated the element. Where types of xs:QName xs:NOTATION 3.3.3 QNames and NOTATIONS Where an element with a complex type and element-only content occurs, it is an error to attempt to access the typed-value of the Element Node. If an implementation stores only the typed-value of a node, it must be prepared to construct string values from not only the node, but in some cases also the descendants of that node. For example, an element with a complex type and element-only content has no typed-value but does have a string-value that is the concatenation of the string-values of all its Text Node descendants in document order. A further caveat applies if an implementation stores the typed value of a node. If a new data model is constructed by copying portions of another data model, and the copy operation does not preserve inherited namespaces, and the type is a union type that is sensitive to the namespace context, then the typed value may be different than what would be obtained by revalidating the node within its new namespace context. Although this may stretch the semantics of “consistent with schema validation”, we accept this possibility; it is not an error. Creating a subtype by restriction generally reduces the value valid The pattern facet is different because it restricts the lexical valid The pattern facet is not reversible in practice. A given point in the value space might have several lexical representations. In general, there's no practical way to determine which, if any, of these representations satisfies the pattern facet of the type. As a consequence, pattern facets are not respected when mapping to an Infoset or during serialization and values in the data model that were originally valid with respect to a schema that contains pattern-based restrictions may be invalid after serialization. The date and time types require special attention. This section applies to implementations that store the typed value of xs:dateTime xs:date xs:time xs:gYearMonth xs:gYear xs:gMonthDay xs:gMonth xs:gDay The values of the date/time types are represented in the data model using seven components: year An xs:integer month An xs:integer day An xs:integer hour An xs:integer minute An xs:integer An xs:decimal timezone An xs:dayTimeDuration Components that are intrinsic to the datatype (for example, day, month, and year in a xs:date xs:time Thus, the lexical xs:dateTime 2003-01-02T11:30:00-05:00 {2003, 1, 2, 11, 30, 0.0, -PT05H00M} 2003-01-16T16:30:00 {2003, 1, 16, 16, 30, 0, ()} xs:gDay ---30+10:30 {(), (), 30, (), (), (), PT10H30M} The lexical form “ 24:00:00 xs:time {(), (), (), 0, 0, 0.0, ()} xs:dateTime 1999-12-31T24:00:00 {2000, 1, 1, 0, 0, 0.0, ()} Note: Implementations are permitted to store date/time values in any representation that's convenient for them, provided that the individual properties can be accessed and modified. The QName NOTATION xs:QName xs:NOTATION As defined in XML Schema, the lexical space for qualified names includes a local name and an optional namespace prefix. The value space for qualified names contains a local name and an optional namespace URI. Therefore, it is not possible to derive a lexical value from the typed value, or vice versa, without access to some context that defines the namespace bindings. When qualified names exist as values of nodes in a well-formed document, it is always possible to determine such a namespace context. However, the data model also allows qualified names to exist as freestanding atomic values, or as the name or value of a parentless attribute node, and in these cases no namespace context is available. In this Data Model, therefore, the value space for qualified names contains a local-name, an optional namespace URI, and an optional prefix. The prefix is used only when producing a lexical representation of the value, that is, when casting the value to a string. The prefix plays no part in other operations involving qualified names: in particular, two qualified names are equal if their local names and namespace URIs match, regardless whether they have the same prefix. The following consistency constraints apply: If the namespace URI of a qualified name is absent absent For every element node whose name has a prefix, the prefix must be one that has a binding to the namespace URI of the element name in the namespaces property of the element. For every element node whose name has no prefix, the element must have a a binding for the empty prefix to the namespace URI of the element name, or must have no binding for the empty prefix in the case where the name of the element has no namespace URI. For every attribute node whose name has a prefix, the attribute node must either be parentless, or the prefix must be one that has a binding to the namespace URI of the attribute name in the namespaces property of the parent element. For every qualified name that contains a prefix and that is included in the typed value of an element node, or of an attribute node that has an element node as its parent, the prefix must be one that is bound to the namespace URI of the qualified name in the namespaces property of that element. For every qualified name that contains a namespace URI and no prefix, and that is included in the typed value of an element node, or of an attribute node that has an element node as its parent, that element node must have a binding for the empty prefix to that namespace URI in its namespace property. For every qualified name that contains neither a namespace URI nor a prefix, and that is included in the typed value of an element node, or of an attribute node that has an element node as its parent, that node must not have a binding for the empty prefix. No qualified name that contains a prefix may be included in the typed value of an attribute node that has no parent. This specification describes how to map each kind of node to the corresponding information item. This mapping produces an Infoset; it does not and cannot produce a PSVI. Validation must be used to obtain a PSVI for a (portion of a) data model instance. A set of accessors is defined on nodes In order for processors to be able to operate on instances of the data model, the model must expose the properties of the items it contains. The data model does this by defining a family of accessor functions. These are not functions in the literal sense; they are not available for users or applications to call directly. Rather they are descriptions of the information that an implementation of the data model must expose to applications. Functions and operators available to end-users are described in [XQuery and XPath Functions and Operators 3.0] Some typed values in the data model are absent absent typed value attributes dm: $n as node() as attribute()* The dm: It is defined on all seven base-uri dm: $n as node() as xs:anyURI? The dm: [XML Base] It is defined on all seven children dm: $n as node() as node()* The dm: It is defined on all seven document-uri dm: $node as node() as xs:anyURI? The dm: It is defined on all seven is-id dm: $node as node() as xs:boolean? The dm: 6.2 Element Nodes 6.3 Attribute Nodes It is defined on all seven is-idrefs dm: $node as node() as xs:boolean? The dm: 6.2 Element Nodes 6.3 Attribute Nodes It is defined on all seven namespace-nodes dm: $n as node() as node()* The dm: It is defined on all seven nilled dm: $n as node() as xs:boolean? The dm: [Schema Part 1] It is defined on all seven node-kind dm: $n as node() as xs:string The dm: It is defined on all seven node-name dm: $n as node() as xs:QName? The dm: xs:QName 3.3.3 QNames and NOTATIONS It is defined on all seven parent dm: $n as node() as node()? The dm: It is defined on all seven string-value dm: $n as node() as xs:string The dm: It is defined on all seven type-name dm: $n as node() as xs:QName? The dm: xs:QName It is defined on all seven typed-value dm: $n as node() as xs:anyAtomicType* The dm: It is defined on all seven unparsed-entity-public-id dm: $node as node() $entityname as xs:string as xs:string? The dm: $entityname It is defined on all seven unparsed-entity-system-id dm: $node as node() $entityname as xs:string as xs:anyURI? The dm: [system identifier] [declaration base URI] $entityname It is defined on all seven [ Definition Nodes document element attribute text namespace processing instruction comment All nodes must Every node must The children must not The children must not The children attributes must not Document Nodes encapsulate XML documents. Documents have the following properties: base-uri children unparsed-entities document-uri string-value typed-value Document Nodes must The children must If a node N children D parent N must D If a node N parent D N must children D The string-value string-value In the [Infoset] document information item element information item processing instruction information item comment information item element information item Implementations that support DTD processing and access to the unparsed entity accessors use the unparsed-entities dm: dm: dm: Returns the empty sequence dm: Returns the value of the base-uri dm: Returns the value of the children dm: Returns the absolute URI of the resource from which the Document Node was constructed, or the empty sequence if no such absolute URI is available. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence dm: Returns the empty sequence dm: Returns “ document dm: Returns the empty sequence. dm: Returns the empty sequence dm: Returns the value of the string-value dm: Returns the empty sequence. dm: Returns the value of the typed-value dm: Returns the public identifier of the specified unparsed entity or the empty sequence if no such entity exists. dm: Returns the system identifier of the specified unparsed entity or the empty sequence if no such entity exists. The document information item document information item The following infoset properties are required: [children] [base URI] The following infoset properties are optional: [unparsed entities] Document Node properties are derived from the infoset as follows: base-uri The value of the [base URI] base-uri In practice a [base URI] base-uri children The sequence of nodes constructed from the information items found in the [children] For each element, processing instruction, and comment found in the [children] children If present among the [children] document type declaration information item unparsed-entities If the [unparsed entities] unparsed entity information items dm: dm: The internal structure of the values of the unparsed-entities string-value The concatenation of the string-values of all its Text Node descendants in document order. If the document has no such descendants, the zero-length string. typed-value The dm: xs:untypedAtomic document-uri The document-uri fn:collection document-uri base-uri If the document-uri fn:doc() document-uri document-uri In other words, for any Document Node $arg fn:document-uri($arg) fn:doc(fn:document-uri($arg)) $arg Construction from a PSVI is identical to construction from the Infoset. A Document Node maps to a document information item The following properties are specified by this mapping: [children] A list of information items obtained by processing each of the dm: [document element] The element information item [children] [unparsed entities] An unordered set of unparsed entity information item unparsed-entities Each unparsed entity maps to an unparsed entity information item [name] The name of the entity. [system identifier] The system identifier of the entity. [public identifier] The public identifier of the entity. [declaration base URI] Implementation defined. In many cases, the document-uri must [declaration base URI] The following properties of the unparsed entity information item [notation name] [notation] The following properties of the document information item [notations] [character encoding scheme] [standalone] [version] [all declarations processed] Element Nodes encapsulate XML elements. Elements have the following properties: base-uri node-name parent schema-type children attributes namespaces nilled string-value typed-value is-id is-idrefs Element Nodes must The children must The Attribute Nodes of an element must xs:QName If a node N children E parent N must E Exclusive of Attribute and Namespace Nodes, if a node N parent E N must children E The data model permits Element Nodes without parents (to represent partial results during expression processing, for example). Such Element Nodes must not children If an Attribute Node A attributes E parent A must E If an Attribute Node A parent E A must attributes E The data model permits Attribute Nodes without parents. Such Attribute Nodes must not attributes If a Namespace Node N E N must E If a Namespace Node N E N must namespaces E The data model permits Namespace Nodes without parents. Such Namespace Nodes must not namespaces If the dm: xs:untyped dm: must xs:untyped dm: must xs:untypedAtomic If the dm: xs:untyped nilled must false If the nilled true children must not For every expanded QName dm: dm: attributes xs:QName xs:NOTATION must namespaces If any of the expanded QNames has an empty URI, then there must not namespaces Every element must include a Namespace Node and/or namespace binding for the prefix xml http://www.w3.org/XML/1998/namespace The string-value string-value dm: Returns the value of the attributes dm: Returns the value of the base-uri dm: Returns the value of the children dm: Returns the empty sequence. dm: Returns the value of the is-id dm: Returns the value of the is-idrefs dm: Returns the value of the namespaces dm: Returns the value of the nilled dm: Returns “ element dm: Returns the value of the node-name dm: Returns the value of the parent dm: Returns the value of the string-value dm: Returns the value of the schema-type dm: Returns the value of the typed-value dm: Returns the empty sequence. dm: Returns the empty sequence. The element information items element information item The following infoset properties are required: [namespace name] [local name] [children] [attributes] [in-scope namespaces] [base URI] [parent] Element Node properties are derived from the infoset as follows: base-uri The value of the [base URI] base-uri In practice a [base URI] base-uri node-name An xs:QName [prefix] [local name] [namespace name] parent The node that corresponds to the value of the [parent] schema-type All Element Nodes constructed from an infoset have the type xs:untyped children The sequence of nodes constructed from the information items found in the [children] For each element, processing instruction, comment, and maximal sequence of adjacent character information items [children] children Because the data model requires that all general entities be expanded, there will never be unexpanded entity reference information item attributes A set of Attribute Nodes constructed from the attribute information items [attributes] xml:lang xml:space xsi:type Default and fixed attributes provided by the DTD are added to the [attributes] attributes namespaces A set of Namespace Nodes constructed from the namespace information items [in-scope namespaces] Implementations may namespace information items It appears in the expanded QName node-name It appears in the expanded QName node-name Note: applications may rely on namespaces that are not known to be used, for example when QNames are used in content and that content does not have a type of xs:QName nilled All Element Nodes constructed from an infoset have a nilled false string-value The string-value character information item [children] character information items 6.7.3 Construction from an Infoset 6.7 Text Nodes This process is equivalent to concatenating the dm: If the element has no such descendants, the string-value typed-value The string-value xs:untypedAtomic is-id All Element Nodes constructed from an infoset have a is-id false is-idrefs All Element Nodes constructed from an infoset have a is-idrefs false The following Element Node properties are affected by PSVI properties. schema-type The schema-type 3.3.1.1 Element and Attribute Node Types children The sequence of nodes constructed from the information items found in the [children] For each element, processing instruction, comment, and maximal sequence of adjacent character information items [children] children For elements with schema simple types, or complex types with simple content, if the [schema normalized value] may processing instruction comment information items [children] [schema normalized value] children [schema normalized value] must not must The relative order of Processing Instruction and Comment Nodes must be preserved, but the position of the Text Node, if it is present, among them is implementation defined. The effect of the above rules is that where a fixed or default value for an element is defined in the schema, and the element takes this default value, a text node will be created to contain the value, even though there are no character information items representing the value in the PSVI. The position of this text node relative to any comment or processing instruction children is implementation-dependent. [Schema Part 1] may Because the data model requires that all general entities be expanded, there will never be unexpanded entity reference information item attributes A set of Attribute Nodes constructed from the attribute information items [attributes] xml:lang xml:space xsi:type Default and fixed attributes provided by XML Schema processing are added to the [attributes] attributes namespaces A set of Namespace Nodes constructed from the namespace information items [in-scope namespaces] Implementations may namespace information items It appears in the expanded QName node-name It appears in the expanded QName node-name It appears in the expanded QName xs:QName Note: applications may rely on namespaces that are not known to be used, for example when QNames are used in content and that content does not have a type of xs:QName nilled If the [validity] valid [nil] nilled true nilled false string-value The string-value is calculated as follows: If the element is empty: its string value is the zero length string. If the element has a type of xs:untyped string-value If the element has a simple type or a complex type with simple content: its string-value is the [schema normalized value] If an implementation stores only the typed value of an element, it may use any valid lexical representation of the typed value for the string-value typed-value The typed-value is calculated as follows: If the element is of type xs:untyped dm: xs:untypedAtomic If the element has a complex type with empty content, its typed-value is the empty sequence. If the element has a simple type or a complex type with simple content: its typed value is computed as described in 3.3.1.2 Typed Value Determination Note that in the case of dates and times, the timezone is preserved as described in 3.3.2 Dates and Times xs:QName xs:NOTATION 3.3.3 QNames and NOTATIONS If the element has a complex type with mixed content (including xs:anyType dm: xs:untypedAtomic Otherwise, the element must be a complex type with element-only content. The typed-value of such an element is absent dm: is-id If the element has a complex type with element-only content, the is-id false xs:ID xs:ID is-id true false Note: This means that in the case of a type constructed by list from xs:ID xs:ID xs:ID Note: The element that is marked with the is-id xs:ID is-idrefs If the element has a complex type with element-only content, the is-idrefs false xs:IDREF xs:IDREFS is-idrefs true false All other properties have values that are consistent with construction from an infoset. An Element Node maps to an element information item The following properties are specified by this mapping: [namespace name] The namespace name of the value of dm: [local name] The local part of the value of dm: [prefix] The prefix associated with the value of dm: [children] A list of information items obtained by processing each of the dm: [attributes] An unordered set of information items obtained by processing each of the dm: [in-scope namespaces] An unordered set of namespace information items namespaces Each in-scope namespace maps to a namespace information item [prefix] The prefix associated with the namespace. [namespace name] The URI associated with the namespace. [base URI] The value of dm: [parent] If this node is the root of the infoset mapping operation, unknown If this node has a parent, the information item that corresponds to the node returned by dm: Otherwise no value The following property has no value: [namespace attributes] Attribute Nodes represent XML attributes. Attributes have the following properties: node-name parent schema-type string-value typed-value is-id is-idrefs Attribute Nodes must If an Attribute Node A attributes E parent A must E If a Attribute Node A E A must attributes E The data model permits Attribute Nodes without parents (to represent partial results during expression processing, for example). Such attributes must not attributes In the node-name of an attribute node, if a namespace URI is present then a prefix must For convenience, the Element Node that owns this attribute is called its "parent" even though an Attribute Node is not a "child" of its parent element. dm: Returns the empty sequence. dm: If the attribute has a parent, returns the value of the dm: dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the value of the is-id dm: Returns the value of the is-idrefs dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns “ attribute dm: Returns the value of the node-name dm: Returns the value of the parent dm: Returns the value of the string-value dm: Returns the value of the schema-type dm: Returns the value of the typed-value dm: Returns the empty sequence. dm: Returns the empty sequence. The attribute information items attribute information item The following infoset properties are required: [namespace name] [local name] [normalized value] [attribute type] [owner element] Attribute Node properties are derived from the infoset as follows: node-name An xs:QName [prefix] [local name] [namespace name] parent The Element Node that corresponds to the value of the [owner element] schema-type The value xs:untypedAtomic string-value The [normalized value] typed-value The attribute’s typed-value is its dm: xs:untypedAtomic is-id If the attribute is named xml:id [attribute type] ID [xml:id] ID may is-id true xml:id If the [attribute type] ID true false is-idrefs If the [attribute type] IDREF IDREFS true false The following Attribute Node properties are affected by PSVI properties. string-value The [schema normalized value] Otherwise, the [normalized value] If an implementation stores only the typed value of an attribute, it may use any valid lexical representation of the typed value for the string-value schema-type The schema-type 3.3.1.1 Element and Attribute Node Types typed-value The typed-value is calculated as follows: If the attribute is of type xs:untypedAtomic dm: xs:untypedAtomic Otherwise, a sequence of zero or more atomic values as described in 3.3.1.2 Typed Value Determination is-id If the attribute is named xml:id [attribute type] xs:ID xs:ID [xml:id] xs:ID may is-id xml:id Otherwise, if the typed-value of the attribute consists of exactly one atomic value and that value is of type xs:ID xs:ID is-id true false Note: This means that in the case of a type constructed by list from xs:ID xs:ID xs:ID is-idrefs If any of the atomic values in the typed-value of the attribute is of type xs:IDREF xs:IDREFS is-idrefs true false Note: This rule means that a type constructed by list with an item type of xs:IDREF xs:IDREF is-idrefs xs:IDREFS xs:IDREFS is-idrefs xs:IDREF All other properties have values that are consistent with construction from an infoset. Note: attributes from the XML Schema instance namespace, " http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation xsi:type An Attribute Node maps to an attribute information item The following properties are specified by this mapping: [namespace name] The namespace name of the value of dm: [local name] The local part of the value of dm: [prefix] The prefix associated with the value of dm: [normalized value] The value of dm: [owner element] If this node has a parent, the information item that corresponds to the node returned by dm: Otherwise no value The following properties have no value: [specified] [attribute type] [references] Each Namespace Node represents the binding of a namespace URI to a namespace prefix or to the default namespace. Implementations that do not use Namespace Nodes may represent the same information using the namespaces prefix uri parent Namespace Nodes must If a Namespace Node N E N must E If a Namespace Node N E N must E A Namespace Node must xmlns http://www.w3.org/2000/xmlns/ The data model permits Namespace Nodes without parents, see below. In XPath 1.0, Namespace Nodes were directly accessible by applications, by means of the namespace axis. In XPath 3.0 3.0 3.0 The information held in namespace nodes is instead made available to applications using functions defined in [XQuery and XPath Functions and Operators 3.0] Implementations that expose the namespace axis must xml [Namespaces in XML] Note: In implementations that do not expose the namespace axis, there is no means by which the host language can tell if namespace nodes are shared or not and, in such circumstances, sharing namespace nodes may be a very reasonable implementation strategy. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns “ namespace dm: If the prefix xs:QName prefix dm: Returns the value of the parent dm: Returns the value of the uri dm: Returns the empty sequence. dm: Returns the value of the uri xs:string dm: Returns the empty sequence. dm: Returns the empty sequence. The namespace information items The following infoset properties are required: [prefix] [namespace name] Namespace Node properties are derived from the infoset as follows: prefix The [prefix] uri The [namespace name] parent The element in whose [in-scope namespaces] namespace information item dm: Construction from a PSVI is identical to construction from the Infoset. A Namespace Node maps to a namespace information item The following properties are specified by this mapping: [prefix] The prefix associated with the namespace. [namespace name] The value of dm: Processing Instruction Nodes encapsulate XML processing instructions. Processing instructions have the following properties: target content base-uri parent Processing Instruction Nodes must The string "?>" must not content The target must NCName dm: Returns the empty sequence. dm: Returns the value of the base-uri dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns “ processing-instruction dm: Returns an xs:QName target dm: Returns the value of the parent dm: Returns the value of the content dm: Returns the empty sequence. dm: Returns the value of the content xs:string dm: Returns the empty sequence. dm: Returns the empty sequence. A Processing Instruction Node is constructed for each processing instruction information item The following infoset properties are required: [target] [content] [base URI] [parent] Processing Instruction Node properties are derived from the infoset as follows: target The value of the [target] content The value of the [content] base-uri The value of the [base URI] base-uri In practice a [base URI] base-uri parent The node corresponding to the value of the [parent] There are no Processing Instruction Nodes for processing instructions that are children of a document type declaration information item Construction from a PSVI is identical to construction from the Infoset. An Processing Instruction Node maps to a processing instruction information item The following properties are specified by this mapping: [target] The local part of the value of dm: [content] The value of dm: [base URI] The value of dm: [parent] If this node is the root of the infoset mapping operation, unknown If this node has a parent, the information item that corresponds to the node returned by dm: Otherwise no value [notation] no value Comment Nodes encapsulate XML comments. Comments have the following properties: content parent Comment Nodes must The string "--" must not content The character "-" must not content dm: Returns the empty sequence. dm: If the comment has a parent, returns the value of the dm: dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns “ comment dm: Returns the empty sequence. dm: Returns the value of the parent dm: Returns the value of the content dm: Returns the empty sequence. dm: Returns the value of the content xs:string dm: Returns the empty sequence. dm: Returns the empty sequence. The comment information items A Comment Node is constructed for each comment information item The following infoset properties are required: [content] [parent] Comment Node properties are derived from the infoset as follows: content The value of the [content] parent The node corresponding to the value of the [parent] There are no Comment Nodes for comments that are children of a document type declaration information item Construction from a PSVI is identical to construction from the Infoset. A Comment Node maps to a comment information item The following properties are specified by this mapping: [content] The value of the dm: [parent] If this node is the root of the infoset mapping operation, unknown If this node has a parent, the information item that corresponds to the node returned by dm: Otherwise no value Text Nodes encapsulate XML character content. Text has the following properties: content parent Text Nodes must If the parent must not content In addition, Document and Element Nodes impose the constraint that two consecutive Text Nodes can never occur as adjacent siblings. When a Document or Element Node is constructed, Text Nodes that would be adjacent must must dm: Returns the empty sequence. dm: If the Text Node has a parent, returns the value of the dm: dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns the empty sequence. dm: Returns “ text dm: Returns the empty sequence. dm: Returns the value of the parent dm: Returns the value of the content dm: Returns xs:untypedAtomic dm: Returns the value of the content xs:untypedAtomic dm: Returns the empty sequence. dm: Returns the empty sequence. The character information items character information items The following infoset properties are required: [character code] [parent] The following infoset properties are optional: [element content whitespace] A sequence of character information items All of the information items in the sequence have the same parent. The sequence consists of adjacent character information items No other such sequence exists that contains any of the same character information items Text Node properties are derived from the infoset as follows: content A string comprised of characters that correspond to the [character code] character information items If the resulting Text Node consists entirely of whitespace and the [element content whitespace] character information items true content The content of the Text Node is not necessarily normalized as described in the [Character Model] parent The node corresponding to the value of the [parent] For Text Nodes constructed from the [schema normalized value] content [schema normalized value] Otherwise, construction from a PSVI is the same as construction from the Infoset except for the content content [element content whitespace] character information items mixed content Text Nodes are only allowed to be empty if they have no parents; an empty Text Node will be discarded when its parent is constructed, if it has a parent. A Text Node maps to a sequence of character information items Each character of the dm: character information item [character code] The Unicode code point value of the character. [parent] If this node is the root of the infoset mapping operation, unknown If this node has a parent, the information item that corresponds to the node returned by dm: Otherwise no value [element content whitespace] Unknown This sequence of characters constitutes the infoset mapping. The data model is intended primarily as a component that can be used by other specifications. Therefore, the data model relies on specifications that use it (such as [XML Path Language (XPath) 3.0] [XSL Transformations (XSLT) Version 3.0] [XQuery 3.0: An XML Query Language] Authors of conformance criteria for the use of the data model should pay particular attention to the following features of the data model: Support for the normative construction from an infoset described in 3.2 Construction from an Infoset Support for the normative construction from a PSVI described in 3.3 Construction from a PSVI Support for XML 1.0 and XML 1.1. Support for data types in XML Schema 1.0 and XML Schema 1.1. How namespaces are supported, through nodes or through the alternative, implementation-dependent representation. This specification conforms to the XML Information Set [Infoset] must The Document Information Item [base URI] [children] [unparsed entities] [unparsed entities] Unparsed Entity Information Items Element Information Items [base URI] [children] [attributes] [in-scope namespaces] [prefix] [local name] [namespace name] [parent] Attribute Information Items [namespace name] [prefix] [local name] [normalized value] [attribute type] [owner element] Character Information Items [character code] [parent] [element content whitespace] Processing Instruction Information Items [base URI] [target] [content] [parent] Comment Information Items [content] [parent] Namespace Information Items [prefix] [namespace name] Other information items and properties made available by the Infoset processor are ignored. In addition to the properties above, the following PSVI properties are required on Element Information Items Attribute Information Items [validity] [validation attempted] [type definition] [type definition namespace] [type definition name] [type definition anonymous] [nil] [member type definition] [member type definition namespace] [member type definition name] [member type definition anonymous] [schema normalized value] XML Information Set (Second Edition) latest version Namespaces in XML 1.0 (Third Edition) et. al. latest version Namespaces in XML 1.1 (Second Edition) latest version xml:id Version 1.0 latest version XML Path Language (XPath) 3.0 latest version XQuery and XPath Functions and Operators 3.0 latest version XML Schema Part 1: Structures Second Edition latest version XML Schema Part 2: Datatypes Second Edition latest version W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures et. al. latest version W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes et. al. latest version XSLT and XQuery Serialization 3.0 latest version XQuery 1.0 and XPath 2.0 Formal Semantics (Second Edition) et. al. latest version Key words for use in RFCs to Indicate Requirement Levels Uniform Resource Identifier (URI): Generic Syntax Internationalized Resource Identifiers (IRIs) Character Model for the World Wide Web 1.0: Fundamentals et. al. latest version XML Base (Second Edition) latest version XSL Transformations (XSLT) Version 3.0 latest version XML Query Working Group XSL Working Group XQuery 3.0: An XML Query Language latest version XQuery 3.0 Requirements latest version ISO (International Organization for Standardization). Representations of dates and times, 2000-08-03. http://www.iso.org/ The following schema defines the additional types in the xs: You can retrieve the normative schema document for this namespace from http://www.w3.org/2013/01/xpath-datamodel/xpath-datatypes.xsd <?xml version='1.0'?>

<!-- This is an XML Schema document for the XML Schema namespace, http://www.w3.org/2001/XMLSchema, that has been extended to include definitions for the xs:dayTimeDuration and xs:yearMonthDuration types.

The other xs: types defined in XDM are not described here because xs:untyped and xs:anyAtomicType are special types that cannot be properly defined using XML Schema itself and because xs:untypedAtomic should not be used for validation, but only used for unvalidated elements and attributes. -->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xml:lang="en">

<xs:include schemaLocation="http://www.w3.org/2001/XMLSchema.xsd"/>

<xs:simpleType name='dayTimeDuration'> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration"/> </xs:annotation> <xs:restriction base='xs:duration'> <xs:pattern value="[^YM]*[DT].*"/> </xs:restriction> </xs:simpleType>

<xs:simpleType name='yearMonthDuration'> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration"/> </xs:annotation> <xs:restriction base='xs:duration'> <xs:pattern value="[^DT]*"/> </xs:restriction> </xs:simpleType>

</xs:schema> Namespace URI This specification uses the term Namespace URI Node There are seven kinds of Nodes document element attribute text namespace processing instruction comment absent When a property has no value, we say that it is absent atomic type An atomic type primitive simple type atomic value An atomic value atomic type character A character Char recommended XML 1.1 Second Edition document A tree whose root node is a Document Node is referred to as a document document order A document order expanded-QName An expanded-QName fragment A tree whose root node is not a Document Node is referred to as a fragment function A function called function arity A function's arity function signature A function signature function implementation defined Implementation-defined implementation dependent Implementation-dependent incompletely validated An incompletely validated [validity] instance of the data model Every instance of the data model sequence item An item node function atomic value primitive simple type There are 21 primitive simple types Section 3.2 Primitive datatypes XS2 [Schema Part 2] xs:untypedAtomic xs:anyAtomicType root node The root node sequence A sequence items stable Document order is stable string A string xs:string characters The following XML document is used to illustrate the information contained in a data model: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="dm-example.xsl"?> <catalog xmlns="http://www.example.com/catalog" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.com/catalog dm-example.xsd" xml:lang="en" version="0.1">

<!-- This example is for data model illustration only. It does not demonstrate good schema design. -->

<tshirt code="T1534017" label=" Staind : Been Awhile " xlink:href="http://example.com/0,,1655091,00.html" sizes="M L XL"> <title> Staind: Been Awhile Tee Black (1-sided) </title> <description> <html:p> Lyrics from the hit song 'It's Been Awhile' are shown in white, beneath the large 'Flock &amp; Weld' Staind logo. </html:p> </description> <price> 25.00 </price> </tshirt>

<album code="A1481344" label=" Staind : Its Been A While " formats="CD"> <title> It's Been A While </title> <description xsi:nil="true" /> <price currency="USD"> 10.99 </price> <artist> Staind </artist> </album>

</catalog> The document is associated with the URI "http://www.example.com/catalog.xml", and is valid with respect to the following XML schema: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cat="http://www.example.com/catalog" xmlns:xlink="http://www.w3.org/1999/xlink" targetNamespace="http://www.example.com/catalog" elementFormDefault="qualified">

<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />

<xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://www.cs.rpi.edu/~puninj/XGMML/xlinks-2001.xsd" />

<xs:element name="catalog"> <xs:complexType> <xs:sequence> <xs:element ref="cat:_item" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="version" type="xs:string" fixed="0.1" use="required" /> <xs:attribute ref="xml:base" /> <xs:attribute ref="xml:lang" /> </xs:complexType> </xs:element>

<xs:element name="_item" type="cat:itemType" abstract="true" />

<xs:complexType name="itemType"> <xs:sequence> <xs:element name="title" type="xs:token" /> <xs:element name="description" type="cat:description" nillable="true" /> <xs:element name="price" type="cat:price" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="label" type="xs:token" /> <xs:attribute name="code" type="xs:ID" use="required" /> <xs:attributeGroup ref="xlink:simpleLink" /> </xs:complexType>

<xs:element name="tshirt" type="cat:tshirtType" substitutionGroup="cat:_item" />

<xs:complexType name="tshirtType"> <xs:complexContent> <xs:extension base="cat:itemType"> <xs:attribute name="sizes" type="cat:clothesSizes" use="required" /> <xs:attribute ref="xml:lang" use="optional"/> </xs:extension> </xs:complexContent> </xs:complexType>

<xs:simpleType name="clothesSizes"> <xs:union memberTypes="cat:sizeList"> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="oneSize" /> </xs:restriction> </xs:simpleType> </xs:union> </xs:simpleType>

<xs:simpleType name="sizeList"> <xs:restriction> <xs:simpleType> <xs:list itemType="cat:clothesSize" /> </xs:simpleType> <xs:minLength value="1" /> </xs:restriction> </xs:simpleType>

<xs:simpleType name="clothesSize"> <xs:union memberTypes="cat:numberedSize cat:categorySize" /> </xs:simpleType>

<xs:simpleType name="numberedSize"> <xs:restriction base="xs:integer"> <xs:enumeration value="4" /> <xs:enumeration value="6" /> <xs:enumeration value="8" /> <xs:enumeration value="10" /> <xs:enumeration value="12" /> <xs:enumeration value="14" /> <xs:enumeration value="16" /> <xs:enumeration value="18" /> <xs:enumeration value="20" /> <xs:enumeration value="22" /> </xs:restriction> </xs:simpleType>

<xs:simpleType name="categorySize"> <xs:restriction base="xs:token"> <xs:enumeration value="XS" /> <xs:enumeration value="S" /> <xs:enumeration value="M" /> <xs:enumeration value="L" /> <xs:enumeration value="XL" /> <xs:enumeration value="XXL" /> </xs:restriction> </xs:simpleType>

<xs:element name="album" type="cat:albumType" substitutionGroup="cat:_item" />

<xs:complexType name="albumType"> <xs:complexContent> <xs:extension base="cat:itemType"> <xs:sequence> <xs:element name="artist" type="xs:string" /> </xs:sequence> <xs:attribute name="formats" type="cat:formatsType" use="required" /> <xs:attribute ref="xml:lang" use="optional"/> </xs:extension> </xs:complexContent> </xs:complexType>

<xs:simpleType name="formatsType"> <xs:list itemType="cat:formatType" /> </xs:simpleType>

<xs:simpleType name="formatType"> <xs:restriction base="xs:token"> <xs:enumeration value="CD" /> <xs:enumeration value="MiniDisc" /> <xs:enumeration value="tape" /> <xs:enumeration value="vinyl" /> </xs:restriction> </xs:simpleType>

<xs:complexType name="description" mixed="true"> <xs:sequence> <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="lax" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute ref="xml:lang" use="optional"/> </xs:complexType>

<xs:complexType name="price"> <xs:simpleContent> <xs:extension base="cat:monetaryAmount"> <xs:attribute name="currency" type="cat:currencyType" default="USD" /> </xs:extension> </xs:simpleContent> </xs:complexType>

<xs:simpleType name="currencyType"> <xs:restriction base="xs:token"> <xs:pattern value="[A-Z]{3}" /> </xs:restriction> </xs:simpleType>

<xs:simpleType name="monetaryAmount"> <xs:restriction base="xs:decimal"> <xs:fractionDigits value="3" /> <xs:pattern value="\d+(\.\d{2,3})?" /> </xs:restriction> </xs:simpleType>

</xs:schema> The schema is associated with the URI "http://www.example.com/dm-example.xsd". This example exposes the data model for a document that has an associated schema and has been validated successfully against it. In general, an XML Schema is not required, that is, the data model can represent a schemaless, well-formed XML document with the rules described in 2.7 Schema Information The XML document is represented by the nodes described below. The value D1 E1, E2, etc. A1, A2, etc. N1, N2, etc. P1, P2, etc. T1, T2, etc. For brevity: Text Nodes in the data model that contain only white space are not shown. Literal strings are shown in quotes without the xs:string() Literal decimals are shown without the xs:decimal() Nodes are referred to using the syntax [nodeID] xs:QNames are used with the following prefixes bindings: xs http://www.w3.org/2001/XMLSchema xsi http://www.w3.org/2001/XMLSchema-instance cat http://www.example.com/catalog xlink http://www.w3.org/1999/xlink html http://www.w3.org/1999/xhtml anon An implementation-dependent prefix associated with anonymous type names The abbreviation " \n Accessors that return the empty sequence have been omitted. To simplify the presentation, we’re assuming an implementation that does not expose the namespace axis. Therefore, Namespace Nodes are shared across multiple elements. See 6.4 Namespace Nodes // Document node D1 dm:base-uri(D1) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(D1) = "document" dm:string-value(D1) = "  Staind:  Been  Awhile  Tee  Black  (1-sided)  \n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n          25.00    It's  Been  A  While    10.99    Staind  " dm:typed-value(D1) = xs:untypedAtomic("  Staind:  Been  Awhile  Tee  Black  (1-sided)  \n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n          25.00    It's  Been  A  While    10.99    Staind  ") dm:children(D1) = ([ P1 E1 // Namespace node N1 dm:node-kind(N1) = "namespace" dm:node-name(N1) = xs:QName("", "xml") dm:string-value(N1) = "http://www.w3.org/XML/1998/namespace" dm:typed-value(N1) = "http://www.w3.org/XML/1998/namespace" // Namespace node N2 dm:node-kind(N2) = "namespace" dm:node-name(N2) = xs:QName("", "html") dm:string-value(N2) = "http://www.w3.org/1999/xhtml" dm:typed-value(N2) = "http://www.w3.org/1999/xhtml" // Namespace node N3 dm:node-kind(N3) = "namespace" dm:node-name(N3) = () dm:string-value(N3) = "http://www.example.com/catalog" dm:typed-value(N3) = "http://www.example.com/catalog" // Namespace node N4 dm:node-kind(N4) = "namespace" dm:node-name(N4) = xs:QName("", "xlink") dm:string-value(N4) = "http://www.w3.org/1999/xlink" dm:typed-value(N4) = "http://www.w3.org/1999/xlink" // Namespace node N5 dm:node-kind(N5) = "namespace" dm:node-name(N5) = xs:QName("", "xsi") dm:string-value(N5) = "http://www.w3.org/2001/XMLSchema-instance" dm:typed-value(N5) = "http://www.w3.org/2001/XMLSchema-instance" // Processing Instruction node P1 dm:base-uri(P1) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(P1) = "processing-instruction" dm:node-name(P1) = xs:QName("", "xml-stylesheet") dm:string-value(P1) = "type="text/xsl"  href="dm-example.xsl"" dm:typed-value(P1) = "type="text/xsl"  href="dm-example.xsl"" dm:parent(P1) = ([ D1 // Element node E1 dm:base-uri(E1) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(E1) = "element" dm:node-name(E1) = xs:QName("http://www.example.com/catalog", "catalog") dm:string-value(E1) = "  Staind:  Been  Awhile  Tee  Black  (1-sided)  \n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n          25.00    It's  Been  A  While    10.99    Staind  " dm:typed-value(E1) = fn:error() dm:type-name(E1) = anon:TYP000001 dm:is-id(E1) = false dm:is-idrefs(E1) = false dm:parent(E1) = ([ D1 dm:children(E1) = ([ C1 E2 E7 dm:attributes(E1) = ([ A1 A2 A3 dm:namespace-nodes(E1) = ([ N1 N2 N3 N4 N5 dm:namespace-bindings(E1) = ("xml", "http://www.w3.org/XML/1998/namespace", "html", "http://www.w3.org/1999/xhtml", "", "http://www.example.com/catalog", "xlink", "http://www.w3.org/1999/xlink", "xsi", "http://www.w3.org/2001/XMLSchema-instance") // Attribute node A1 dm:node-kind(A1) = "attribute" dm:node-name(A1) = xs:QName("http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation") dm:string-value(A1) = "http://www.example.com/catalog                                                            dm-example.xsd" dm:typed-value(A1) = (xs:anyURI("http://www.example.com/catalog"), xs:anyURI("catalog.xsd")) dm:type-name(A1) = anon:TYP000002 dm:is-id(A1) = false dm:is-idrefs(A1) = false dm:parent(A1) = ([ E1 // Attribute node A2 dm:node-kind(A2) = "attribute" dm:node-name(A2) = xs:QName("http://www.w3.org/XML/1998/namespace", "xml:lang") dm:string-value(A2) = "en" dm:typed-value(A2) = "en" dm:type-name(A2) = xs:NMTOKEN dm:is-id(A2) = false dm:is-idrefs(A2) = false dm:parent(A2) = ([ E1 // Attribute node A3 dm:node-kind(A3) = "attribute" dm:node-name(A3) = xs:QName("", "version") dm:string-value(A3) = "0.1" dm:typed-value(A3) = "0.1" dm:type-name(A3) = xs:string dm:is-id(A3) = false dm:is-idrefs(A3) = false dm:parent(A3) = ([ E1 // Comment node C1 dm:base-uri(C1) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(C1) = "comment" dm:string-value(C1) = "  This  example  is  for  data  model  illustration  only.\n          It  does  not  demonstrate  good  schema  design.  " dm:typed-value(C1) = "  This  example  is  for  data  model  illustration  only.\n          It  does  not  demonstrate  good  schema  design.  " dm:parent(C1) = ([ E1 // Element node E2 dm:base-uri(E2) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(E2) = "element" dm:node-name(E2) = xs:QName("http://www.example.com/catalog", "tshirt") dm:string-value(E2) = "  Staind:  Been  Awhile  Tee  Black  (1-sided)  \n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n          25.00  " dm:typed-value(E2) = fn:error() dm:type-name(E2) = cat:tshirtType dm:is-id(E2) = false dm:is-idrefs(E2) = false dm:parent(E2) = ([ E1 dm:children(E2) = ([ E3 E4 E6 dm:attributes(E2) = ([ A4 A5 A6 A7 dm:namespace-nodes(E2) = ([ N1 N2 N3 N4 N5 dm:namespace-bindings(E2) = ("xml", "http://www.w3.org/XML/1998/namespace", "html", "http://www.w3.org/1999/xhtml", "", "http://www.example.com/catalog", "xlink", "http://www.w3.org/1999/xlink", "xsi", "http://www.w3.org/2001/XMLSchema-instance") // Attribute node A4 dm:node-kind(A4) = "attribute" dm:node-name(A4) = xs:QName("", "code") dm:string-value(A4) = "T1534017" dm:typed-value(A4) = xs:ID("T1534017") dm:type-name(A4) = xs:ID dm:is-id(A4) = true dm:is-idrefs(A4) = false dm:parent(A4) = ([ E2 // Attribute node A5 dm:node-kind(A5) = "attribute" dm:node-name(A5) = xs:QName("", "label") dm:string-value(A5) = "Staind  :  Been  Awhile" dm:typed-value(A5) = xs:token("Staind : Been Awhile") dm:type-name(A5) = xs:token dm:is-id(A5) = false dm:is-idrefs(A5) = false dm:parent(A5) = ([ E2 // Attribute node A6 dm:node-kind(A6) = "attribute" dm:node-name(A6) = xs:QName("http://www.w3.org/1999/xlink", "xlink:href") dm:string-value(A6) = "http://example.com/0,,1655091,00.html" dm:typed-value(A6) = xs:anyURI("http://example.com/0,,1655091,00.html") dm:type-name(A6) = xs:anyURI dm:is-id(A6) = false dm:is-idrefs(A6) = false dm:parent(A6) = ([ E2 // Attribute node A7 dm:node-kind(A7) = "attribute" dm:node-name(A7) = xs:QName("", "sizes") dm:string-value(A7) = "M  L  XL" dm:typed-value(A7) = (xs:token("M"), xs:token("L"), xs:token("XL")) dm:type-name(A7) = cat:sizeList dm:is-id(A7) = false dm:is-idrefs(A7) = false dm:parent(A7) = ([ E2 // Element node E3 dm:base-uri(E3) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(E3) = "element" dm:node-name(E3) = xs:QName("http://www.example.com/catalog", "title") dm:string-value(E3) = "Staind:  Been  Awhile  Tee  Black  (1-sided)" dm:typed-value(E3) = xs:token("Staind: Been Awhile Tee Black (1-sided)") dm:type-name(E3) = xs:token dm:is-id(E3) = false dm:is-idrefs(E3) = false dm:parent(E3) = ([ E2 dm:children(E3) = ([ T1 dm:attributes(E3) = () dm:namespace-nodes(E3) = ([ N1 N2 N3 N4 N5 dm:namespace-bindings(E3) = ("xml", "http://www.w3.org/XML/1998/namespace", "html", "http://www.w3.org/1999/xhtml", "", "http://www.example.com/catalog", "xlink", "http://www.w3.org/1999/xlink", "xsi", "http://www.w3.org/2001/XMLSchema-instance") // Text node T1 dm:base-uri(T1) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(T1) = "text" dm:string-value(T1) = "Staind:  Been  Awhile  Tee  Black  (1-sided)" dm:typed-value(T1) = xs:untypedAtomic("Staind:  Been  Awhile  Tee  Black  (1-sided)") dm:type-name(T1) = xs:untypedAtomic dm:parent(T1) = ([ E3 // Element node E4 dm:base-uri(E4) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(E4) = "element" dm:node-name(E4) = xs:QName("http://www.example.com/catalog", "description") dm:string-value(E4) = "\n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n        " dm:typed-value(E4) = xs:untypedAtomic("\n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n        ") dm:type-name(E4) = cat:description dm:is-id(E4) = false dm:is-idrefs(E4) = false dm:parent(E4) = ([ E2 dm:children(E4) = ([ E5 dm:attributes(E4) = () dm:namespace-nodes(E4) = ([ N1 N2 N3 N4 N5 dm:namespace-bindings(E4) = ("xml", "http://www.w3.org/XML/1998/namespace", "html", "http://www.w3.org/1999/xhtml", "", "http://www.example.com/catalog", "xlink", "http://www.w3.org/1999/xlink", "xsi", "http://www.w3.org/2001/XMLSchema-instance") // Element node E5 dm:base-uri(E5) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(E5) = "element" dm:node-name(E5) = xs:QName("http://www.w3.org/1999/xhtml", "html:p") dm:string-value(E5) = "\n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n        " dm:typed-value(E5) = xs:untypedAtomic("\n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n        ") dm:type-name(E5) = xs:anyType dm:is-id(E5) = false dm:is-idrefs(E5) = false dm:parent(E5) = ([ E4 dm:children(E5) = ([ T2 dm:attributes(E5) = () dm:namespace-nodes(E5) = ([ N1 N2 N3 N4 N5 dm:namespace-bindings(E5) = ("xml", "http://www.w3.org/XML/1998/namespace", "html", "http://www.w3.org/1999/xhtml", "", "http://www.example.com/catalog", "xlink", "http://www.w3.org/1999/xlink", "xsi", "http://www.w3.org/2001/XMLSchema-instance") // Text node T2 dm:base-uri(T2) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(T2) = "text" dm:string-value(T2) = "\n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n        " dm:typed-value(T2) = xs:untypedAtomic("\n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n        ") dm:type-name(T2) = xs:untypedAtomic dm:parent(T2) = ([ E5 // Element node E6 dm:base-uri(E6) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(E6) = "element" dm:node-name(E6) = xs:QName("http://www.example.com/catalog", "price") dm:string-value(E6) = "25.00" // The typed-value is based on the content type of the complex type for the element dm:typed-value(E6) = cat:monetaryAmount(25.0) dm:type-name(E6) = cat:price dm:is-id(E6) = false dm:is-idrefs(E6) = false dm:parent(E6) = ([ E2 dm:children(E6) = ([ T3 dm:attributes(E6) = () dm:namespace-nodes(E6) = ([ N1 N2 N3 N4 N5 dm:namespace-bindings(E6) = ("xml", "http://www.w3.org/XML/1998/namespace", "html", "http://www.w3.org/1999/xhtml", "", "http://www.example.com/catalog", "xlink", "http://www.w3.org/1999/xlink", "xsi", "http://www.w3.org/2001/XMLSchema-instance") // Text node T3 dm:base-uri(T3) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(T3) = "text" dm:string-value(T3) = "25.00" dm:typed-value(T3) = xs:untypedAtomic("25.00") dm:type-name(T3) = xs:untypedAtomic dm:parent(T3) = ([ E6 // Element node E7 dm:base-uri(E7) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(E7) = "element" dm:node-name(E7) = xs:QName("http://www.example.com/catalog", "album") dm:string-value(E7) = "  It's  Been  A  While    10.99    Staind  " dm:typed-value(E7) = fn:error() dm:type-name(E7) = cat:albumType dm:is-id(E7) = false dm:is-idrefs(E7) = false dm:parent(E7) = ([ E1 dm:children(E7) = ([ E8 E9 E10 E11 dm:attributes(E7) = ([ A8 A9 A10 dm:namespace-nodes(E7) = ([ N1 N2 N3 N4 N5 dm:namespace-bindings(E7) = ("xml", "http://www.w3.org/XML/1998/namespace", "html", "http://www.w3.org/1999/xhtml", "", "http://www.example.com/catalog", "xlink", "http://www.w3.org/1999/xlink", "xsi", "http://www.w3.org/2001/XMLSchema-instance") // Attribute node A8 dm:node-kind(A8) = "attribute" dm:node-name(A8) = xs:QName("", "code") dm:string-value(A8) = "A1481344" dm:typed-value(A8) = xs:ID("A1481344") dm:type-name(A8) = xs:ID dm:is-id(A8) = true dm:is-idrefs(A8) = false dm:parent(A8) = ([ E7 // Attribute node A9 dm:node-kind(A9) = "attribute" dm:node-name(A9) = xs:QName("", "label") dm:string-value(A9) = "Staind  :  Its  Been  A  While" dm:typed-value(A9) = xs:token("Staind : Its Been A While") dm:type-name(A9) = xs:token dm:is-id(A9) = false dm:is-idrefs(A9) = false dm:parent(A9) = ([ E7 // Attribute node A10 dm:node-kind(A10) = "attribute" dm:node-name(A10) = xs:QName("", "formats") dm:string-value(A10) = "CD" dm:typed-value(A10) = cat:formatType("CD") dm:type-name(A10) = cat:formatType dm:is-id(A10) = false dm:is-idrefs(A10) = false dm:parent(A10) = ([ E7 // Element node E8 dm:base-uri(E8) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(E8) = "element" dm:node-name(E8) = xs:QName("http://www.example.com/catalog", "title") dm:string-value(E8) = "It's  Been  A  While" dm:typed-value(E8) = xs:token("It's Been A While") dm:type-name(E8) = xs:token dm:is-id(E8) = false dm:is-idrefs(E8) = false dm:parent(E8) = ([ E7 dm:children(E8) = ([ T4 dm:attributes(E8) = () dm:namespace-nodes(E8) = ([ N1 N2 N3 N4 N5 dm:namespace-bindings(E8) = ("xml", "http://www.w3.org/XML/1998/namespace", "html", "http://www.w3.org/1999/xhtml", "", "http://www.example.com/catalog", "xlink", "http://www.w3.org/1999/xlink", "xsi", "http://www.w3.org/2001/XMLSchema-instance") // Text node T4 dm:base-uri(T4) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(T4) = "text" dm:string-value(T4) = "It's  Been  A  While" dm:typed-value(T4) = xs:untypedAtomic("It's  Been  A  While") dm:type-name(T4) = xs:untypedAtomic dm:parent(T4) = ([ E8 // Element node E9 dm:base-uri(E9) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(E9) = "element" dm:node-name(E9) = xs:QName("http://www.example.com/catalog", "description") dm:string-value(E9) = "" // xsi:nil is true so the typed value is the empty sequence dm:typed-value(E9) = () dm:type-name(E9) = cat:description dm:is-id(E9) = false dm:is-idrefs(E9) = false dm:parent(E9) = ([ E7 dm:children(E9) = () dm:attributes(E9) = ([ A11 dm:namespace-nodes(E9) = ([ N1 N2 N3 N4 N5 dm:namespace-bindings(E9) = ("xml", "http://www.w3.org/XML/1998/namespace", "html", "http://www.w3.org/1999/xhtml", "", "http://www.example.com/catalog", "xlink", "http://www.w3.org/1999/xlink", "xsi", "http://www.w3.org/2001/XMLSchema-instance") // Attribute node A11 dm:node-kind(A11) = "attribute" dm:node-name(A11) = xs:QName("http://www.w3.org/2001/XMLSchema-instance", "xsi:nil") dm:string-value(A11) = "true" dm:typed-value(A11) = xs:boolean("true") dm:type-name(A11) = xs:boolean dm:is-id(A11) = false dm:is-idrefs(A11) = false dm:parent(A11) = ([ E9 // Element node E10 dm:base-uri(E10) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(E10) = "element" dm:node-name(E10) = xs:QName("http://www.example.com/catalog", "price") dm:string-value(E10) = "10.99" dm:typed-value(E10) = cat:monetaryAmount(10.99) dm:type-name(E10) = cat:price dm:is-id(E10) = false dm:is-idrefs(E10) = false dm:parent(E10) = ([ E7 dm:children(E10) = ([ T5 dm:attributes(E10) = ([ A12 dm:namespace-nodes(E10) = ([ N1 N2 N3 N4 N5 dm:namespace-bindings(E10) = ("xml", "http://www.w3.org/XML/1998/namespace", "html", "http://www.w3.org/1999/xhtml", "", "http://www.example.com/catalog", "xlink", "http://www.w3.org/1999/xlink", "xsi", "http://www.w3.org/2001/XMLSchema-instance") // Attribute node A12 dm:node-kind(A12) = "attribute" dm:node-name(A12) = xs:QName("", "currency") dm:string-value(A12) = "USD" dm:typed-value(A12) = cat:currencyType("USD") dm:type-name(A12) = cat:currencyType dm:is-id(A12) = false dm:is-idrefs(A12) = false dm:parent(A12) = ([ E10 // Text node T5 dm:base-uri(T5) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(T5) = "text" dm:string-value(T5) = "10.99" dm:typed-value(T5) = xs:untypedAtomic("10.99") dm:type-name(T5) = xs:untypedAtomic dm:parent(T5) = ([ E10 // Element node E11 dm:base-uri(E11) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(E11) = "element" dm:node-name(E11) = xs:QName("http://www.example.com/catalog", "artist") dm:string-value(E11) = "  Staind  " dm:typed-value(E11) = " Staind " dm:type-name(E11) = xs:string dm:is-id(E11) = false dm:is-idrefs(E11) = false dm:parent(E11) = ([ E7 dm:children(E11) = ([ T6 dm:attributes(E11) = () dm:namespace-nodes(E11) = ([ N1 N2 N3 N4 N5 dm:namespace-bindings(E11) = ("xml", "http://www.w3.org/XML/1998/namespace", "html", "http://www.w3.org/1999/xhtml", "", "http://www.example.com/catalog", "xlink", "http://www.w3.org/1999/xlink", "xsi", "http://www.w3.org/2001/XMLSchema-instance") // Text node T6 dm:base-uri(T6) = xs:anyURI("http://www.example.com/catalog.xml") dm:node-kind(T6) = "text" dm:string-value(T6) = "  Staind  " dm:typed-value(T6) = xs:untypedAtomic("  Staind  ") dm:type-name(T6) = xs:untypedAtomic dm:parent(T6) = ([ E11 A graphical representation of the data model for the preceding example is shown below. Document order in this representation can be found by following the traditional left-to-right, depth-first traversal; however, because the image has been rotated for easier presentation, this appears to be bottom-to-top, depth-first order. Graphic representation of the data model. [ large view SVG The following items are implementation-defined Support for additional user-defined or implementation-defined types is implementation-defined. (See 2.7.1 Representation of Types When converting from an xs:string xs:float xs:double 2.7.7 Negative Zero Data model construction from sources other than an Infoset or PSVI is implementation-defined. (See 3 Data Model Construction Some typed values in the data model are absent 5 Accessors The following items are implementation-dependent The relative order of Namespace Nodes nodes is stable but implementation-dependent. (See 2.4 Document Order The relative order of Attribute Nodes nodes is stable but implementation-dependent. (See 2.4 Document Order The relative order of distinct trees is stable but implementation-dependent. (See 2.4 Document Order The names of anonymous types are implementation-dependent. (See 2.7.1 Representation of Types The prefix associated with type names is implementation-dependent. (See 3.3.1.1 Element and Attribute Node Types The following changes have been made to this document since the Recommendation of 23 January 2007. The W3C Schema 1.1 dateTimeStamp datatype has been added. The function item datatype has been added to support Higher Order Functions. Function items have been renamed "functions", and have had their internal 'structure' modified slightly. This section summarizes the return values of each accessor by node type. H.1 dm: Document Nodes Returns the empty sequence Element Nodes Returns the value of the attributes Attribute Nodes Returns the empty sequence. Namespace Nodes Returns the empty sequence. Processing Instruction Nodes Returns the empty sequence. Comment Nodes Returns the empty sequence. Text Nodes Returns the empty sequence. H.2 dm: Document Nodes Returns the value of the base-uri Element Nodes Returns the value of the base-uri Attribute Nodes If the attribute has a parent, returns the value of the dm: Namespace Nodes Returns the empty sequence. Processing Instruction Nodes Returns the value of the base-uri Comment Nodes If the comment has a parent, returns the value of the dm: Text Nodes If the Text Node has a parent, returns the value of the dm: H.3 dm: Document Nodes Returns the value of the children Element Nodes Returns the value of the children Attribute Nodes Returns the empty sequence. Namespace Nodes Returns the empty sequence. Processing Instruction Nodes Returns the empty sequence. Comment Nodes Returns the empty sequence. Text Nodes Returns the empty sequence. H.4 dm: Document Nodes Returns the absolute URI of the resource from which the Document Node was constructed, or the empty sequence if no such absolute URI is available. Element Nodes Returns the empty sequence. Attribute Nodes Returns the empty sequence. Namespace Nodes Returns the empty sequence. Processing Instruction Nodes Returns the empty sequence. Comment Nodes Returns the empty sequence. Text Nodes Returns the empty sequence. H.5 dm: Document Nodes Returns the empty sequence. Element Nodes Returns the value of the is-id Attribute Nodes Returns the value of the is-id Namespace Nodes Returns the empty sequence. Processing Instruction Nodes Returns the empty sequence. Comment Nodes Returns the empty sequence. Text Nodes Returns the empty sequence. H.6 dm: Document Nodes Returns the empty sequence. Element Nodes Returns the value of the is-idrefs Attribute Nodes Returns the value of the is-idrefs Namespace Nodes Returns the empty sequence. Processing Instruction Nodes Returns the empty sequence. Comment Nodes Returns the empty sequence. Text Nodes Returns the empty sequence. H.7 dm: Document Nodes Returns the empty sequence Element Nodes Returns the value of the namespaces Attribute Nodes Returns the empty sequence. Namespace Nodes Returns the empty sequence. Processing Instruction Nodes Returns the empty sequence. Comment Nodes Returns the empty sequence. Text Nodes Returns the empty sequence. H.8 dm: Document Nodes Returns the empty sequence Element Nodes Returns the value of the nilled Attribute Nodes Returns the empty sequence. Namespace Nodes Returns the empty sequence. Processing Instruction Nodes Returns the empty sequence. Comment Nodes Returns the empty sequence. Text Nodes Returns the empty sequence. H.9 dm: Document Nodes Returns “ document Element Nodes Returns “ element Attribute Nodes Returns “ attribute Namespace Nodes Returns “ namespace Processing Instruction Nodes Returns “ processing-instruction Comment Nodes Returns “ comment Text Nodes Returns “ text H.10 dm: Document Nodes Returns the empty sequence. Element Nodes Returns the value of the node-name Attribute Nodes Returns the value of the node-name Namespace Nodes If the prefix xs:QName prefix Processing Instruction Nodes Returns an xs:QName target Comment Nodes Returns the empty sequence. Text Nodes Returns the empty sequence. H.11 dm: Document Nodes Returns the empty sequence Element Nodes Returns the value of the parent Attribute Nodes Returns the value of the parent Namespace Nodes Returns the value of the parent Processing Instruction Nodes Returns the value of the parent Comment Nodes Returns the value of the parent Text Nodes Returns the value of the parent H.12 dm: Document Nodes Returns the value of the string-value Element Nodes Returns the value of the string-value Attribute Nodes Returns the value of the string-value Namespace Nodes Returns the value of the uri Processing Instruction Nodes Returns the value of the content Comment Nodes Returns the value of the content Text Nodes Returns the value of the content H.13 dm: Document Nodes Returns the empty sequence. Element Nodes Returns the value of the schema-type Attribute Nodes Returns the value of the schema-type Namespace Nodes Returns the empty sequence. Processing Instruction Nodes Returns the empty sequence. Comment Nodes Returns the empty sequence. Text Nodes Returns xs:untypedAtomic H.14 dm: Document Nodes Returns the value of the typed-value Element Nodes Returns the value of the typed-value Attribute Nodes Returns the value of the typed-value Namespace Nodes Returns the value of the uri xs:string Processing Instruction Nodes Returns the value of the content xs:string Comment Nodes Returns the value of the content xs:string Text Nodes Returns the value of the content xs:untypedAtomic H.15 dm: Document Nodes Returns the public identifier of the specified unparsed entity or the empty sequence if no such entity exists. Element Nodes Returns the empty sequence. Attribute Nodes Returns the empty sequence. Namespace Nodes Returns the empty sequence. Processing Instruction Nodes Returns the empty sequence. Comment Nodes Returns the empty sequence. Text Nodes Returns the empty sequence. H.16 dm: Document Nodes Returns the system identifier of the specified unparsed entity or the empty sequence if no such entity exists. Element Nodes Returns the empty sequence. Attribute Nodes Returns the empty sequence. Namespace Nodes Returns the empty sequence. Processing Instruction Nodes Returns the empty sequence. Comment Nodes Returns the empty sequence. Text Nodes Returns the empty sequence. This section summarizes data model construction from an Infoset for each kind of information item. General notes occur elsewhere The document information item document information item The following infoset properties are required: [children] [base URI] The following infoset properties are optional: [unparsed entities] Document Node properties are derived from the infoset as follows: base-uri The value of the [base URI] base-uri In practice a [base URI] base-uri children The sequence of nodes constructed from the information items found in the [children] For each element, processing instruction, and comment found in the [children] children If present among the [children] document type declaration information item unparsed-entities If the [unparsed entities] unparsed entity information items dm: dm: The internal structure of the values of the unparsed-entities string-value The concatenation of the string-values of all its Text Node descendants in document order. If the document has no such descendants, the zero-length string. typed-value The dm: xs:untypedAtomic document-uri The document-uri fn:collection document-uri base-uri If the document-uri fn:doc() document-uri document-uri In other words, for any Document Node $arg fn:document-uri($arg) fn:doc(fn:document-uri($arg)) $arg The element information items element information item The following infoset properties are required: [namespace name] [local name] [children] [attributes] [in-scope namespaces] [base URI] [parent] Element Node properties are derived from the infoset as follows: base-uri The value of the [base URI] base-uri In practice a [base URI] base-uri node-name An xs:QName [prefix] [local name] [namespace name] parent The node that corresponds to the value of the [parent] schema-type All Element Nodes constructed from an infoset have the type xs:untyped children The sequence of nodes constructed from the information items found in the [children] For each element, processing instruction, comment, and maximal sequence of adjacent character information items [children] children Because the data model requires that all general entities be expanded, there will never be unexpanded entity reference information item attributes A set of Attribute Nodes constructed from the attribute information items [attributes] xml:lang xml:space xsi:type Default and fixed attributes provided by the DTD are added to the [attributes] attributes namespaces A set of Namespace Nodes constructed from the namespace information items [in-scope namespaces] Implementations may namespace information items It appears in the expanded QName node-name It appears in the expanded QName node-name Note: applications may rely on namespaces that are not known to be used, for example when QNames are used in content and that content does not have a type of xs:QName nilled All Element Nodes constructed from an infoset have a nilled false string-value The string-value character information item [children] character information items 6.7.3 Construction from an Infoset 6.7 Text Nodes This process is equivalent to concatenating the dm: If the element has no such descendants, the string-value typed-value The string-value xs:untypedAtomic is-id All Element Nodes constructed from an infoset have a is-id false is-idrefs All Element Nodes constructed from an infoset have a is-idrefs false The attribute information items attribute information item The following infoset properties are required: [namespace name] [local name] [normalized value] [attribute type] [owner element] Attribute Node properties are derived from the infoset as follows: node-name An xs:QName [prefix] [local name] [namespace name] parent The Element Node that corresponds to the value of the [owner element] schema-type The value xs:untypedAtomic string-value The [normalized value] typed-value The attribute’s typed-value is its dm: xs:untypedAtomic is-id If the attribute is named xml:id [attribute type] ID [xml:id] ID may is-id true xml:id If the [attribute type] ID true false is-idrefs If the [attribute type] IDREF IDREFS true false The namespace information items The following infoset properties are required: [prefix] [namespace name] Namespace Node properties are derived from the infoset as follows: prefix The [prefix] uri The [namespace name] parent The element in whose [in-scope namespaces] namespace information item dm: A Processing Instruction Node is constructed for each processing instruction information item The following infoset properties are required: [target] [content] [base URI] [parent] Processing Instruction Node properties are derived from the infoset as follows: target The value of the [target] content The value of the [content] base-uri The value of the [base URI] base-uri In practice a [base URI] base-uri parent The node corresponding to the value of the [parent] There are no Processing Instruction Nodes for processing instructions that are children of a document type declaration information item The comment information items A Comment Node is constructed for each comment information item The following infoset properties are required: [content] [parent] Comment Node properties are derived from the infoset as follows: content The value of the [content] parent The node corresponding to the value of the [parent] There are no Comment Nodes for comments that are children of a document type declaration information item The character information items character information items The following infoset properties are required: [character code] [parent] The following infoset properties are optional: [element content whitespace] A sequence of character information items All of the information items in the sequence have the same parent. The sequence consists of adjacent character information items No other such sequence exists that contains any of the same character information items Text Node properties are derived from the infoset as follows: content A string comprised of characters that correspond to the [character code] character information items If the resulting Text Node consists entirely of whitespace and the [element content whitespace] character information items true content The content of the Text Node is not necessarily normalized as described in the [Character Model] parent The node corresponding to the value of the [parent] This section summarizes data model construction from a PSVI for each kind of information item. General notes occur elsewhere Construction from a PSVI is identical to construction from the Infoset. The following Element Node properties are affected by PSVI properties. schema-type The schema-type 3.3.1.1 Element and Attribute Node Types children The sequence of nodes constructed from the information items found in the [children] For each element, processing instruction, comment, and maximal sequence of adjacent character information items [children] children For elements with schema simple types, or complex types with simple content, if the [schema normalized value] may processing instruction comment information items [children] [schema normalized value] children [schema normalized value] must not must The relative order of Processing Instruction and Comment Nodes must be preserved, but the position of the Text Node, if it is present, among them is implementation defined. The effect of the above rules is that where a fixed or default value for an element is defined in the schema, and the element takes this default value, a text node will be created to contain the value, even though there are no character information items representing the value in the PSVI. The position of this text node relative to any comment or processing instruction children is implementation-dependent. [Schema Part 1] may Because the data model requires that all general entities be expanded, there will never be unexpanded entity reference information item attributes A set of Attribute Nodes constructed from the attribute information items [attributes] xml:lang xml:space xsi:type Default and fixed attributes provided by XML Schema processing are added to the [attributes] attributes namespaces A set of Namespace Nodes constructed from the namespace information items [in-scope namespaces] Implementations may namespace information items It appears in the expanded QName node-name It appears in the expanded QName node-name It appears in the expanded QName xs:QName Note: applications may rely on namespaces that are not known to be used, for example when QNames are used in content and that content does not have a type of xs:QName nilled If the [validity] valid [nil] nilled true nilled false string-value The string-value is calculated as follows: If the element is empty: its string value is the zero length string. If the element has a type of xs:untyped string-value If the element has a simple type or a complex type with simple content: its string-value is the [schema normalized value] If an implementation stores only the typed value of an element, it may use any valid lexical representation of the typed value for the string-value typed-value The typed-value is calculated as follows: If the element is of type xs:untyped dm: xs:untypedAtomic If the element has a complex type with empty content, its typed-value is the empty sequence. If the element has a simple type or a complex type with simple content: its typed value is computed as described in 3.3.1.2 Typed Value Determination Note that in the case of dates and times, the timezone is preserved as described in 3.3.2 Dates and Times xs:QName xs:NOTATION 3.3.3 QNames and NOTATIONS If the element has a complex type with mixed content (including xs:anyType dm: xs:untypedAtomic Otherwise, the element must be a complex type with element-only content. The typed-value of such an element is absent dm: is-id If the element has a complex type with element-only content, the is-id false xs:ID xs:ID is-id true false Note: This means that in the case of a type constructed by list from xs:ID xs:ID xs:ID Note: The element that is marked with the is-id xs:ID is-idrefs If the element has a complex type with element-only content, the is-idrefs false xs:IDREF xs:IDREFS is-idrefs true false All other properties have values that are consistent with construction from an infoset. The following Attribute Node properties are affected by PSVI properties. string-value The [schema normalized value] Otherwise, the [normalized value] If an implementation stores only the typed value of an attribute, it may use any valid lexical representation of the typed value for the string-value schema-type The schema-type 3.3.1.1 Element and Attribute Node Types typed-value The typed-value is calculated as follows: If the attribute is of type xs:untypedAtomic dm: xs:untypedAtomic Otherwise, a sequence of zero or more atomic values as described in 3.3.1.2 Typed Value Determination is-id If the attribute is named xml:id [attribute type] xs:ID xs:ID [xml:id] xs:ID may is-id xml:id Otherwise, if the typed-value of the attribute consists of exactly one atomic value and that value is of type xs:ID xs:ID is-id true false Note: This means that in the case of a type constructed by list from xs:ID xs:ID xs:ID is-idrefs If any of the atomic values in the typed-value of the attribute is of type xs:IDREF xs:IDREFS is-idrefs true false Note: This rule means that a type constructed by list with an item type of xs:IDREF xs:IDREF is-idrefs xs:IDREFS xs:IDREFS is-idrefs xs:IDREF All other properties have values that are consistent with construction from an infoset. Note: attributes from the XML Schema instance namespace, " http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation xsi:type Construction from a PSVI is identical to construction from the Infoset. Construction from a PSVI is identical to construction from the Infoset. Construction from a PSVI is identical to construction from the Infoset. For Text Nodes constructed from the [schema normalized value] content [schema normalized value] Otherwise, construction from a PSVI is the same as construction from the Infoset except for the content content [element content whitespace] character information items mixed content Text Nodes are only allowed to be empty if they have no parents; an empty Text Node will be discarded when its parent is constructed, if it has a parent. This section summarizes the infoset mapping for each kind of node. General notes occur elsewhere A Document Node maps to a document information item The following properties are specified by this mapping: [children] A list of information items obtained by processing each of the dm: [document element] The element information item [children] [unparsed entities] An unordered set of unparsed entity information item unparsed-entities Each unparsed entity maps to an unparsed entity information item [name] The name of the entity. [system identifier] The system identifier of the entity. [public identifier] The public identifier of the entity. [declaration base URI] Implementation defined. In many cases, the document-uri must [declaration base URI] The following properties of the unparsed entity information item [notation name] [notation] The following properties of the document information item [notations] [character encoding scheme] [standalone] [version] [all declarations processed] An Element Node maps to an element information item The following properties are specified by this mapping: [namespace name] The namespace name of the value of dm: [local name] The local part of the value of dm: [prefix] The prefix associated with the value of dm: [children] A list of information items obtained by processing each of the dm: [attributes] An unordered set of information items obtained by processing each of the dm: [in-scope namespaces] An unordered set of namespace information items namespaces Each in-scope namespace maps to a namespace information item [prefix] The prefix associated with the namespace. [namespace name] The URI associated with the namespace. [base URI] The value of dm: [parent] If this node is the root of the infoset mapping operation, unknown If this node has a parent, the information item that corresponds to the node returned by dm: Otherwise no value The following property has no value: [namespace attributes] An Attribute Node maps to an attribute information item The following properties are specified by this mapping: [namespace name] The namespace name of the value of dm: [local name] The local part of the value of dm: [prefix] The prefix associated with the value of dm: [normalized value] The value of dm: [owner element] If this node has a parent, the information item that corresponds to the node returned by dm: Otherwise no value The following properties have no value: [specified] [attribute type] [references] A Namespace Node maps to a namespace information item The following properties are specified by this mapping: [prefix] The prefix associated with the namespace. [namespace name] The value of dm: An Processing Instruction Node maps to a processing instruction information item The following properties are specified by this mapping: [target] The local part of the value of dm: [content] The value of dm: [base URI] The value of dm: [parent] If this node is the root of the infoset mapping operation, unknown If this node has a parent, the information item that corresponds to the node returned by dm: Otherwise no value [notation] no value A Comment Node maps to a comment information item The following properties are specified by this mapping: [content] The value of the dm: [parent] If this node is the root of the infoset mapping operation, unknown If this node has a parent, the information item that corresponds to the node returned by dm: Otherwise no value A Text Node maps to a sequence of character information items Each character of the dm: character information item [character code] The Unicode code point value of the character. [parent] If this node is the root of the infoset mapping operation, unknown If this node has a parent, the information item that corresponds to the node returned by dm: Otherwise no value [element content whitespace] Unknown This sequence of characters constitutes the infoset mapping.

Related documents

Record · ID 153179 · SHA-256 5fe63f7fa81c7dff
Conceptio Open Knowledge Archive — every document is proof-bundled with source, license, and retrieval metadata.