XQuery と XPath のデータモデル( XDM )仕様(第2版) + バージョン 3.0 仕様 日本語訳 統合版

この文書は、W3C が作成し、 Recommendation (勧告)として公開されている XQuery 1.0 and XPath 2.0 Data Model (XDM) (Second Edition) を日本語に翻訳したものであり、 Working Draft (2011/12/13 - 草案)として公開されている次バージョンの XQuery and XPath Data Model 3.0 の翻訳を追加したものです(草案の方のバージョンが旧 1.1 からいきなり 3.0 になっているのは他の関連仕様とバージョン番号の足並みを揃えてわかり易くするためのようです)。 下の「バージョン表示」スイッチを切り替えると表示される内容のバージョンも切り替わります。

更新日: 2012-02-13

表示切替

W3C

XQuery 1.0 と XPath 2.0 のデータモデル (XDM) (第2版) XQuery と XPath のデータモデル 3.0

2010年12月14日付 W3C 勧告 2011年12月13日付 W3C 草案


要約

この文書は [XML Path 言語 (XPath) 2.0 (第2版)], [XSL 2.0 (第2版)], [XQuery] の、および、それらを参照する他の仕様のデータモデル: W3C XQuery 1.0 と XPath 2.0 のデータモデル (XDM) を定めます。 このデータモデルは [XPath 1.0] データモデルと早期の [XML Query データモデル] の成果に基づきます。 この文書は [XSL Working Group][XML Query Working Group] による協同成果です。 This document defines the W3C XQuery 1.0 and XPath 2.0 Data Model (XDM), which is the data model of [XML Path Language (XPath) 2.0 (Second Edition)], [XSLT 2.0 (Second Edition)], and [XQuery], and any other specifications that reference it. This data model is based on the [XPath 1.0] data model and earlier work on an [XML Query Data Model]. This document is the result of joint work by the [XSL Working Group] and the [XML Query Working Group].

この文書は [XML Path 言語 (XPath) 3.0], [XSL 変換 (XSLT) 3.0], [XQuery 3.0: XML Query 言語] の、および、それらを参照する他の仕様のデータモデル: XQuery と XPath 3.0 のデータモデル 3.0 を定めます。 この文書は [XSL Working Group][XML Query Working Group] による協同成果です。 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], and [XQuery 3.0: An XML Query Language], and any other specifications that reference it. This document is the result of joint work by the [XSL Working Group] and the [XML Query Working Group].

この文書の位置付け

目次

付録


1 概要

この文書は [XML Path 言語 (XPath) 2.0 (第2版)], [XSL 2.0 (第2版)], [XQuery]データモデルXQuery 1.0 と XPath 2.0 のデータモデル を定義する。 This document defines the XQuery 1.0 and XPath 2.0 Data Model, which is the data model of [XML Path Language (XPath) 2.0 (Second Edition)], [XSLT 2.0 (Second Edition)] and [XQuery]

この文書は [XML Path 言語 (XPath) 3.0], [XSL 変換 (XSLT) 3.0], [XQuery 3.0: XML Query 言語]データモデルXQuery と XPath のデータモデル 3.0 を定義する。 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], and [XQuery 3.0: An XML Query Language].

XQuery 1.0 と XPath 2.0 のデータモデル XQuery と XPath のデータモデル 3.0 (以下「データモデル」)には2つの目的がある。 第一に、 XSLT や XQuery プロセッサへの入力に含まれる情報を定義すること。 第二に、 XSLT, XQuery, XPath 言語の式の値として許容されるすべての値を定義すること。 言語内のすべての式の値がデータモデルに含まれることが保証されるとき、言語はデータモデルに対し閉じているという。 XSLT 2.0, XQuery 1.0, XPath 2.0 XSLT 3.0, XQuery 3.0, XPath 3.0 はいずれもこのデータモデルに対し、閉じている。 The XQuery 1.0 and XPath 2.0 Data Model 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 with respect to a data model if the value of every expression in the language is guaranteed to be in the data model. XSLT 2.0, XQuery 1.0 and XPath 2.0 XSLT 3.0, XQuery 3.0 and XPath 3.0 are all closed with respect to the data model.

データモデルは [Infoset]) (以下「情報セット」)に基づくものであるが、 [XPath 2.0 Requirements][XML Query Requirements] [XQuery 3.0 Requirements] を満たすため、次に挙げる新たな機能も要求される: The data model is based on the [Infoset] (henceforth "Infoset"), but it requires the following new features to meet the [XPath 2.0 Requirements] and [XML Query Requirements] [XQuery 3.0 Requirements] :

情報セットと同様、 XQuery 1.0 と XPath 2.0 のデータモデル XQuery と XPath のデータモデル 3.0 は文書内のどの情報がアクセス可能かを指定するが、データアクセスに利用されるプログラミング言語のインターフェースやバインディングは指定しない。 As with the Infoset, the XQuery 1.0 and XPath 2.0 Data Model 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.

この仕様は XQuery 1.0 と XPath 2.0 のデータモデル XQuery と XPath のデータモデル 3.0 におけるノードのプロパティに対し、それらがどのようにアクセスされ, どのように情報セットと PSVI の内部の値に関連付けられるか, についての正確な定義を与える。 This document provides a precise definition of the properties of nodes in the XQuery 1.0 and XPath 2.0 Data Model XQuery and XPath Data Model 3.0 , how they are accessed, and how they relate to values in the Infoset and PSVI.

2 概念

この節では、この仕様を通して用いられる一般概念について大まかに述べる。 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.

2.1 語法と用語

用語の完全な索引は D 索引 を見よ。 For a full glossary of terms, see D Glossary.

この仕様において、 〜しなければならない, 〜してはならない, 〜すべきである, 〜すべきでない, 〜してもよい, 推奨される 等の言い回しは、それぞれ順に [RFC 2119] で定められる must, must not, should, should not, may, recommended の意味に解釈するものとする。 In this specification the words must, must not, should, should not, may and recommended are to be interpreted as described in [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: Every instance of the data model is a sequence.].

[定義: シーケンスとは、0個以上の順序付けられた の集まりである。 ]
シーケンスはシーケンスのメンバにはなり得ない。 1個の項それ自体は、1個の項からなるシーケンスとしてモデル化される。 シーケンスは 2.5 シーケンス にて定義される。 [Definition: A sequence is an ordered collection of zero or more items.] A sequence cannot be a member of a sequence. A single item appearing on its own is modeled as a sequence containing one item. Sequences are defined in 2.5 Sequences.

[定義: とは、 ノード または関数 または 原子値 である。 ] [Definition: An item is either a node , function, or an atomic value],

特定のプロパティがデータモデルにおいて値を持たないかどうか、区別する必要が生じることがある。 標準的な例としては、どの名前空間にも属さない 展開-QName の名前空間 URI プロパティがある。 その種のプロパティでは「値を持たない状態」もとり得るようにすると便利になる。
[定義: 値が存在しない( absent )とは、プロパティが値を持たないことを指す。] 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 that is not in any namespace. For such properties, it is convenient to be able to speak of "the state of having no value". [Definition: When a property has no value, we say that it is absent.]

どのノードも 6 ノード で定義される7種のノードのいずれかになる。 ノードはツリーを形成する。 各ノードは高々 1 個の親ノード( dm:parent アクセサを通して辿り着ける)を持ち、 dm:children, dm:attributes, dm:namespace-nodes アクセサを通して直接的または間接的に辿り着ける, 子孫ノードを持つ。
[定義: ツリーの最上位の, 親を持たないノードをルートノードと呼ぶ。 ]
どのツリーもきっかり 1 個のルートノードを持ち, 他のすべてのノードはきっかり 1 個のルートノードから辿り着ける。
Every node is one of the seven kinds of nodes defined in 6 Nodes. Nodes form a tree. Each node has at most one parent (reachable via the dm:parent accessor) and descendant nodes that are reachable directly or indirectly via the dm:children, dm:attributes, and dm:namespace-nodes accessors. [Definition: The root node is the topmost node of a tree, the node with no parent.] Every tree has exactly one root node and every other node can be reached from exactly one root node. The topmost node of a tree is called the root node.

注記: 従って “ルートノード” ルートノード は、ノードの種類を含蓄するものではなく、単にノードのツリー内での位置に基づく呼称である。 XPath 1.0 のデータモデルにおいてはルートノードはノードの1種とされていた。 Note: Thus the “root node” root node 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.

どのノードも 6 ノード で定義される7種のノードのいずれかになる。 ノードのツリーは、ルートノードおよび, ルートノードから(直接的か間接的かを問わず) dm:children, dm:attributes, dm:namespace-nodes アクセサを通して辿り着けるすべてのノードにより, 構成される。 どのノードもきっかり1個のツリーに属し、どのツリーもきっかり1個のルートノードを持つ。 Every node is one of the seven kinds of nodes defined in 6 Nodes. Nodes form a tree that consists of a root node plus all the nodes that are reachable directly or indirectly from the root node via the dm:children, dm:attributes, and dm:namespace-nodes accessors. Every node belongs to exactly one tree, and every tree has exactly one root node.

[定義: ルートノードが 文書ノード になるツリーを 文書 と呼ぶ。 ] [Definition: A tree whose root node is a Document Node is referred to as a document.]

[定義: ルートノードが 文書ノード ではないツリーを 素片と呼ぶ。 ] [Definition: A tree whose root node is not a Document Node is referred to as a fragment.]

[定義: 原子値とは、 原子型 値空間に属する値であって、その原子型の名前が付与されたものとする。 ] [Definition: An atomic value is a value in the value space of an atomic type and is labeled with the name of that atomic type.]

[定義: 原子型 とは、 原始単純型 であるか、または他の原子型に制限を加えることにより派生する型とする。 ]
(リストや共用体による派生型は原子型ではない。) [Definition: An atomic type is a primitive simple type or a type derived by restriction from another atomic type.] (Types derived by list or union are not atomic.)

[定義: 原始単純型 には、 [Schema Part 2]Section 3.2 Primitive datatypes XS2 で定義される 19 種と 2.6 型 2.7 Schema 情報 で定義される xs:untypedAtomic, xs:anyAtomicType の、計 21 種がある。 ] [Definition: There are 2321 primitive simple types: the 19 defined in Section 3.2 Primitive datatypesXS2 of [Schema Part 2] and xs:untyped, xs:untypedAtomic, xs:anyAtomicType, xs:dayTimeDuration, and xs:yearMonthDuration], defined in 2.7 Schema Information2.6 Types.

データモデルにおいて、型は 展開-QName で表現される。 A type is represented in the data model by an expanded-QName.

[定義: 展開-QName とは、接頭辞(空もとり得る), 名前空間 URI (空もとり得る), 局所名, からなる、 3 個の値の組である。 ]
3.3.3 QName と NOTATION を見よ。 [Definition: An expanded-QName is a set of three values consisting of a possibly empty prefix, a possibly empty namespace URI, and a local name.] See 3.3.3 QNames and NOTATIONS.

[定義: 実装定義とは、実装によって異なり得るが、個々の実装においては指定されなければならないふるまいを表すものとする。 ] [Definition: Implementation-defined indicates an aspect that may differ between implementations, but must be specified by the implementor for each particular implementation.]

[定義: 実装依存とは、実装によって異なり得るものであり、この仕様や W3C のどの仕様でも指定されず、どの実装にも指定が要求されていないふるまいを表すものとする。 ] [Definition: Implementation-dependent indicates an aspect that may differ between implementations, is not specified by this or any W3C specification, and is not required to be specified by the implementor for any particular implementation.]

[定義: 一定の状況において、値は未定義と称される(例えば、要素ノードの型付き値)。 この語が意味する所は、当該のプロパティが値を持たず、その値のいかなる利用もエラーを生じさせることを意味する。 ] [Definition] In certain situations a value is said to be undefined (for example, the typed value of an element node). This term indicates that the property in question has no value and that any attempt to use its value results in an error.

この仕様の URI は、 [RFC 3986] で定義され、 [RFC 3987] で新たな名称 IRI として拡張された、統一リソース識別子を指す。 ここでは「基底 URI」など、 XML 関連の仕様全体に渡り定義または参照されている概念に新たな用語を持ち込むことを避けるため、 IRI でなくこの語 URI をそのまま用いることにする。 Within this specification, the term URI refers to a Universal Resource Identifier as defined in [RFC 3986] and extended in [RFC 2987] with the new name IRI. The term URI has been retained in preference to IRI to avoid introducing new names for concepts such as “Base URI” that are defined or referenced across the whole family of XML specifications.

この仕様でふるまいを実装定義または実装依存として実装に委ねているどの部分においても、実装側には、利用者がふるまいを変更できるようにする仕組みを提供する選択権がある。 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.

2.2 記法

以上の注釈に加え、この仕様では、データモデルを説明するためのアクセサ関数のセットを定義する。 これらのアクセサには接頭辞 dm: が付与されている。 この接頭辞はこれらの関数が抽象的なものであることを強調するため、常に斜字体で示される。 これらはデータモデルとデータモデルに基づく仕様との間のインターフェースを説明するためのものであり、ホスト言語から直接アクセスされるものではない。 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:. This prefix is always shown in italics to emphasize that these functions are abstract; they exist to explain the interface between the data model and specifications that rely on the data model: they are not accessible directly from the host language.

記法を簡便にするため、この文書を通していくつかの接頭辞が用いられる。 次の束縛があるものとする: Several prefixes are used throughout this document for notational convenience. The following bindings are assumed.

  1. xs:http://www.w3.org/2001/XMLSchema に束縛されている。 xs: bound to http://www.w3.org/2001/XMLSchema

  2. xsi:http://www.w3.org/2001/XMLSchema-instance に束縛されている。 xsi: bound to http://www.w3.org/2001/XMLSchema-instance

  3. fn:http://www.w3.org/2005/xpath-functions に束縛されている。 fn: bound to http://www.w3.org/2005/xpath-functions

実施上は、適切に URI に束縛されてさえいればどんな接頭辞が用いられていてもよい。 In practice, any prefix that is bound to the appropriate URI may be used.

アクセサ関数は Section 1.4 Function Signatures and Descriptions FO で述べられる [XQuery 1.0 と XPath 2.0 の関数と演算子(第2版)] と同じスタイルを用いて表記される。 The signature of accessor functions is shown using the same style as [XQuery 1.0 and XPath 2.0 Functions and Operators (Second Edition)], described in Section 1.4 Function Signatures and DescriptionsFO.

アクセサ関数は Section 1.4 Function Signatures and Descriptions FO30 で述べられる [XQuery と XPath の関数と演算子 3.0] と同じスタイルを用いて表記される。 The signature of accessor functions is shown using the same style as [XQuery and XPath Functions and Operators 3.0], described in Section 1.4 Function Signatures and DescriptionsFO30.

この文書は [Infoset]Post-Schema-Validation Infoset ( PSVI - スキーマ検証後の情報セット)に依拠する。 (情報セットの)情報項目とプロパティはそれぞれ、 〜情報項目 ,("[", "]" で括られた) [情報セットプロパティ] の形式で示される。 This document relies on the [Infoset] and Post-Schema-Validation Infoset (PSVI). Information items and properties are indicated by the styles information item and [infoset property], respectively.

型の割り当てのある部分はスキーマを構成するプロパティへのアクセス能力に依存する。 その種のプロパティは("{", "}" で括られた) { コンポーネントのプロパティ } のスタイルで示される。 このことは、軽量スキーマプロセッサが利用できない事を意味するものではなく、アプリケーションが必要なプロパティへアクセスする何らかの仕組みを持たなければならないことを意味しているに過ぎないことに注意。 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.

2.3 ノードの一意性

各ノードは一意的な識別子を持つ。 データモデルのインスタンスに含まれるどの ノード も一意的である: 自身と同一であり、他のノードと同一ではない。( 原子値 は識別子を持たない: 整数としての値 “5” のどのインスタンスも他のすべての整数としての値 “5” のインスタンスと同一である。) Each node has a unique identity. Every node in an instance of the data model is unique: identical to itself, and not identical to any other node. (Atomic values do not have identity; every instance of the value “5” as an integer is identical to every other instance of the value “5” as an integer.)

注記: ノードの同一性の概念を一意 ID の概念と混同すべきではない。 一意 ID は文書作成者により ID/IDREF の相互関係を利用して参照を表現するために要素にあてがわれる一意的な名前である。 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.

2.4 文書順

[定義: 文書順 とは、与えられたクエリや変換の処理中にアクセス可能なすべてのノード間で定義される順序である。文書順は全順序である。ただし、一部のノード間の相対順序は実装依存になる。直感的には、文書順とは直列化された XML 文書においてノードが現れる順番になる。 ]
[定義: 文書順が安定であるとは、この順序が実装依存であるとしても、任意の2つのノード間の相対順序が、与えられたクエリや変換の処理中に変化しないことを意味するものとする。 ] [Definition: A document order is defined among all the nodes accessible during a given query or transformation. Document order is a total ordering, although the relative order of some nodes is implementation-dependent. Informally, document order is the order in which nodes appear in the XML serialization of a document.] [Definition: Document order is stable, which means that the relative order of two nodes will not change during the processing of a given query or transformation, even if this order is implementation-dependent.]

ツリー内の文書順は次の制約を満たす: Within a tree, document order satisfies the following constraints:

  1. 最初のノードはルートノード。 The root node is the first node.

  2. どのノードも、そのすべての子および子孫より先に現れる。 Every node occurs before all of its children and descendants.

  3. 名前空間ノード は結びつけられている 要素ノード の直後に続く。 名前空間ノード 間の相対順序は安定であるが実装依存になる。 Namespace Nodes immediately follow the Element Node with which they are associated. The relative order of Namespace Nodes is stable but implementation-dependent.

  4. 属性ノードは結びつけられている 要素ノード に結びつけられている 名前空間ノード の直後に続く(要素に結びつけられている 名前空間ノード が存在しない場合は要素の直後に続く)。 属性ノード 間の相対順序は安定であるが実装依存である。 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.

  5. 同胞ノード間の相対順序は、それらの親ノードの children プロパティに現れる順序である。 The relative order of siblings is the order in which they occur in the children property of their parent node.

  6. 子と子孫は後続の同胞ノードより先に現れる Children and descendants occur before following siblings.

異なるツリーに属するノードの相対順序は安定であるが、次の制約を満たす形で実装依存になる: ツリー T1 のノードが別のツリー T2 のノードより先に現れるならば、T1 のすべてのノードは T2 のすべてのノードより先に現れる。 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, occurs before any node in a different tree, T2, then all nodes in T1 are before all nodes in T2.

2.5 シーケンス

データモデルの重要な特徴の一つは、項(1個のノードまたは関数または原子値)とその項1個からなる単( singleton )シーケンスが区別されないことである。 項はそれを含む単シーケンスと同値である。 An important characteristic of the data model is that there is no distinction between an item (a node, function, or an 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 nodes, atomic values, or 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.

シーケンスが他のシーケンスを含む事はない。シーケンスが連結されても結果は「平坦化」される。 “(d e)” を “(a b c)” に追加した結果は長さ 5 のシーケンス: “(a b c d e)” になる。 長さ 4 のシーケンス: “(a b c (d e))”のような入れ子のシーケンスは決して生じない 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 produce a sequence of length 4: “(a b c (d e))”, such a nested sequence never occurs.

注記: シーケンスは XPath 1.0 のノード集合を置き換えるものになる。 XPath 1.0 におけるノード集合は項を重複して含まない。 この XPath 2.0 によるノード集合のシーケンスへの一般化においては、重複の排除はノードシーケンスを扱う関数が提供する。 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 2.0, duplicate removal is provided by functions on node sequences.

2.6 名前空間名

[XML 名前空間] 仕様と [XML 1.1 名前空間] 仕様により、名前空間名( namespace name )の概念が導入された。 [XML 名前空間] においては名前空間名は URI であることが要求されており、 [XML 1.1 名前空間] においては名前空間名は IRI であることが要求されているが、いずれにせよ、プロセッサには、文書のインスタンスに現れる名前空間名が実際に有効な URI または IRI になっているかどうか調べることは要求されていない。 The specifications [Namespaces in XML] and [Namespaces in XML 1.1] introduce the concept of a namespace name. In [Namespaces in XML] a namespace name is required to be a URI; in [Namespaces in XML 1.1] it is required to be an IRI; but both specifications explicitly do not require a processor to check that namespace names appearing in an instance document are in fact valid URIs or IRIs.

[定義: この仕様における語、名前空間 URI( Namespace URI )は、その URI または IRI が有効なものかどうかに関わらず、名前空間名を指すものとする。 ]
このデータモデルを実装するプロセッサは [XML 名前空間][XML 1.1 名前空間], に従って、( [XML 名前空間], [XML 1.1 名前空間] のいずれをサポートするかに依存して)名前空間名が無効な URI または IRI であった場合にエラーを送出してもよいが、実際に無効かどうか調べることは要求されない。 名前空間名における相対参照の利用は廃止予定にあり、無意味なものとして定義されるが、エラーではないことに注意。 名前空間名はどのような形であれ、文字列として扱われ、それが現れる文脈において適切な場合には(例えば属性値の中)空白の正規化のみを施した上で、各文字の符号点( codepoint )ごとの比較により同一性が比較される。 [Definition: This specification uses the term Namespace URI to refer to a namespace name, whether or not it is a valid URI or IRI]. Following the lead of [Namespaces in XML] and [Namespaces in XML 1.1], processors implementing this data model may raise an error if a namespace name is not a valid URI or IRI (depending on whether they support [Namespaces in XML] or [Namespaces in XML 1.1]), but they are not required to make any checks. Note that the use of a relative reference as a namespace name is deprecated and is defined to be meaningless, but it is not an error. Namespace names, whatever form they take, are treated as character strings and compared for equality using codepoint-by-codepoint comparison, subject only to whitespace normalization if they appear in a context (for example, within an attribute value) where this is appropriate.

一部のインターフェースでは名前空間名は型 xs:anyURI の値として保持される。 例えば、展開-QName の名前空間成分は型 xs:anyURI の値をとるものと定義されている。 [Schema Part 2] においては、型 xs:anyURI の値空間にある程度の制約が課せられているが、より厳密な制約の決定は実装側に委ねられている。 [Schema 1.1 Part 2] においては、 xs:anyURI の値の形式に課せられる制約は存在しないので、任意の文字の羅列が値空間に許容される。 この仕様と関連する仕様においては、名前空間名の保持に型 xs:anyURI を利用する際に、その値空間にこの節で述べられる以上の制約は課せられない: 実装は、無効な URI または IRI になる文字列を拒絶してもよいが、そうすることを要求されてはいない In some interfaces, namespace names are held as values of type xs:anyURI. For example, the namespace part of an expanded QName is defined to be a value of type xs:anyURI. In [Schema Part 2], the type xs:anyURI imposes some restrictions on the value space, but there is latitude for implementors to decide exactly what these restrictions are. In [Schema 1.1 Part 2] there are no restrictions on the form of an xs:anyURI value, so any sequence of characters is acceptable within the value space. In this and related specifications, the use of the type xs:anyURI to hold a namespace name does not imply any restrictions on the value space beyond those described in this section: implementations may reject character strings that are not valid URIs or IRIs, but they are not required to do so.

2.6 型2.7 Schema 情報

データモデルは、 [Schema Part 1] に基づく型システムを持つ [XML Path 言語 (XPath) 2.0 (第2版)][XQuery] などの、強く型付けされた言語をサポートする。 型システムは [形式的意味内容] にて形式的に定義される。 The data model supports strongly typed languages such as [XML Path Language (XPath) 2.0 (Second Edition)] and [XQuery] that have a type system based on [Schema Part 1]. The type system is formally defined in [Formal Semantics].

データモデルのどの も値と型を持つ。 データモデルはノードに加え、数 5 や文字列 “Hello World.” などの原子値も表現し得る。 データモデルには、これらの原子値のそれぞれに対する項の値( 5 や “Hello World.” など)とその型名( xs:integerxs:string など)が含まれる。 Every item in the data model has both a value and a type. In addition to nodes, the data model can represent atomic values like the number 5 or the string “Hello World.” For each of these atomic values, the data model contains both the value of the item (such as 5 or “Hello World”) and its type name (such as xs:integer or xs:string).

データモデルは、 [XML Path 言語 (XPath) 3.0][XQuery 3.0: XML Query 言語] など、 [Schema Part 1] に基づく型システムを持つ強く型付けされた言語をサポートする。 これを得るため、データモデルは参照を通して [Schema Part 1] に述べられている スキーマコンポーネントモデル ( Schema Component Model )を含む。 The data model supports strongly typed languages such as [XML Path Language (XPath) 3.0] and [XQuery 3.0: An XML Query Language] that have a type system based on [Schema Part 1]. To achieve this, the data model includes (by reference) the Schema Component Model described in [Schema Part 1].

注記: スキーマコンポーネントモデル は型定義, 要素, 属性宣言など何種類ものコンポーネントを含んでおり、プロパティとこれらのコンポーネントとの相互の関係を定義している。 これらのコンポーネントとプロパティの多くは XDM に拠って立つ言語仕様から利用されない。そのような所ではそれらを可視化させる要求は実装には課せられない。 しかしながら、この仕様は XPath と XQuery の処理の意味内容をサポートするために必要な最小限の スキーマコンポーネントモデル のサブセットを定義することは無い。 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.

言語の意味内容がスキーマコンポーネントの情報に依存する主要な領域が2つある: There are two main areas where the language semantics depend on information in schema components:

  1. 式は、特に型定義, 要素宣言, 属性宣言のスキーマコンポーネントを含む静的文脈に従って評価される。 それらのコンポーネントの名前はコンポーネントが静的文脈に存在するときにのみ言語の構成部品に利用し得る。 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.

  2. 要素と属性ノードを含む値, および原子値は、型注釈( type annotation )と呼ばれる型を値とするプロパティを持つ:これは スキーマコンポーネントモデル 内の型定義への参照である。 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.

データモデルのどの も値と型を持つ。 データモデルはノードに加え、数 5 や文字列 “Hello World.” などの原子値も表現し得る。 これらの原子値のそれぞれに対し、項の値( 5 や “Hello World.” など)とその型がデータモデルに含まれる。 その型を保持するプロパティはしばしば型注釈として参照される:その値は スキーマコンポーネントモデル の定義に従う型定義コンポーネントになる。 これは組み込みの型でも( xs:integerxs:string などの名前を伴う型)、あるいは利用者定義の型にもなり得る。 Every item in the data model has both a value and a type. In addition to nodes, the data model can represent atomic values like the number 5 or the string “Hello World.” For each of these atomic values, the data model contains both the value of the item (such as 5 or “Hello World”) and its type. 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 or xs:string), or a user-defined type.

式の(静的か動的かいずれの処理においても)処理の間に利用されるコンポーネント全体の集合が、妥当なスキーマを構成しなければならない制約がある。 従って、例えばこの全体の集合の中に同じ展開名を持つ異なる型は含まれないことになる。 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.

注記: これはプロセッサに対し、静的解析を行うにあたってクエリや式の静的文脈に利用されるスキーマコンポーネントと、クエリや式を評価するにあたって文書の妥当性検証に利用されるスキーマコンポーネントとの間の整合性を保つことを課す。 この仕様はどのような方法でこれを実現させるかについて言及しない。 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.

プロセッサから利用可能なスキーマは少なくとも XPath と XQuery 言語の意味内容を正しく実装するために必要なコンポーネントとプロパティを含まなければならない制約もある。 これは例えば、ある型注釈 T を伴うノード, および型 S の引数を予期する関数が与えられるとき、 T が S から派生しているかどうかを確定するのに十分な情報がプロセッサに渡らなければならないことを意味する。 このデータモデルにて述べる他の整合性の制約と同様、これらの制約は前提条件であり、満たされない場合のふるまいは未定義である。 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.

2.6.12.7.1 型の表現

データモデルではスキーマ型の型名の表現に、 [Schema Part 2] で定義される組み込み型, この仕様で定義する追加の 5 つの型, 他の利用者定義または実装定義の型も含め、 展開-QName が用いられる。 The data model uses expanded-QNames to represent the names of schema types, which include the built-in types defined by [Schema Part 2], five additional types defined by this specification, and may include other user- or implementation-defined types.

XML Schema 型に対しては、展開-QName の名前空間名は型定義の {target namespace} プロパティであり、その局所名は型定義の {name} プロパティである。 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.

データモデルは、すべての型名が展開-QName により一意的に識別される事に拠り立つ。 別々のスキーマが同じ展開-QName に対し異なる型を定義し得るが、妥当性検証に利用し得るのはそれらのうち高々1つになる。 データモデルは、同じ展開-QName に異なる型があり得る環境をサポートし得ない。 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.

匿名型に対しては、プロセッサは、名前の付いたどの型の名前からも, 他のすべての匿名型の名前からも, 区別可能な 匿名型名 を構築しなければならない
[定義: 匿名型名とは、利用できるスキーマにより宣言されたすべての匿名型それぞれに対しプロセッサが与える、実装依存の一意的な型名とする。 ]
匿名型名は、プロセッサからアクセス可能なすべての匿名型にわたり、大域的に一意的でなければならない。 この仕様の形式化においては、匿名型名は xs:QName であるものとみなされるが、実際の実装においては、実装依存の匿名型名の表現に xs:QName を用いることは要求されない。 For anonymous types, the processor must construct an anonymous type name that is distinct from the name of every named type and the name of every other anonymous type. [Definition: An anonymous type name is an implementation dependent, unique type name provided by the processor for every anonymous type declared in the schemas available.] Anonymous type names must be globally unique across all anonymous types that are accessible to the processor. In the formalism of this specification, the anonymous type names are assumed to be xs:QNames, but in practice implementations are not required to use xs:QNames to represent the implementation-dependent names of anonymous types.

匿名型名が意味を持ち区別されなければならないスコープは処理の文脈に依存する。 処理文脈のサイズ/スコープの定義はホスト言語が責を負う。 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.

データモデルはスキーマを構成する要素宣言や属性宣言は表現しないが、様々な型関連の処理をサポートする。 他の処理の意味内容、例えば特定の 要素ノード のインスタンスが与えられたスキーマ型を持つかどうかのチェックは、 [XQuery 1.0 と XPath 2.0 の形式的意味内容] で定義される。 The data model does not represent element or attribute declaration schema components, but it supports various type-related operations. The semantics of other operations, for example, checking if a particular instance of an Element Node has a given schema type is defined in [XQuery 1.0 and XPath 2.0 Formal Semantics].

2.6.22.7.2 定義済みの型

[Schema Part 2]Section 3.2 Primitive datatypes XS2 で定義された 19 の型に加え、データモデルは5つの追加型: xs:anyAtomicType, xs:untyped, xs:untypedAtomic, xs:dayTimeDuration, xs:yearMonthDuration を定義する。 これらの型は XML Schema Working Group の認可の下、 XML Schema 名前空間内に定義されたものであり、将来版の XML Schema への追加が予期されている。 In addition to the 19 types defined in Section 3.2 Primitive datatypesXS2 of [Schema Part 2], the data model defines five additional types: xs:anyAtomicType, xs:untyped, xs:untypedAtomic, xs:dayTimeDuration, and xs:yearMonthDuration. These types are defined in the XML Schema namespace with permission of the XML Schema Working Group, which is expected to add them to some future version of XML Schema.

xs:untyped

データ型 xs:untyped は妥当性がまだ検証されていないかまたはスキップモードで妥当性検証された、要素ノードの動的な型を表す。 xs:untyped から派生する定義済みの型は存在しない。 The datatype xs:untyped denotes the dynamic type of an element node that has not been validated, or has been validated in skip mode. No predefined types are derived from xs:untyped.

xs:untypedAtomic

データ型 xs:untypedAtomic は、より固有な型があてがわれていないテキストなど、型のない原子値のデータを表す。 スキップモードで妥当性検証された属性は データモデル においては型 xs:untypedAtomic の属性ノードで表現される。 xs:untypedAtomic から派生する定義済みの型は存在しない。 The datatype xs:untypedAtomic denotes untyped atomic data, such as text that has not been assigned a more specific type. An attribute that has been validated in skip mode is represented in the Data Model by an attribute node with the type xs:untypedAtomic. No predefined types are derived from xs:untypedAtomic.

xs:anyAtomicType

データ型 xs:anyAtomicType は、すべての原子値を含む(かつ、原子値でないすべての値を含まない)原子型である。 その基底型は xs:anySimpleType であり、 原子型, リスト型, 共用体型を含むすべての単純型はこの型から派生する。 xs:decimalxs:string など、すべての 原始原子型の基底型は xs:anyAtomicType である。 The datatype xs:anyAtomicType is an atomic type that includes all atomic values (and no values that are not atomic). Its base type is xs:anySimpleType from which all simple types, including atomic, list, and union types are derived. All primitive atomic types, such as xs:integerxs:decimal and xs:string, have xs:anyAtomicType as their base type.

xs:dayTimeDuration

xs:dayTimeDuration は字句表現を日, 時, 分, 秒のみの成分に限定することにより xs:duration から派生した型である。 xs:dayTimeDuration の値空間は小数も許容される秒数値の集合である。 xs:dayTimeDuration の各成分は [ISO 8601] 5.5.3.2 節で定められている日, 時, 分, 秒である。 xs:dayTimeDuration は次のようにして xs:duration から派生した型である: The type xs:dayTimeDuration is derived from xs:duration by restricting its lexical representation to contain only the days, hours, minutes and seconds components. The value space of xs:dayTimeDuration is the set of fractional second values. The components of xs:dayTimeDuration correspond to the day, hour, minute and second components defined in Section 5.5.3.2 of [ISO 8601]. An xs:dayTimeDuration is derived from xs:duration as follows:

<xs:simpleType name='dayTimeDuration'>
  <xs:restriction base='xs:duration'>
    <xs:pattern value="[^YM]*[DT].*"/>
  </xs:restriction>
</xs:simpleType>
xs:yearMonthDuration

xs:yearMonthDuration 型は xs:duration 型から字句表現を年, 月のみの成分に限定した派生型である。 xs:yearMonthDuration の値空間は xs:integer 月値の集合になる。 xs:yearMonthDuration の年, 月 成分は [ISO 8601] 5.5.3.2 節で定められているグレゴリオ暦(太陽暦)の年, 月成分になる。 The type xs:yearMonthDuration is derived from xs:duration by restricting its lexical representation to contain only the year and month components. The value space of xs:yearMonthDuration is the set of xs:integer month values. The year and month components of xs:yearMonthDuration correspond to the Gregorian year and month components defined in section 5.5.3.2 of [ISO 8601], respectively.

xs:yearMonthDuration は次のようにして xs:duration から派生した型である: The type xs:yearMonthDuration is derived from xs:duration as follows:

<xs:simpleType name='yearMonthDuration'>
  <xs:restriction base='xs:duration'>
    <xs:pattern value="[^DT]*"/>
  </xs:restriction>
</xs:simpleType>

これらの型のスキーマは C 拡張 XS 名前空間のスキーマ で与えられている。 A schema for these types is provided in C Schema for the Extended XS Namespace.

2.6.3 型階層

ノード, 原始単純型, 利用者定義型の階層関係を下の図式に示す。 The diagram below shows how the nodes, primitive simple types, and user defined types fit together into a hierarchy.

これらの中で xs:IDREFS, xs:NMTOKENS, xs:ENTITIES 型, user-defined list and union types は特別な型であり、真の下位型【 subtypes - 値域を制限した型】ではなくリストまたは共用体になる。 The xs:IDREFS, xs:NMTOKENS, xs:ENTITIES and user-defined list and union types are special types in that these types are lists or unions rather than true subtypes.

型階層の図式

【日本語化された SVG による画像

2.7.3型システム

ノード, 関数, 原始単純型, 利用者定義の型が互いにどのように階層に位置付けられるかを下の図式に示す。 この型システムはいずれも原始単純型を含む2つの異なる階層からなる。 図式の接続線は派生型(矢印の根元側)とその派生元の型(矢印が指す側)との関係を表す。 破線は図式の外の他の図式に現れる関係を表す。 点線は追加の関係を表す。 各図式に現れる情報は表の要約である。 The diagrams below show how nodes, functions, primitive simple types, and user defined types fit together into a type system. This type system comprises two distinct hierarchies that both include the primitive simple types. In the diagrams, connecting lines represent relationships between derived types and the types from which they are derived; the arrowheads point toward the type from which they are derived. The dashed line represents relationships not present in this diagram, but that appear in one of the other diagrams. Dotted lines represent additional relationships that follow an evident pattern. The information that appears in each diagram is recapitulated in tabular form.

これらの中で xs:IDREFS, xs:NMTOKENS, xs:ENTITIES 型, user-defined list and union types は特別な型であり、拡張または制限により派生した型ではなく、リストまたは共用体になる。 The xs:IDREFS, xs:NMTOKENS, and xs:ENTITIES types and the user-defined list and union types are special types in that these types are lists or unions rather than true types derived by extension or restriction.

最初の図式と対応する表に "項" 型の階層を示す。 XDM における項はノード型, function 型, 組み込みの原子型を含む。 The first diagram and its corresponding table illustrate the "item" type hierarchy. In XDM, items include node types, function types, and built-in atomic types.

Type hierarchy graphic, item hierarchy

表の中で、字下げされている名前の型は、字下げが一列左かつ上側で最も近い名前の型から派生したものになる。 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

次の図式と表に "any type" 型階層を示す。 ここでは、すべての型が型 xs:anyType として識別されるものから派生する。 The next diagram and table illustrate the "any type" type hierarchy, in which all types are derived from distinguished type xs:anyType.

Type hierarchy graphic, anyType hierarchy

表の中で、字下げされている名前の型は、字下げが一列左かつ上側で最も近い名前の型から派生したものになる。 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

最後の図式と表に, 原始単純型とその型から派生する組み込み型からなる, すべての原子型を示す。 ここには [Schema Part 2] で定義される組み込みのデータ型すべて, 並びに 2.7 Schema 情報 で定義される順序付けられた duration の下位型2つが含まれる。 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] as well as the two totally ordered subtypes of duration defined in 2.7 Schema Information2.6 Types.

Type hierarchy graphic, anyAtomicType hierarchy

表の中で、字下げされている名前の型は、字下げが一列左かつ上側で最も近い名前の型から派生したものになる。 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

2.6.42.7.4 原子値

原子値は字句表現から構築し得る。 与えられた文字列と原子型に対し、 スキーマ妥当性検証に整合する 原子値が構築される。 文字列がその型の妥当な値を表現していない場合、エラーが送出される。 型として xs:untypedAtomic が指定された場合、妥当性検証は生じない。 構築の詳細については [XQuery 1.0 と XPath 2.0 の関数と演算子(第2版)]5 Constructor Functions FO17 Casting FO で述べられている。 構築の詳細については [XQuery と XPath の関数と演算子 3.0] Section 17 Constructor functions FO30 および、関連する Section 18 Casting FO30 の節にて述べられている。 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. If the string does not represent a valid value of the type, an error is raised. When xs:untypedAtomic is specified as the type, no validation takes place. The details of the construction are described in Section 5 Constructor FunctionsFO and the related Section 17 CastingFO section of [XQuery 1.0 and XPath 2.0 Functions and Operators (Second Edition)]. The details of the construction are described in Section 17 Constructor functions FO30 and the related Section 18 Casting FO30 section of [XQuery and XPath Functions and Operators 3.0].

2.6.52.7.5 文字列値

文字列値( string value )は原子値から構築し得る。 そのような値は 17 Casting FO Section 18 Casting FO30 の記述に従って原子値からその文字列表現へ変換することにより構築される。 原子値に対し正準的な字句表現を用いることが常に XPath 1.0 と互換になるとは限らない。 これらと他の後方非互換性については I 節 XPath 1.0 に対する後方互換性(参考) XP で述べられている。 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 17 CastingFO. Using the canonical lexical representation for atomic values is not always compatible with XPath 1.0. These and other backwards incompatibilities are described in Section I Backwards Compatibility with XPath 1.0 (Non-Normative)XP.

2.7.6 負のゼロ

データモデルにおけるデータ型 xs:float, xs:double の値空間は XML Schema 1.1 ([Schema 1.1 Part 2]) と同じである。 特に、負および正のゼロも含まれ、その点において XML Schema 1.0 と異なる。 The xs:float and xs:double data types in the data model have the same value space as in XML Schema 1.1 ([Schema 1.1 Part 2]). Specifically they include both negative and positive zero, and in this respect they differ from XML Schema 1.0.

この違いに適応するため、 xs:string から xs:float または xs:double への変換において、字句 “-0” (あるいは “-0.0” など類似するもの)を値空間の正負いずれのゼロに変換するかは実装定義とする。 To accommodate this difference, when converting from an xs:string to an xs:float or xs:double, it is implementation-defined whether the lexical value “-0” (and similar forms such as “-0.0”) convert to negative zero or to positive zero in the value space.

2.8 その他の項

XPath データモデル は XPath 式を評価するための土台となる抽象化である。 歴史的に、データモデルのすべての項は XML 文書から直接的 (ノード)または間接的(型付き値, シーケンス)に派生している。 しかしながら、 XPath 式言語の成熟に伴い、データモデルに追加の項の型を要する新たな特色機能が加えられてきている。 これらの項は直接的に XML 直列化の対象になることはないにもかかわらず、データモデルの一部を担う。 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.

2.8.1 関数

[定義: 関数とは、コールし得る項である。 ]
関数には識別子は存在せず、比較や直列化の対象にはならない。 [Definition: A function is an item that can be called. ] Functions have no identity, cannot be compared, and have no serialization.

関数は次のプロパティを持つ: A function has the following properties:

  • 名前 (xs:QName): 展開 QName 。 存在しないこともある。 xs:QName としての関数の名前。 name (xs:QName): An expanded QName, possibly absent.

  • パラメタ名 (xs:QName*): 関数のパラメタごとにあてがわれる, 互いに異なる名前のリスト。 parameter names (xs:QName*): A list of distinct names, one for each of the function's parameters.

  • シグネチャ Annotation* TypedFunctionTest の形式による FunctionTest )TypedFunctionTestXP30 は各パラメタに対し, 1 個の SequenceTypeXP30 を持ち, 関数の結果に対し 1 個の SequenceType を持つ。
    [定義: 関数シグネチャ とは 関数 の型を表現するものである。]
    annotation の存在は言語依存である: XPath などの言語で定義される, annotation を定義する仕組みを持たない関数は、 zero annotation のデータモデルにおける関数を作成する。 signature (a FunctionTest of the form Annotation* TypedFunctionTest): The TypedFunctionTestXP30 has one SequenceTypeXP30 for each parameter, and one SequenceType for the function's result. [Definition: A function signature represents the type of a 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.

  • 実装 (通例はホスト言語 expression, あるいは実装依存): 関数を有効化し, コールされたときにそのパラメタ型のインスタンスをその結果の型へマップする。 implementation (typically a host language expression, or else implementation-dependent): This enables the function, when it's called, to map instances of its parameter types into an instance of its result type.

  • 非局所変数束縛 xs:QName から item()* への対応付け): 関数のそれぞれの自由変数(すなわち, 局所変数やパラメタ以外の関数の実装から参照される変数)に対する値を供する。 nonlocal variable bindings (a mapping from xs:QName to item()*): This provides a value for each of the function's free variables (i.e., variables referenced by the function's implementation, other than locals and parameters).

[定義: 関数の arity とは、そのパラメタの個数を指す。 ]
関数のパラメタ名に含まれる名前の個数, およびそのシグネチャに含まれるパラメタ型の個数は関数の arity に等しくなければならない。 [Definition: A function's arity is the number of its parameters. ] The number of names in a function's parameter names, and the number of parameter types in its signature, must equal the function's arity.

可能な 関数シグネチャ すべての空間は関数型の階層をなす。 すべての関数型は item() の下位型の function(*) の下位型である。 function(*) の下位型はそれぞれが別々の型に分岐し、それぞれが特定個数の引数を受容する 関数項 を表現する。 同じ個数の引数をとる関数型はそれらの引数型と返り値型に基づいて互いに互いの下位型になり得る。 この下位型の関係は Section 2.5.6 SequenceType Subtype RelationshipsXP30 にて定義される。 例えば: The space of all possible function signatures forms a hierarchy of function types. All function types are a subtype of function(*), which is itself a subtype of item(). Subtypes of function(*) are partitioned into discrete types, each representing function items that accept a particular number of arguments. Function types which have the same arity can be subtypes of each other based on their argument and return types. This subtype relationship is defined in Section 2.5.6 SequenceType Subtype Relationships XP30. For example:

  • function(item()) as item()function(*) の下位型である。 function(item()) as item() is a subtype of function(*)

  • function(item()) as xs:integerfunction(item()) as item() の下位型である。 function(item()) as xs:integer is a subtype of function(item()) as item()

  • function(item()) as item()function(xs:string) as item() の下位型である。 function(item()) as item() is a subtype of function(xs:string) as item()

3 データモデルの構築

この節ではデータモデルのインスタンスに課せられる制約について述べる。 This section describes the constraints on instances of the data model.

データモデルは [XML 名前空間] または [XML 1.1 名前空間] に適合する整形式 XML 文書をサポートする。 整形式でない文書は定義により XML ではない。 [XML 名前空間][XML 1.1 名前空間] に適合しない XML 文書はサポートされない( [Infoset] でもサポートされない)。 The data model supports well-formed XML documents conforming to [Namespaces in XML] or [Namespaces in XML 1.1]. Documents that are not well-formed are, by definition, not XML. XML documents that do not conform to [Namespaces in XML] or [Namespaces in XML 1.1] are not supported (nor are they supported by [Infoset]).

すなわち、データモデルは以下に挙げる種類の XML 文書をサポートする: In other words, the data model supports the following classes of XML documents:

この文書は情報セット ([Infoset]) あるいは妥当性検証後の情報セット( PSVI )(すなわち XML Schema 妥当性検証の過程から生成され情報が追加された情報セット)からどのようにデータモデルのインスタンスを構築するかについて述べる。 This document describes how to construct an instance of the data model from an infoset ([Infoset]) or a Post Schema Validation Infoset (PSVI), the augmented infoset produced by an XML Schema validation episode.

データモデルのインスタンスはアプリケーション API 通して、あるいはデータベースの関係テーブルのような非 XML からも直接構築され得る。 情報セットや PSVI でないソースからのデータモデルの構築は実装依存である。 データモデルがどのように構築されるかに関わらず、データモデルのどのノード値も原子値もその型に整合する typed-value を持たなければならない。 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.

データモデルは [Infoset]) からはサポートされていない一部の種類の値もサポートする。 例として、 文書素片文書ノード のシーケンスが挙げられる。 データモデルはノードではない値、例えば 原子値 のシーケンスやノードと原子値が混在するシーケンスもサポートする。 これらはデータモデルにおける式の処理過程において中間結果を表現するために必要になる。 The data model supports some kinds of values that are not supported by [Infoset]. Examples of these are document fragments and sequences of Document Nodes. The data model also supports values that are not nodes. Examples of these are sequences of atomic values, or sequences mixing nodes and atomic values. These are necessary to be able to represent the results of intermediate expressions in the data model during expression processing.

3.1 直接的な構築

この文書では情報セットのプロパティに基づく形でデータモデルのインスタンスの構築について述べるが、情報セットの存在がデータモデルのインスタンスを構築するための前提条件になるわけではない。 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 satisfy all of the constraints described in this document.

3.2 情報セットからの構築

データモデルのインスタンスは次の共通制約を満たす情報セットから構築し得る。 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.

  • 情報セットはこの文書において「要求される」/「必須」( "required" )と記されているすべてのプロパティを提供しなければならない。 「オプション」( "optional" )と記されているプロパティは存在するならば利用してもよい。 他のすべてのプロパティは無視される。 The infoset must provide all of the properties identified as "required" in this document. The properties identified as "optional" may be used, if they are present. All other properties are ignored.

情報セットから構築されたデータモデルのインスタンスはこの文書でそれぞれのノード種に与える記述に整合していなければならない An instance of the data model constructed from an information set must be consistent with the description provided for each node kind.

3.3 PSVI からの構築

データモデルのインスタンスは PSVI から、要素と属性情報項目の厳密な査定, 緩い査定, 査定なしのいずれからも構築し得る。 PSVI からのデータモデルのインスタンス構築は、この節で与える記述と各ノード種に対し与える記述に整合していなければならない 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 be consistent with the description provided in this section and with the description provided for each node kind.

データモデル構築では PSVI がすべての匿名スキーマ型に対し一意的な名前を与えることが要求される。 Data model construction requires that the PSVI provide unique names for all anonymous schema types.

注記: [Schema Part 1] においては、すべてのスキーマプロセッサが匿名スキーマ型に一意的な名前を与えることは要求されていない。 名前を提供しないプロセッサから供された PSVI からデータモデルのインスタンスを構築する際には、その前に、それらが一意的に識別できるようにしておく何らかの後処理が要求される。 [Schema Part 1] does not require all schema processors to provide unique names for anonymous schema types. In order to build an instance of the data model from a PSVI produced by a processor that does not provide the names, some post-processing will be required in order to assure that they are all uniquely identified before construction begins.

[定義: 不完全に検証された文書とは、対応するスキーマを持つ XML 文書であって、そのスキーマ妥当性の査定による結果、 PSVI において1個以上の要素または属性情報項目の [validity] プロパティに対し 'valid' 以外の値があてがわれているもの、とする。 ] [Definition: An incompletely validated document is an XML document that has a corresponding schema but whose schema-validity assessment has resulted in one or more element or attribute information items being assigned values other than 'valid' for the [validity] property in the PSVI.]

データモデルは不完全に検証された文書もサポートする。 妥当( valid )でない要素と属性は未知の型を持つものとして扱われる。 The data model supports incompletely validated documents. Elements and attributes that are not valid are treated as having unknown types.

情報セットからの構築と PSVI からの構築の最大の相違はスキーマ型の割り当ての領域において現れる。 他の相違もスキーマ処理を源にする: 属性や要素に既定値が与えられているかもしれないし, 要素内容に対する空白の正規化も生じ得るし, 原始スキーマ型を伴う要素と属性に対する利用者供与による字句形式も失われ得る。 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.

3.3.1 PSVI による追加情報とノードプロパティの対応付け

PSVI 要素/属性情報項目は [validity] プロパティを持ち得る。 [validity] プロパティがとり得るのは " valid ", " invalid ", " notKnown " であり、外部からのスキーマ妥当性の査定が反映される。 データモデルにおいては、正確なスキーマ型情報は " valid " な 要素, 属性ノード において公開される。 " valid " でないノードは単に整形式の XML として扱われ、汎用のスキーマ型情報のみが結びつけられる。 A PSVI element or attribute information item may have a [validity] property. The [validity] property may be " valid ", " invalid ", or " notKnown " and reflects the outcome of schema-validity assessment. In the data model, precise schema type information is exposed for Element and Attribute Nodes that are " valid ". Nodes that are not " valid " are treated as if they were simply well-formed XML and only very general schema type information is associated with them.

3.3.1.1 要素, 属性ノード の型

要素/属性情報項目のスキーマ型の正確な定義は PSVI のプロパティに依存する。 PSVI においては、 [Schema Part 1] により、実質的に型定義プロパティのための省略形である [type definition] プロパティ並びに [type definition namespace], [type definition name], [type definition anonymous] プロパティが定義されている。 更に、 [element declaration][attribute declaration] プロパティもそれぞれ要素と属性に定義されており、これらの宣言から要素や属性に宣言された [type definition] が特定されることになる。 PSVI において要素や属性のインスタンスに与えられた [type definition] と宣言に結びつけられた [type definition] を区別するため、それらの要素/属性に対し以下、前者を実際の型、後者を宣言型と呼ぶ。 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] defines a [type definition] property as well as the [type definition namespace], [type definition name] and [type definition anonymous] properties, which are effectively short-cut terms for properties of the type definition. Further, the [element declaration] and [attribute declaration] properties are defined for elements and attributes, respectively. These declarations in turn will identify the [type definition] declared for the element or attribute. To distinguish the [type definition] given in the PSVI for the element or attribute instance from the [type definition] associated with the declaration, the former is referred to below as the actual type and the latter as the declared type of the element or attribute instance in question.

型は宣言型, 実際の型, PSVI における [validity][validation attempted] プロパティに依存する。 もし: The type depends on the declared type, the actual type, and the [validity] and [validation attempted] properties in the PSVI. If:

  • [validity][validation attempted] プロパティが存在し、それぞれの値が " valid ", " full " の場合、要素/属性情報項目のスキーマ型は、次のリストの中で最初に適用可能な項目に対応する名前空間と局所名を持つ 展開-QName で表現される。 The [validity] and [validation attempted] properties exist and have the values " valid " and " full ", respectively, the schema type of an element or attribute information item is represented by an expanded-QName whose namespace and local name correspond to the first applicable items in the following list:

    • 宣言型が存在し、それが共用体であって、実際の型が(宣言型あるいはその派生型と同じでないが)共用体のメンバ型、あるいはメンバ型の派生型になっている場合: 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:

      • 宣言型の {name} プロパティが存在する場合: その宣言型の {target namespace} と {name} プロパティ。 If the {name} property of the declared type is present: the {target namespace} and {name} properties of the declared type.

      • 宣言型の {name} プロパティが存在しない場合: その宣言型に与えられた匿名型名の名前空間と局所名。 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:

      • その実際の型の {name} プロパティが存在する場合: その実際の型の {target namespace} と {name} プロパティ。 If the {name} property of the actual type is present: the {target namespace} and {name} properties of the actual type.

      • 実際の型の {name} プロパティが存在しない場合: その実際の型に供されている匿名型名の名前空間と局所名。 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:

      • [type definition anonymous] が false の場合: その実際の型の {target namespace} と {name} プロパティ。 If [type definition anonymous] is false: the {target namespace} and {name} properties of the actual type.

      • [type definition anonymous] が true の場合: その実際の型に供されている匿名型名の名前空間と局所名。 If [type definition anonymous] is true: the namespace and local name of the anonymous type name supplied for the actual type.

  • [validity] プロパティが存在して " invalid " であるか、 [validation attempted] プロパティが存在して " partial " になっている場合、 要素のスキーマ型は xs:anyType , 属性の型は xs:anySimpleType になる。 The [validity] property exists and is " invalid ", or the [validation attempted] property exists and is " partial ", the schema type of an element is xs:anyType and the type of an attribute is xs:anySimpleType.

  • [validity] プロパティが存在して " notKnown " の場合、要素のスキーマ型は xs:anyType , 属性の型は xs:anySimpleType になる。 The [validity] property exists and is " notKnown ", the schema type of an element is xs:anyType and the type of an attribute is xs:anySimpleType.

  • [validity] または [validation attempted] プロパティが存在しない場合、要素のスキーマ型は xs:untyped , 属性の型は xs:untypedAtomic になる。 The [validity] or [validation attempted] properties do not exist, the schema type of an element is xs:untyped and the type of an attribute is xs:untypedAtomic.

型名に結びつけられる接頭辞は実装依存になる。 The prefix associated with the type names is implementation-dependent.

3.3.1.2 型付き値の決定

この節では 要素/属性ノード の 型付き値( typed value )がどのように要素や属性の PSVI 情報項目から算出されるかについて述べる。 情報項目は単純型か単純内容を伴う複合型を持つ。 他の種の 要素ノード については 6.2.4 PSVI からの構築 を見よ。 他の種の 属性ノード については 6.3.4 PSVI からの構築 を見よ。 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; for other kinds of Attribute Nodes, see 6.3.4 Construction from a PSVI.

属性ノード と一部の 要素ノード の型付き値は原子値のシーケンスである。 ノードの型付き値の項の型はノード自身の型と異なり得る。 この節では 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.

ノードの型付き値における項の型は次のように決定される。 PSVI において表現されるノード自身のスキーマ型を T とする。 それぞれの原始単純型または ordinary 単純型 T に対し、値の字句表現から値自身へ対応付ける関数 M が W3C XML Schema 仕様から定義される。 【 ordinary - 他の型から構築された型( 参照 )】 The types of the items in the typed value of a node are determined as follows. The process begins with T, the schema type of the node itself, as represented in the PSVI. For each primitive or ordinary simple type T, the W3C XML Schema specification defines a function M mapping the lexical representation of a value onto the value itself. The types of the items in the typed value of a node are determined as follows. The process begins with a type, T. If the schema type of the node itself, as represented in the PSVI, is a complex type with simple content, then T is the {content type} of the schema type of the node; otherwise, T is the schema type of the node itself. For each primitive or ordinary simple type T, the W3C XML Schema specification defines a function M mapping the lexical representation of a value onto the value itself.

注記: 原子型とリスト型に対する T の対応付けは [Schema Part 2] の “字句対応付け” により定義される。共用体型に対する対応付けは [Schema Part 2] の 字句対応付け に [Schema Part 1] により適用し得る規則に則った適切な変更を加えて定義される。 変更を加えられた対応関係は、字句対応付けが複数の値に正しく対応する場合においても、1個の値へ対応付ける(数学的な意味での)関数になる。 For atomic and list types, the mapping is the “lexical mapping” defined for T in [Schema Part 2]; for union types, the mapping is the lexical mapping defined in [Schema Part 2] modified as appropriate by any applicable rules in [Schema Part 1]. The mapping, so modified, is a function (in the mathematical sense) which maps to a single value even in cases where the lexical mapping proper maps to multiple values.

型付き値は次のように決定される: The typed value is determined as follows:

  • 当該ノードの nilled プロパティが true の場合、型付き値は空シーケンス。 If the nilled property of the node in question is true, then the typed value is the empty sequence.

  • Txs:anySimpleType または xs:anyAtomicType の場合、型付き値は xs:untypedAtomic のインスタンスとしての [schema normalized value] If T is xs:anySimpleType or xs:anyAtomicType, the typed value is the [schema normalized value] as an instance of xs:untypedAtomic.

  • 他の場合、型付き値は、適切な値の型( T が共用体型ならば [member type definition], 他の場合は単に T )のインスタンスとしての文字列値に M を適用した結果とする。 Otherwise, the typed value is the result of applying M to the string value as an instance of the appropriate value type, where the appropriate value type is the [member type definition] if T is a union type, otherwise it is simply T.

型付き値の決定過程の結果は well-defined な原子型を持つ原子値のシーケンスになることが保証される。 この原子値のシーケンスが、データモデルにおけるノードの typed-value プロパティを決定する。 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.

3.3.1.3 typed-value と string-value の関係

要素/属性ノードは typed-value (型付き値)と string-value (文字列値)のいずれのプロパティも持つ。 しかしながら、これらのプロパティをどのような形で記憶するかについては実装の選択である。 実装は string-value のみを記憶して typed-value をそちらから導出してもよいし, typed-value のみを記憶して string-value をそちらから導出してもよいし, string-value と typed-value の両方を記憶してもよい。 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.

これらの様々な実装の戦略を許容するため、ノードの文字列値において一部の妥当性検証は insignificant として定義されている。 ノードの型付き値のみを記憶する実装はノード内容の元々の字句形式と異なる文字列値を返してもよい。 例えば、次の要素を考える: 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>

ノードが妥当なものなら xs:integer としての型付き値 30 を持つ。 実装はノードの文字列値として "30" と "0030" のどちらを返してもよい。 型付き値の妥当な字句表現であればどんな文字列でも受容される。 この仕様では、この規則のことをノードの文字列値と型付き値の関係が「スキーマ妥当性検証に整合する」と表現する。 Assuming that the node is valid, it has a typed value of 30 as an xs:integer. An implementation may return either "30" or "0030" as the string value of the node. Any string that is a valid lexical representation of the typed value is acceptable. In this specification, we express this rule by saying that the relationship between the string value of a node and its typed value must be "consistent with schema validation."

ノードの string-value のみを記憶する実装には次の事項が適用される: If an implementation stores only the string-value of a node, the following considerations apply:

  • 共用体型が現れる所では、実装は適切なメンバ型のインスタンスとして typed-value を提供できなければならない。 例えば、要素ノードの型がメンバ型 xs:integer と xs:string による共用体として定義された my:integer-or-string で、ノードの string-value が "47" であれば、実装は要素においてどちらのメンバ型により妥当性が検証されたかに従って、ノードの typed-value として整数 47 または文字列 "47" を提供できなければならない。 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.

  • xs:QName, xs:NOTATION または、これらの型いずれかの派生型が現れる所では、実装は、局所名, 名前空間接頭辞, 名前空間 URI からなる3つ組として(名前空間 URI が string-value の一部でなくても) typed-value を提供できなければならない( 3.3.3 QName と NOTATION を見よ)。 Where types of xs:QName, xs:NOTATION, or types derived from one of these types occur, the implementation must be able to deliver the typed-value as a triple including a local name, a namespace prefix, and a namespace URI, even though the namespace URI is not part of the string-value (see 3.3.3 QNames and NOTATIONS).

  • 複合型の要素で element-only 内容が現れる所では 要素ノード の typed-value へのアクセスはエラーとする。 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.

ノードの typed-value のみを記憶する実装は、ノードのみから(一部の場合はノードの子孫からも)文字列値を構築できなければならない。 例えば、複合型の要素と element-only 内容は typed-value を持たないが、すべての子孫 テキストノード の string-value を文書順に連結した string-value を持つ。 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.

3.3.1.4 パターンファセット

一般的に、制約により作成される下位型( subtype )は元のスキーマ型の空間を狭めるものになる。 例えば、帽子サイズを最小値 6.5, 最大値 8.0 の制約を課した十進数で表す場合、 6.5 から 8.0 までの範囲を妥当な値とするスキーマ型が作成される。 Creating a subtype by restriction generally reduces the value space of the original schema type. For example, expressing a hat size as a restriction of decimal with a minimum value of 6.5 and maximum value of 8.0 creates a schema type whose valid values are only those in the range 6.5 to 8.0.

一方、パターンファセットは値空間ではなく、スキーマ型の字句空間を制限するという意味で異なる。 整数に対し、パターンファセット “[0-9]{3}” により3桁の数という制限をかけた場合、3個の数字からなる字句形式を妥当な値とするスキーマ型が作成される。 The pattern facet is different because it restricts the lexical space of the schema type, not its value space. Expressing a three-digit number as a restriction of integer with the pattern facet “[0-9]{3}” creates a schema type whose valid values are only those with a lexical form consisting of three digits.

実践的にはパターンファセットは可逆ではない。値空間内のどの値もいくつもの字句表現を持ち得る。一般的に、これらのうちどの表現がその型のパターンファセットを満たすかどうかを決定する実用的な方法は存在しない。 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.

3.3.2 日付と時刻

日/時型には特別な注意を要する。 この節の規定は、 xs:dateTime, xs:date, xs:time, xs:gYearMonth, xs:gYear, xs:gMonthDay, xs:gMonth, xs:gDay および、これらの派生型の型付き値を記憶する実装に適用される。 この仕様ではこれらをひとまとめに「日/時型」と総称する。 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, and types that are derived from them. These are known collectively as the date/time types in this specification.

データモデルにおいては、日/時型の値は7つの成分で表現される: The values of the date/time types are represented in the data model using seven components:

year

xs:integer An xs:integer.

month

0 から 12 までの xs:integer An xs:integer between 1 and 12, inclusive.

day

1 から 31 までの xs:integer 。 month, year (月と年)の値により更に制限され得る。 An xs:integer between 1 and 31, inclusive, possibly restricted further depending on the values of month and year.

hour

0 から 23 までの xs:integer An xs:integer between 0 and 23, inclusive.

minute

0 から 59 までの xs:integer An xs:integer between 0 and 59, inclusive.

second

0 以上で 60 より小さい xs:decimal 。 閏秒はサポートされない。 An xs:decimal greater than or equal to zero and less than 60. Leap seconds are not supported.

timezone

-PT14H00M から PT14H00M までの xs:dayTimeDuration 。 すべての timezone 値は整数による分-数でなければならない。 An xs:dayTimeDuration between -PT14H00M and PT14H00M, inclusive. All timezone values must be an integral number of minutes.

データ型固有の成分(例えば xs:date の年, 月, 日)は存在しなければならず、 データ型の一部になり得ない成分(例えば xs:time の年)は存在してはならない。 存在しない成分は空シーケンスとして表現される。 成分が存在するときは正規化が施されていない「局所値」を含むものとする。 等時帯成分はどの日/時データ型においてもオプションである。 Components that are intrinsic to the datatype (for example, day, month, and year in a xs:date) are required; components that can never be part of a datatype (for example, years in a xs:time) must be missing. Missing components are represented by the empty sequence. When a component is present, it contains the “local value” that has not been normalized in any way. The timezone component is optional for all the date/time datatypes.

従って、 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}” の形で記憶される。 Thus, the lexical xs:dateTime representation “2003-01-02T11:30:00-05:00” is stored as “{2003, 1, 2, 11, 30, 0.0, -PT05H00M}”. The value of the lexical representation “2003-01-16T16:30:00” is stored as “{2003, 1, 16, 16, 30, 0, ()}” because it has no timezone. The value of the lexical xs:gDay representation “---30+10:30” is stored as “{(), (), 30, (), (), (), PT10H30M}”.

字句表現 “24:00:00” は成分のモデルにおいて正規化される。 xs:time の形では “{(), (), (), 0, 0, 0.0, ()}” の形で記憶され、 xs:dateTime の表現 “1999-12-31T24:00:00” は “{2000, 1, 1, 0, 0, 0.0, ()}” の形で記憶される。 The lexical form “24:00:00” is normalized in the component model. As a xs:time, it is stored as “{(), (), (), 0, 0, 0.0, ()}” and the xs:dateTime representation “1999-12-31T24:00:00” is stored as “{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.

3.3.3 QName と NOTATION

QNameNOTATION データ型には特別な注意を払う必要がある。 以下の節は xs:QName, xs:NOTATION およびそれらの派生型に適用される。 これらの型はまとめて “修飾名” と称される。 The QName and NOTATION data types require special attention. The following sections apply to xs:QName, xs:NOTATION, and types derived from them. These types are referred to collectively as “qualified names”.

XML Schema の定義により、修飾名の字句空間は局所名とオプションの名前空間接頭辞を含み、修飾名の値空間は局所名とオプションの名前空間 URI を含む。 従って、名前空間束縛を定義する何らかの文脈へのアクセス抜きには、型付き値から字句値の導出やその逆は行えない。 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.

この データモデル においては、従って、修飾名の値空間は local-name, オプションの名前空間 URI, オプションの接頭辞を含む。 接頭辞は値の字句表現の生成、すなわち値の文字列へのキャストにのみ用いられる。 接頭辞は修飾名に関する他のいかなる処理にも影響しない。 特に、局所名と名前空間 URI が合致する2つの修飾名は接頭辞に関わらず等しいものとする。 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:

  • 修飾名に名前空間 URI が存在しない場合、接頭辞も存在してはならない。 修飾名に名前空間 URI が存在しない場合、接頭辞も存在してはならない If the namespace URI of a qualified name is absent, then the prefix must also be absent.

  • 名前に接頭辞を持つどの要素ノードにおいても、接頭辞は要素の namespaces プロパティの中で要素名の名前空間 URI に束縛されていなければならない。 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.

  • 名前に接頭辞を持たないどの要素ノードにおいても、要素は空の接頭辞から要素名の名前空間 URI への束縛を持つか、あるいは要素名が名前空間 URI を持たない場合は要素は空の接頭辞に対する束縛も持ってはならない。 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.

  • 名前に接頭辞を持つどの属性ノードにおいても、属性に親が存在しないか、あるいは親要素の namespaces プロパティの中で接頭辞が属性名の名前空間 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.

  • 修飾名が接頭辞を含み、かつ、要素ノードの, あるいは要素ノードを親に持つ属性ノードの型付き値に含まれるならば、その接頭辞はその要素の namespaces プロパティの中で修飾名の名前空間 URI に束縛されていなければならない。 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.

  • 修飾名が名前空間 URI を含み、かつ、接頭辞は含まず、かつ、要素ノードの, あるいは要素ノードを親に持つ属性ノードの型付き値に含まれるならば、その要素ノードは空の接頭辞からその名前空間 URI への束縛を持たなければならない。 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.

  • 修飾名が名前空間 URI も接頭辞も含まず、かつ、要素ノードの, あるいは要素ノードを親に持つ属性ノードの型付き値に含まれるならば、その要素ノードは空の接頭辞に対する束縛を持ってはならない。 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.

4 情報セットとの対応付け

この仕様は各ノード種がどのように情報項目に対応するかについてを述べる。 この対応付けは情報セットを生成し、 PSVI は生成しない/し得ない。 データモデルインスタンスの(一部分の)ための PSVI を得るためには妥当性検証が利用されなければならない。 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.

An Infoset can also be constructed by serializing an instance of the data model and parsing it. Serialization is governed by [Serialization].

5 アクセサ

データモデル内の ノード に対してはアクセサの集合が定義される。 一貫性のため、どのノード種に対してもすべてのアクセサが定義される。 いくつかのアクセサは一部のノード種に対し常に空シーケンスを返す。 A set of accessors is defined on nodes in the data model. For consistency, all the accessors are defined on every kind of node, although several accessors return a constant empty sequence on some kinds of nodes.

プロセッサがデータモデルのインスタンスを処理できるようになるためには、モデルに含まれる項のプロパティが公開されなければならない。 これはデータモデルに一群のアクセサ関数を定義することにより行われる。 これらは利用者やアプリケーションから直接呼び出されるような文字通りの意味での関数ではなく、むしろデータモデルの実装がアプリケーションに公開しなければならない情報の記述になる。 末端利用者から利用可能な関数と演算子については [XQuery 1.0 と XPath 2.0 の関数と演算子(第2版)] [XQuery と XPath の関数と演算子 3.0] で述べられている。 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 1.0 and XPath 2.0 Functions and Operators (Second Edition) XQuery and XPath Functions and Operators 1.1 ].

データモデルにおいて一部の型付き値は 未定義 である。 未定義のプロパティへのアクセスは常にエラーとする。 データモデルにおいて一部の型付き値は存在しない存在しない型の値へのアクセスはエラーとする。 これらの場合におけるふるまいは実装定義であり、結果の扱いはホスト言語が責を負う。 Some typed values in the data model are undefined. Attempting to access an undefined property is always an error. Some typed values in the data model are absent. Attempting to access an absent typed value is an error. Behavior in these cases is implementation-defined and the host language is responsible for determining the result.

5.1 attributes アクセサ

dm:attributes($n as node()) as attribute()*

dm:attributes アクセサは0個以上の 属性ノード のシーケンスとしてノードの属性を返す。 属性ノード の順序は安定であるが、実装依存になる。 The dm:attributes accessor returns the attributes of a node as a sequence containing zero or more Attribute Nodes. The order of Attribute Nodes is stable but implementation dependent.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.2 base-uri アクセサ

dm:base-uri($n as node()) as xs:anyURI?

dm:base-uri アクセサは、0個以上の URI 参照のシーケンスとしてノードの基底 URI を返す。 基底 URI についてのより詳細な情報は [XML Base] を見よ。 The dm:base-uri accessor returns the base URI of a node as a sequence containing zero or one URI reference. For more information about base URIs, see [XML Base].

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.3 children アクセサ

dm:children($n as node()) as node()*

dm:children アクセサは、0個以上のノードのシーケンスとしてノードの子を返す。 The dm:children accessor returns the children of a node as a sequence containing zero or more nodes.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.4 document-uri アクセサ

dm:document-uri($node as node())  as xs:anyURI?

dm:document-uri アクセサは、 文書ノード の構築の基になったリソースの絶対 URI を(取得可能ならば)返す。 URI が取得不能な場合, 文書ノード の構築の際に絶対 URI が導出できない場合, アクセサが 文書ノード 以外のノードに用いられた場合、いずれも空シーケンスが返される。 The dm:document-uri accessor returns the absolute URI of the resource from which the Document Node was constructed, if the absolute URI is available. If there is no URI available, or if it cannot be made absolute when the Document Node is constructed, or if it is used on a node other than a Document Node, the empty sequence is returned.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.5 is-id アクセサ

dm:is-id($node as node())  as xs:boolean?

dm:is-id アクセサは、ノードが XML ID のとき true を返す。 厳密な意味で何が ID を構成するかは、データモデルがどのように構築されたかに依存する。 6.2 要素ノード6.3 属性ノード を見よ。 The dm:is-id accessor returns true if the node is an XML ID. Exactly what constitutes an ID depends in part on how the data model was constructed, see 6.2 Element Nodes and 6.3 Attribute Nodes.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.6 is-idrefs アクセサ

dm:is-idrefs($node as node())  as xs:boolean?

dm:is-idrefs アクセサは、ノードが XML IDREF または IDREFS のとき true を返す。 厳密な意味で何が IDREF や IDREFS を構成するかは、データモデルがどのように構築されたかに依存する。 6.2 要素ノード6.3 属性ノード を見よ。 The dm:is-idrefs accessor returns true if the node is an XML IDREF or IDREFS. Exactly what constitutes an IDREF or IDREFS depends in part on how the data model was constructed, see 6.2 Element Nodes and 6.3 Attribute Nodes.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.7 namespace-bindings アクセサ

dm:namespace-bindings($node as node())  as xs:string*

dm:namespace-bindings アクセサは、ノードに結びつけられた動的でスコープに入る名前空間を、実装依存の表現を用いた接頭辞/URI の組の集合として返す。 The dm:namespace-bindings accessor returns the dynamic, in-scope namespaces associated with a node as a set of prefix/URI pairs, using an implementation-dependent representation.

既定の名前空間に対する接頭辞は長さ0の文字列である。 The prefix for the default namespace is the zero length string.

7種 のノードすべてに定義される。 The dm:namespace-bindings accessor is defined on all seven node kinds.

注記: このアクセサと namespace-nodes アクセサは同じ情報に対する2つの見方を提供する。 Note: this accessor and the namespace-nodes accessor provide two views of the same information.

5.8 namespace-nodes アクセサ

dm:namespace-nodes($n as node()) as node()*

dm:namespace-nodes アクセサは、ノードに結びつけられた動的でスコープに入る名前空間を、0個以上の 名前空間ノード のシーケンスとして返す。 名前空間ノード の順序は安定かつ実装依存になる。 The dm:namespace-nodes accessor returns the dynamic, in-scope namespaces associated with a node as a sequence containing zero or more Namespace Nodes. The order of Namespace Nodes is stable but implementation dependent.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

注記: このアクセサと namespace-bindings アクセサは同じ情報に対する2つの見方を提供する。 名前空間ノード の公開を必要としない実装は、このアクセサを実装しないことを選択し得る。 Note: this accessor and the namespace-bindings accessor provide two views of the same information. Implementations that do not need to expose Namespace Nodes might choose not to implement this accessor.

5.9 nilled アクセサ

dm:nilled($n as node()) as xs:boolean?

dm:nilled アクセサは、ノードが "nilled" のとき true を返す。 [Schema Part 1] には、空の内容が要求されない、あるいは許容すらされない内容型の要素が内容を含んでいなくても、妥当なものとして受容すべきことを指示する nilled の仕組みが導入されている。 The dm:nilled accessor returns true if the node is "nilled". [Schema Part 1] introduced the nilled mechanism to signal that an element should be accepted as valid when it has no content even when it has a content type which does not require or even necessarily allow empty content.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.10 node-kind アクセサ

dm:node-kind($n as node()) as xs:string

dm:node-kind アクセサは、ノード種を特定する文字列を返す。 ノード種に従って次のいずれかになる: “attribute”, “comment”, “document”, “element”, “namespace” “processing-instruction”, “text” The dm:node-kind accessor returns a string identifying the kind of node. It will be one of the following, depending on the kind of node: “attribute”, “comment”, “document”, “element”, “namespace” “processing-instruction”, or “text”.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.11 node-name アクセサ

dm:node-name($n as node()) as xs:QName?

dm:node-name アクセサは、ノードの名前を xs:QName の0個以上のシーケンスとして返す。 QName 値は 3.3.3 QName と NOTATION で述べたようにオプションの接頭辞を含み得ることに注意。 The dm:node-name accessor returns the name of the node as a sequence of zero or one xs:QNames. Note that the QName value includes an optional prefix as described in 3.3.3 QNames and NOTATIONS.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.12 parent アクセサ

dm:parent($n as node()) as node()?

dm:parent アクセサは、ノードの親を0個以上のノードのシーケンスとして返す。 The dm:parent accessor returns the parent of a node as a sequence containing zero or one nodes.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.13 string-value アクセサ

dm:string-value($n as node()) as xs:string

dm:string-value アクセサは、ノードの文字列値を返す。 The dm:string-value accessor returns the string value of a node.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.14 type-name アクセサ

dm:type-name($n as node()) as xs:QName?

dm:type-name アクセサは、ノードのスキーマ型の名前を xs:QName の0個以上のシーケンスとして返す。 The dm:type-name accessor returns the name of the schema type of a node as a sequence of zero or one xs:QNames.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.15 typed-value アクセサ

dm:typed-value($n as node()) as xs:anyAtomicType*

dm:typed-value アクセサは、ノードの typed-value を原子値の0個以上のシーケンスとして返す。 The dm:typed-value accessor returns the typed-value of the node as a sequence of zero or more atomic values.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.16 unparsed-entity-public-id アクセサ

dm:unparsed-entity-public-id($node as node(), $entityname  as xs:string) as xs:string?

dm:unparsed-entity-public-id アクセサは、指定された文書で宣言された外部解析対象外実体の公開識別子を返す。 $entityname で指定された名前の実体が存在しない場合, 実体が外部解析対象外実体でない場合, 実体が公開識別子を持たない場合、いずれも空シーケンスが返される。 The dm:unparsed-entity-public-id accessor returns the public identifier of an unparsed external entity declared in the specified document. If no entity with the name specified in $entityname exists, or if the entity is not an external unparsed entity, or if the entity has no public identifier, the empty sequence is returned.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

5.17 unparsed-entity-system-id アクセサ

dm:unparsed-entity-system-id( $node  as node(), $entityname  as xs:string) as xs:anyURI?

dm:unparsed-entity-system-id アクセサは指定された文書で宣言された外部解析対象外実体のシステム識別子を返す。 値は絶対 URI であり、外部解析対象外実体情報項目の [system identifier] を同じ項の [declaration base URI] を基に解決することにより得られる。 $entityname に指定された名前の実体が存在しないか, 実体が外部解析対象外実体でない場合、空シーケンスが返される。 The dm:unparsed-entity-system-id accessor returns the system identifier of an unparsed external entity declared in the specified document. The value is an absolute URI, and is obtained by resolving the [system identifier] of the unparsed entity information item against the [declaration base URI] of the same item. If no entity with the name specified in $entityname exists, or if the entity is not an external unparsed entity, the empty sequence is returned.

7種 のノードすべてに定義される。 It is defined on all seven node kinds.

6 ノード

[定義: データモデルには7種の ノード文書, 要素, 属性, テキスト, 名前空間, 処理命令, コメント がある。 ]
以下の節で各ノード種について述べる。 [Definition: There are seven kinds of Nodes in the data model: document, element, attribute, text, namespace, processing instruction, and comment.] Each kind of node is described in the following sections.

注記: データモデル に基づくホスト言語は データモデル の利用において名前空間ノードを含まないことを指定してもよい。 名前空間ノードは、名前空間接頭辞の名前空間 URI への束縛を記録する要素ノードの「名前空間」プロパティにおいてのみ利用される。 これらの束縛は、名前空間ノードをでも代わりの実装依存の表現でも、いずれを用いて表現されてもよい。 A host language based on the Data Model may specify that its usage of the Data Model does not include namespace nodes. Namespace nodes are used only in the "namespaces" property of an element node, which records the bindings of namespace prefixes to namespace URIs. These bindings may be represented either by means of namespace nodes or by using an alternative, implementation-dependent representation.

すべてのノードは以下の一般制約を満たさなければならない All nodes must satisfy the following general constraints:

  1. どのノードも他のノードから区別し得る一意的な識別子を持っていなければならない Every node must have a unique identity, distinct from all other nodes.

  2. ノードの children プロパティは連続する2つの テキストノード を含んではならない The children property of a node must not contain two consecutive Text Nodes.

  3. ノードの children プロパティは空の テキストノード を含んではならない The children property of a node must not contain any empty Text Nodes.

  4. ノードの childrenattributes プロパティは同じ識別子を持つ2つのノードを含んではならない The children and attributes properties of a node must not contain two nodes with the same identity.

6.1 文書ノード

6.1.1 概観

文書ノード は XML 文書をカプセル化する。 文書は次のプロパティを持つ: Document Nodes encapsulate XML documents. Documents have the following properties:

  • base-uri (空もとり得る)
  • children (空もとり得る)
  • unparsed-entities (空もとり得る)
  • document-uri (空もとり得る)
  • string-value
  • typed-value

文書ノード は次の制約を満たさなければならない Document Nodes must satisfy the following constraints.

  1. children は(空でなければ) 要素, 処理命令, コメント, テキストノード から重複無く構成されていなければならない属性, 名前空間, 文書ノード が子に現れることはない。 The children must consist exclusively of Element, Processing Instruction, Comment, and Text Nodes if it is not empty. Attribute, Namespace, and Document Nodes can never appear as children

  2. ノード N文書ノード Dchildren の中に現れる場合、 NparentDなければならない If a node N is among the children of a Document Node D, then the parent of N must be D.

  3. ノード N文書ノード Dparent に持つ場合、NDchildren に現れなければならない If a node N has a parent Document Node D, then N must be among the children of D.

  4. 文書ノードstring-value プロパティは、すべての子孫 テキストノード の string-value を文書順に連結した string-value を持つ(そのような子孫が存在しない場合は長さ0の文字列とする)。 The string-value property of a Document Node must be the concatenation of the string-values of all its Text Node descendants in document order or, if the document has no such descendants, the zero-length string.

[Infoset] においては、 文書情報項目 は少なくとも1個の子を持たなければならない。 子は 要素情報項目, 処理命令情報項目, コメント情報項目, から重複無く構成されていなければならず、かつ、子のうちきっかり1個が 要素情報項目 でなければならない。 このデータモデルにおいてはこの制約は緩和される: 文書ノード は空でも、複数の 要素ノード を子に持っていてもよく、また、 テキストノード を子に持っていてもよい。 In the [Infoset], a document information item must have at least one child, its children must consist exclusively of element information items, processing instruction information items and comment information items, and exactly one of the children must be an element information item. This data model is more permissive: a Document Node may be empty, it may have more than one Element Node as a child, and it also permits Text Nodes as children.

DTD 処理と解析対象外実体アクセサへのアクセスをサポートする実装は、 unparsed-entities プロパティを利用して順序の無い一連の解析対象外実体の情報と 文書ノード とを結びつける。 このプロパティは dm:unparsed-entity-system-iddm:unparsed-entity-public-id 関数を通して間接的にアクセスされる。 Implementations that support DTD processing and access to the unparsed entity accessors use the unparsed-entities property to associate information about an unordered collection of unparsed entities with a Document Node. This property is accessed indirectly through the dm:unparsed-entity-system-id and dm:unparsed-entity-public-id functions.

6.1.2 アクセサ

dm:attributes

空シーケンスを返す。 Returns the empty sequence

dm:base-uri

base-uri プロパティの値を返す。 Returns the value of the base-uri property.

dm:children

children プロパティの値を返す。 Returns the value of the children property.

dm:document-uri

文書ノード の構築の基になったリソースの絶対 URI を返す。絶対 URI が取得不能ならば空シーケンスを返す。 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:is-id

空シーケンスを返す。 Returns the empty sequence.

dm:is-idrefs

空シーケンスを返す。 Returns the empty sequence.

dm:namespace-bindings

空シーケンスを返す。 Returns the empty sequence

dm:namespace-nodes

空シーケンスを返す。 Returns the empty sequence

dm:nilled

空シーケンスを返す。 Returns the empty sequence

dm:node-kind

document” を返す。 “document”.

dm:node-name

空シーケンスを返す。 Returns the empty sequence.

dm:parent

空シーケンスを返す。 Returns the empty sequence

dm:string-value

string-value プロパティの値を返す。 Returns the value of the string-value property.

dm:type-name

空シーケンスを返す。 Returns the empty sequence.

dm:typed-value

typed-value プロパティの値を返す。 Returns the value of the typed-value property.

dm:unparsed-entity-public-id

指定された解析対象外実体の公開識別子を返す。 そのような実体が無ければ空シーケンスを返す。 Returns the public identifier of the specified unparsed entity or the empty sequence if no such entity exists.

dm:unparsed-entity-system-id

指定された解析対象外実体のシステム識別子を返す。 そのような実体が無ければ空シーケンスを返す。 Returns the system identifier of the specified unparsed entity or the empty sequence if no such entity exists.

6.1.3 情報セットからの構築

文書情報項目 が必須になる。 それぞれの 文書情報項目 に対し 文書ノード が構築される。 The document information item is required. A Document Node is constructed for each document information item.

次の情報セットプロパティが要求される: [children], [base URI] The following infoset properties are required: [children] and [base URI].

次の情報セットプロパティはオプションである: [unparsed entities] The following infoset properties are optional: [unparsed entities].

文書ノード プロパティは次の様にして情報セットから導出される: Document Node properties are derived from the infoset as follows:

base-uri

(もしあれば) [base URI] プロパティの値。 (もしあれば)基底 URI プロパティは URI に許容されない Unicode 文字が含まれるとしても、(絶対 URI が算出可能ならば)常に絶対 URI になることに注意。 これらの文字が出現し、それらが base-uri プロパティ内に存在し、 URI 検索が要求された場合はそれに適した形になるようにアプリケーションにより符号化されエスケープされなければならない。 The value of the [base URI] property, if available. Note that the base URI property, if available, is always an absolute URI (if an absolute URI can be computed) though it may contain Unicode characters that are not allowed in URIs. These characters, if they occur, are present in the base-uri property and will have to be encoded and escaped by the application to obtain a URI suitable for retrieval, if retrieval is required.

実施においては [base URI] が常に判明するとは限らない。この場合、文書ノードの base-uri プロパティの値は空シーケンスになる。 これは基底 URI に依存する一部の処理の失敗をもたらすが、本質的なエラーではない。 In practice a [base URI] is not always known. In this case the value of the base-uri property of the document node will be the empty sequence. This is not intrinsically an error, though it may cause some operations that depend on the base URI to fail.

children

[children] プロパティ内の情報項目から構築されるノードのシーケンス。 The sequence of nodes constructed from the information items found in the [children] property.

[children] プロパティ内に見つかった要素, 処理命令, コメントのそれぞれに対し、 対応する 要素, 処理命令, コメントノード が構築され、そのノードのシーケンスが children プロパティの値に利用される。 For each element, processing instruction, and comment found in the [children] property, a corresponding Element, Processing Instruction, or Comment Node is constructed and that sequence of nodes is used as the value of the children property.

文書型宣言情報項目[children] に存在しても無視される。 If present among the [children], the document type declaration information item is ignored.

unparsed-entities

[unparsed entities] プロパティが存在して空集合でなければ 解析対象外実体情報項目 の値が dm:unparsed-entity-system-iddm:unparsed-entity-public-id アクセサのサポートに利用されなければならない。 If the [unparsed entities] property is present and is not the empty set, the values of the unparsed entity information items must be used to support the dm:unparsed-entity-system-id and dm:unparsed-entity-public-id accessors.

unparsed-entities プロパティの値の内部構造は実装定義とする。 The internal structure of the values of the unparsed-entities property is implementation defined.

string-value

すべての子孫 テキストノード の string-value を文書順に連結したもの(そのような子孫が存在しない場合は長さ0の文字列)。 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

xs:untypedAtomic 値としてのノードの dm:string-value The dm:string-value of the node as an xs:untypedAtomic value.

document-uri

document-uri プロパティは文書ノードの構築の基になったリソースの絶対 URI を保持する( URI が取得可能で絶対 URI が導出できれば)。 例えば、 fn:collection 関数から返された一連の文書のそれぞれの base-uri プロパティが同じであっても、 document-uri プロパティがそれらを区別する役割を果たす。 The document-uri property holds the absolute URI for the resource from which the document node was constructed, if one is available and can be made absolute. For example, if a collection of documents is returned by the fn:collection function, the document-uri property may serve to distinguish between them even though each has the same base-uri property.

document-uri が空シーケンスでなければ、次の制約が課される: fn:doc()document-uri を引数として評価したときに返されるノードは document-uri プロパティの値を与えた文書ノードでなければならない。 If the document-uri is not the empty sequence, then the following constraint must hold: the node returned by evaluating fn:doc() with the document-uri as its argument must return the document node that provided the value of the document-uri property.

すなわち、どの 文書ノード $arg に対しても fn:document-uri($arg) は、空シーケンスを返すか, または fn:doc(fn:document-uri($arg))$arg を返さなければならない。 In other words, for any Document Node $arg, either fn:document-uri($arg) must return the empty sequence or fn:doc(fn:document-uri($arg)) must return $arg.

6.1.4 PSVI からの構築

PSVI からの構築は情報セットからの構築と同一である。 Construction from a PSVI is identical to construction from the Infoset.

6.1.5 情報セットとの対応付け

文書ノード文書情報項目 に対応付けられる。 文書ノード が空白のみではない子 テキストノード を含むか、または 文書ノード が1個以上の子 要素ノード を含む場合、対応付けは成立せず、何の値も生成されない。 A Document Node maps to a document information item. The mapping fails and produces no value if the Document Node contains Text Node children that do not consist entirely of white space or if the Document Node contains more than one Element Node child.

次のプロパティがこの対応付けにより指定される: The following properties are specified by this mapping:

[children]

情報項目のリストは、 dm:children の各ノードを順に処理し、それぞれを適切な情報項目に対応付けることにより得られる。 A list of information items obtained by processing each of the dm:children in order and mapping each to the appropriate information item(s).

[document element]

[children] に現れる 要素情報項目 The element information item that is among the [children].

[unparsed entities]

unparsed-entities から構築される順序の無い 解析対象外実体情報項目 の集合。 An unordered set of unparsed entity information items constructed from the unparsed-entities.

各解析対象外実体は 解析対象外実体情報項目 に対応付けられる。 次のプロパティがこの対応付けにより指定される: Each unparsed entity maps to an unparsed entity information item. The following properties are specified by this mapping:

[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]

実装定義。 多くの場合、 document-uri が正答であり、実装は、よりよい情報を持っていなければ、この値を利用しなければならない。 実体の元々の [declaration base URI] を保持する実装はその値を利用すべきである。 Implementation defined. In the many cases, the document-uri is the correct answer and implementations must use this value if they have no better information. Implementations that keep track of the original [declaration base URI] for entities should use that value.

解析対象外実体情報項目 の次のプロパティは値を持たない: [notation name], [notation] The following properties of the unparsed entity information item have no value: [notation name], [notation].

文書情報項目 の次のプロパティは値を持たない: [notations] [character encoding scheme] [standalone] [version] [all declarations processed] The following properties of the document information item have no value: [notations][character encoding scheme][standalone][version][all declarations processed].

6.2 要素ノード

6.2.1 概観

要素ノード は XML 要素をカプセル化する。 要素は次のプロパティを持つ: Element Nodes encapsulate XML elements. Elements have the following properties:

  • base-uri (空もとり得る)
  • node-name
  • parent (空もとり得る)
  • type-name schema-type
  • children (空もとり得る)
  • attributes (空もとり得る)
  • namespaces
  • nilled
  • string-value
  • typed-value
  • is-id
  • is-idrefs

要素ノード は次の制約を満たさなければならない Element Nodes must satisfy the following constraints.

  1. children は(空でなければ) 要素, 処理命令, コメント, テキストノード から重複無く構成されていなければならない属性, 名前空間, 文書ノード が子に現れることは無い。 The children must consist exclusively of Element, Processing Instruction, Comment, and Text Nodes if it is not empty. Attribute, Namespace, and Document Nodes can never appear as children

  2. 要素の 属性ノード は互いに異なる xs:QName を持たなければならない The Attribute Nodes of an element must have distinct xs:QNames.

  3. ノード N が 要素 Echildren に現れるとき、 NparentE でなければならない。 If a node N is among the children of an element E, then the parent of N must be E.

  4. 属性, 名前空間ノード を除き、ノード Nparent に要素 E を持つならば NEchildren に現れなければならない属性, 名前空間ノード は親を持つが、その親の子には現れない。) Exclusive of Attribute and Namespace Nodes, if a node N has a parent element E, then N must be among the children of E. (Attribute and Namespace Nodes have a parent, but they do not appear among the children of their parent.)

    データモデルでは親のない 要素ノード も許容される(例えば式の処理過程で部分的な結果を表現するため)。 そのような 要素ノード は他のどのノードの children にも現れてはならない The data model permits Element Nodes without parents (to represent partial results during expression processing, for example). Such Element Nodes must not appear among the children of any other node.

  5. 属性ノード A が要素 Eattributes に現れるとき、 AparentEなければならない If an Attribute Node A is among the attributes of an element E, then the parent of A must be E.

  6. 属性ノード Aparent に要素 E を持つとき、 AEattributes に現れなければならない If an Attribute Node A has a parent element E, then A must be among the attributes of E.

    データモデルでは親の無い 属性ノード も許容される。 そのような 属性ノード は、どの 要素ノードattributes にも現れてはならない The data model permits Attribute Nodes without parents. Such Attribute Nodes must not appear among the attributes of any Element Node.

  7. 名前空間ノード N が要素 E の namespaces に現れるとき、N の親は Eなければならない If a Namespace Node N is among the namespaces of an element E, then the parent of N must be E.

  8. 名前空間ノード N が親に要素 E を持つとき、 NEnamespaces に現れなければならない If a Namespace Node N has a parent element E, then N must be among the namespaces of E.

    データモデルでは親の無い 名前空間ノード も許容される。 そのような 名前空間ノード は、どの 要素ノードnamespaces にも現れてはならない。 この制約は 名前空間ノード をサポートしない実装には無関係なものになる。 The data model permits Namespace Nodes without parents. Such Namespace Nodes must not appear among the namespaces of any Element Node. This constraint is irrelevant for implementations that do not support Namespace Nodes.

  9. 要素ノードdm:type-namexs:untyped の場合、そのすべての子孫要素の dm:type-namexs:untypedなければならず 、 そのすべての 属性ノードdm:type-namexs:untypedAtomicなければならない If the dm:type-name of an Element Node is xs:untyped, then the dm:type-name of all its descendant elements must also be xs:untyped and the dm:type-name of all its Attribute Nodes must be xs:untypedAtomic.

  10. 要素ノードdm:type-namexs:untyped の場合、 nilled プロパティは falseなければならない If the dm:type-name of an Element Node is xs:untyped, then the nilled property must be false.

  11. nilled プロパティが true の場合、 children プロパティは 要素ノードテキストノード を含んではならない If the nilled property is true, then the children property must not contain Element Nodes or Text Nodes.

  12. 要素の dm:node-name に現れるどの 展開 QName に対しても、あるいは要素の attributes に現れるどの 属性ノードdm:node-name に対しても、あるいは要素の typed-value またはその要素の任意の属性の typed-value に現れるどの xs:QName または xs:NOTATION 型(またはこれらの型から派生する任意の型)の値に対しても、展開 QName が 空でない URI ならば、その 要素ノードnamespaces に、この URI に対する接頭辞束縛が現れなければならない For every expanded QName that appears in the dm:node-name of the element, the dm:node-name of any Attribute Node among the attributes of the element, or in any value of type xs:QName or xs:NOTATION (or any type derived from those types) that appears in the typed-value of the element or the typed-value of any of its attributes, if the expanded QName has a non-empty URI, then there must be a prefix binding for this URI among the namespaces of this Element Node.

    いずれかの展開 QName が空の URI を持つ場合、この 要素ノードnamespaces の中に URI を空の接頭辞に束縛するものが現れてはならない If any of the expanded QNames has an empty URI, then there must not be any binding among the namespaces of this Element Node which binds the empty prefix to a URI.

  13. どの要素も接頭辞 xml を URI http://www.w3.org/XML/1998/namespace に束縛する 名前空間ノード もしくは名前空間束縛を含んでなければならず、その URI に束縛される他の接頭辞が存在してはならない。 Every element must include a Namespace Node and/or namespace binding for the prefix xml bound to the URI http://www.w3.org/XML/1998/namespace and there must be no other prefix bound to that URI.

  14. 要素ノードstring-value プロパティはそのすべての子孫 テキストノードstring-value を文書順に連結したもの(要素がそのような子孫を持っていなければ長さ0の文字列)でなければならない。 The string-value property of an Element Node must be the concatenation of the string-values of all its Text Node descendants in document order or, if the element has no such descendants, the zero-length string.

6.2.2 アクセサ

dm:attributes

attributes プロパティの値を返す。 属性ノード の順序は安定かつ実装依存になる。 Returns the value of the attributes property. The order of Attribute Nodes is stable but implementation dependent.

dm:base-uri

base-uri プロパティの値を返す。 Returns the value of the base-uri property.

dm:children

children プロパティの値を返す。 Returns the value of the children property.

dm:document-uri

空シーケンスを返す。 Returns the empty sequence.

dm:is-id

is-id プロパティの値を返す。 Returns the value of the is-id property.

dm:is-idrefs

is-idrefs プロパティの値を返す。 Returns the value of the is-idrefs property.

dm:namespace-bindings

接頭辞/URI の組として namespaces プロパティの値を返す。 Returns the value of the namespaces property as a set of prefix/URI pairs.

dm:namespace-nodes

名前空間ノード のシーケンスとして namespaces プロパティの値を返す。 名前空間ノード の順序は安定かつ実装依存になる。 Returns the value of the namespaces property as a sequence of Namespace Nodes. The order of Namespace Nodes is stable but implementation dependent.

dm:nilled

nilled プロパティの値を返す。 Returns the value of the nilled property.

dm:node-kind

element” を返す。 Returns “element”.

dm:node-name

node-name プロパティの値を返す。 Returns the value of the node-name property.

dm:parent

parent プロパティの値を返す。 Returns the value of the parent property.

dm:string-value

string-value プロパティの値を返す。 Returns the value of the string-value property.

dm:type-name

type-name schema-type プロパティの値を返す。 Returns the value of the type-name schema-type property.

dm:typed-value

typed-value プロパティの値を返す。 Returns the value of the typed-value property.

dm:unparsed-entity-public-id

空シーケンスを返す。 Returns the empty sequence.

dm:unparsed-entity-system-id

空シーケンスを返す。 Returns the empty sequence.

6.2.3 情報セットからの構築

要素情報項目 が必須になる。 それぞれの 要素情報項目 に対し 要素ノード が構築される。 The element information items are required. An Element Node is constructed for each element information item.

次の情報セットプロパティが要求される: [namespace name], [local name], [children], [attributes], [in-scope namespaces], [base URI], [parent] The following infoset properties are required: [namespace name], [local name], [children], [attributes], [in-scope namespaces], [base URI], and [parent].

要素ノード プロパティは次の様にして情報セットから導出される: Element Node properties are derived from the infoset as follows:

base-uri

(もしあれば) [base URI] プロパティの値。 (もしあれば)基底 URI プロパティは URI に許容されない Unicode 文字が含まれるとしても、(絶対 URI が算出可能ならば)常に絶対 URI になることに注意。 これらの文字が出現し、それらが base-uri プロパティ内に存在し、 URI 検索が要求された場合はそれに適した形になるようにアプリケーションにより符号化されエスケープされなければならない。 The value of the [base URI] property, if available. Note that the base URI property, if available, is always an absolute URI (if an absolute URI can be computed) though it may contain Unicode characters that are not allowed in URIs. These characters, if they occur, are present in the base-uri property and will have to be encoded and escaped by the application to obtain a URI suitable for retrieval, if retrieval is required.

実施においては [base URI] が常に判明するとは限らない。この場合、文書ノードの base-uri プロパティの値は空シーケンスになる。 これは基底 URI に依存する一部の処理の失敗をもたらすが、本質的なエラーではない。 In practice a [base URI] is not always known. In this case the value of the base-uri property of the document node will be the empty sequence. This is not intrinsically an error, though it may cause some operations that depend on the base URI to fail.

node-name

[prefix], [local name], [namespace name] プロパティから構築される xs:QName An xs:QName constructed from the [prefix], [local name], and [namespace name] properties.

parent

[parent] プロパティの値に対応するノード。ただし、親が無い場合は空シーケンス。 The node that corresponds to the value of the [parent] property or the empty sequence if there is no parent.

type-name schema-type

情報セットから構築されるすべての 要素ノード は型 xs:untyped を持つ。 All Element Nodes constructed from an infoset have the type xs:untyped.

children

[children] プロパティ内の情報項目から構築されるノードのシーケンス。 The sequence of nodes constructed from the information items found in the [children] property.

[children] プロパティに現れるそれぞれの要素, 処理命令, コメント, 互いに隣接する 文字情報項目 の最長の連なり, に対し、対応する 要素, 処理命令, コメント, テキストノード, が構築され、そのノードのシーケンスが children プロパティの値に利用される。 For each element, processing instruction, comment, and maximal sequence of adjacent character information items found in the [children] property, a corresponding Element, Processing Instruction, Comment, or Text Node is constructed and that sequence of nodes is used as the value of the children property.

データモデルではすべての一般実体の展開が要求されるので 未展開の実体参照情報項目 は子として生じ得ない。 Because the data model requires that all general entities be expanded, there will never be unexpanded entity reference information item children.

attributes

[attributes] プロパティに現れる 属性情報項目 から構築される 属性ノード の集合。 これにはすべての「特別」な属性( xml:lang, xml:space, xsi:type, 等々)も含まれる。 ただし、名前空間宣言は含まれない(名前空間宣言は属性ではないので)。 A set of Attribute Nodes constructed from the attribute information items appearing in the [attributes] property. This includes all of the "special" attributes (xml:lang, xml:space, xsi:type, etc.) but does not include namespace declarations (because they are not attributes).

DTD から与えられる既定( default )と固定( fixed )の属性は [attributes] に追加され、従って要素のデータモデル attributes に含まれる。 Default and fixed attributes provided by the DTD are added to the [attributes] and are therefore included in the data model attributes of an element.

namespaces

[in-scope namespaces] プロパティに現れる 名前空間情報項目 から構築される 名前空間ノード の集合。 名前空間ノード をサポートしない実装は単に関連する束縛をこのプロパティに保持するだけでよい。 A set of Namespace Nodes constructed from the namespace information items appearing in the [in-scope namespaces] property. Implementations that do not support Namespace Nodes may simply preserve the relevant bindings in this property.

実装は利用されることがわかっていない名前空間に対する 名前空間情報項目 を無視してよい。 利用されることがわかっている名前空間とは: Implementations may ignore namespace information items for namespaces which are not known to be used. A namespace is known to be used if:

  • 要素の node-name展開 QName に現れるもの。 It appears in the expanded QName of the node-name of the element.

  • 要素の属性の node-name展開 QName に現れるもの。 It appears in the expanded QName of the node-name of any of the element's attributes.

注記: アプリケーションは利用されることがわかっていない名前空間に依存し得る。 例えば xs:QName の型を持たない内容に 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 Such applications may have difficulty processing data models where some namespaces have been ignored.

nilled

情報セットから構築されるすべての 要素ノード は値 " false " の nilled プロパティを持つ。 All Element Nodes constructed from an infoset have a nilled property of " false ".

string-value

string-value は要素とそのすべての子孫の 文字情報項目 [children] から構築される。 対象にすべき 文字情報項目 の選択とそれらからの文字たちの構築についての正確な規則は 6.7 テキストノード6.7.3 情報セットからの構築 で述べる。 The string-value is constructed from the character information items [children] of the element and all its descendants. The precise rules for selecting significant character information items and constructing characters from them is described in 6.7.3 Construction from an Infoset of 6.7 Text Nodes.

このプロセスは、結果の 要素ノード の すべての子孫 テキストノードdm:string-value を連結することに同値である。 This process is equivalent to concatenating the dm:string-values of all of the Text Node descendants of the resulting Element Node.

要素がそのような子孫を持たない場合、 string-value は空文字列になる。 If the element has no such descendants, the string-value is the empty string.

typed-value

xs:untypedAtomic としての string-value The string-value as an xs:untypedAtomic.

is-id

情報セットから構築されるすべての 要素ノード は値 " false " の is-id プロパティを持つ。 All Element Nodes constructed from an infoset have a is-id property of " false ".

is-idrefs

情報セットから構築されるすべての 要素ノード は値 " false " の is-idrefs プロパティを持つ。 All Element Nodes constructed from an infoset have a is-idrefs property of " false ".

6.2.4 PSVI からの構築

次の 要素ノード プロパティは PSVI プロパティから影響される: The following Element Node properties are affected by PSVI properties.

type-name schema-type

type-name schema-type3.3.1.1 要素, 属性ノード の型 に従って決定される。 The type-nameschema-type is determined as described in 3.3.1.1 Element and Attribute Node Type Names.

children

[children] プロパティに現れる情報項目から構築されるノードのシーケンス。 The sequence of nodes constructed from the information items found in the [children] property.

[children] プロパティに現れるそれぞれの要素, 処理命令, コメント, 互いに隣接する 文字情報項目 の最長の連なり, に対し、対応する 要素, 処理命令, コメント, テキストノード, が構築され、そのノードのシーケンスが children プロパティの値に利用される。 For each element, processing instruction, comment, and maximal sequence of adjacent character information items found in the [children] property, a corresponding Element, Processing Instruction, Comment, or Text Node is constructed and that sequence of nodes is used as the value of the children property.

スキーマ単純型を伴う要素や単純内容を伴う複合型に対しては、 [schema normalized value] PSVI プロパティが存在する場合、プロセッサは、 [children] プロパティに現れる 処理命令情報項目コメント情報項目 に対応する 処理命令, コメントノード, 加えて、オプションで文字列値が children プロパティの [schema normalized value] になる1個の テキストノード も含む, ノードのシーケンスを利用してもよい[schema normalized value] が空文字列の場合、 テキストノード が存在してはならない For elements with schema simple types, or complex types with simple content, if the [schema normalized value] PSVI property exists, the processor may use a sequence of nodes containing the Processing Instruction and Comment Nodes corresponding to the processing instruction and comment information items found in the [children] property, plus an optional single Text Node whose string value is the [schema normalized value] for the children property. If the [schema normalized value] is the empty string, the Text Node must not be present, otherwise it must be present.

処理命令, コメントノード の相対順序は保持されなければならないが、それらの中での テキストノード の位置は( テキストノード が存在するならば)実装定義になる。 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.

上の規則により、要素の固定値( fixed )や既定値( default )はスキーマで定義されていて、要素がこの既定値をとる所では、 PSVI 内に値を表現する文字情報項目が無くても、その値を持つテキストノードが作成されることになる。 この子テキストノードの子コメントや子処理命令に対する相対位置は実装依存とする。 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] では既定値または固定値(常に単純値になる)をとる混成内容を伴う要素が許容されるが、この仕様が書かれた時点では、そのような既定にされた値が PSVI においてどのように表現されるかについて明確化されていない。 従って、実装はそのような既定値をテキストノードの作成により表現してもよいが、そうすることは要求されていない。 [Schema Part 1] also permits an element with mixed content to take a default or fixed value (which will always be a simple value), but at the time of this writing it is unclear how such a defaulted value is represented in the PSVI. Implementations therefore may represent such a default value by creating a text node, but are not required to do so.

データモデルではすべての一般実体の展開が要求されるので 未展開の実体参照情報項目 は子に生じ得ない。 Because the data model requires that all general entities be expanded, there will never be unexpanded entity reference information item children.

attributes

[attributes] プロパティに現れる 属性情報項目 から構築される 属性ノード の集合。 これにはすべての「特別な」属性( xml:lang, xml:space, xsi:type, 等々)も含まれる。 ただし、名前空間宣言は含まれない(名前空間宣言は属性ではないので)。 A set of Attribute Nodes constructed from the attribute information items appearing in the [attributes] property. This includes all of the "special" attributes (xml:lang, xml:space, xsi:type, etc.) but does not include namespace declarations (because they are not attributes).

XML Schema 処理から与えられる既定および固定属性は [attributes] に追加され、従って要素のデータモデル attributes に含まれる。 Default and fixed attributes provided by XML Schema processing are added to the [attributes] and are therefore included in the data model attributes of an element.

namespaces

[in-scope namespaces] プロパティに現れる 名前空間情報項目 から構築される 名前空間ノード の集合。 名前空間ノード をサポートしない実装は単に関連する束縛をこのプロパティに保持するだけでよい。 A set of Namespace Nodes constructed from the namespace information items appearing in the [in-scope namespaces] property. Implementations that do not support Namespace Nodes may simply preserve the relevant bindings in this property.

実装は利用されることがわかっていない名前空間に対する 名前空間情報項目 を無視してよい。 利用されることがわかっている名前空間とは: Implementations may ignore namespace information items for namespaces which are not known to be used. A namespace is known to be used if:

  • 要素の node-name展開 QName に現れるもの。 It appears in the expanded QName of the node-name of the element.

  • 要素の属性の node-name展開 QName に現れるもの。 It appears in the expanded QName of the node-name of any of the element's attributes.

  • 要素の子またはその属性の型付き値に現れる xs:QName 型の任意の値の 展開 QName に現れるもの。 It appears in the expanded QName of any values of type xs:QName that appear among the element's children or the typed values of its attributes.

注記: アプリケーションは利用されることがわかっていない名前空間に依存し得る。 例えば xs:QName 型を持たない内容に 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 Such applications may have difficulty processing data models where some namespaces have been ignored.

nilled

情報項目に [validity] プロパティが存在して " valid " であり、 [nil] プロパティが存在して true であるならば、 nilled プロパティは " true " である。 他のすべての場合(スキーマ妥当性査定が行われていない場合や検証を通らなかった場合も含め)、 nilled プロパティは " false " になる。 If the [validity] property exists on an information item and is " valid " then if the [nil] property exists and is true, then the nilled property is " true ". In all other cases, including all cases where schema validity assessment was not attempted or did not succeed, the nilled property is "false".

string-value

string-value は次のように算出される: The string-value is calculated as follows:

  • 要素が空の場合:その文字列値は長さ0の文字列。 If the element is empty: its string value is the zero length string.

  • 要素が型 xs:untyped を持つ場合、 element-only 内容の複合型または混成内容の複合型に対しては: そのすべての子孫 テキストノードstring-value を文書順に連結したもの。 If the element has a type of xs:untyped, a complex type with element-only content, or a complex type with mixed content: its string-value is the concatenation of the string-values of all its Text Node descendants in document order.

  • 要素が単純型または単純内容を伴う複合型を持つ場合: その string-value はノードの [schema normalized value] になる。 If the element has a simple type or a complex type with simple content: its string-value is the [schema normalized value] of the node.

要素の型付き値のみを記憶する実装は string-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 property.

typed-value

typed-value は次のようにして算出される: The typed-value is calculated as follows:

  • 要素の型が xs:untyped の場合、その typed-value は xs:untypedAtomic としての要素の dm:string-value If the element is of type xs:untyped, its typed-value is its dm:string-value as an xs:untypedAtomic.

  • 要素が空の内容を伴う複合型を持つ場合、その typed-value は空シーケンス。 If the element has a complex type with empty content, its typed-value is the empty sequence.

  • 要素が単純型または単純内容を伴う複合型を持つ場合:その型付き値は 3.3.1.2 型付き値の決定 で述べるようにして算出される。 結果は0個以上の原子値のシーケンスになる。 要素ノードの type-name, typed-value, string-value の関係は XML Schema 妥当性検証に整合する。 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. The result is a sequence of zero or more atomic values. The relationship between the type-name, typed-value, and string-value of an element node is consistent with XML Schema validation.

    日付と時刻の場合、等時帯は 3.3.2 日付と時刻 で述べた形に保持され、 xs:QNamexs:NOTATION の場合、接頭辞は 3.3.3 QName と NOTATION で述べた形に保持されることに注意。 Note that in the case of dates and times, the timezone is preserved as described in 3.3.2 Dates and Times, and in the case of xs:QNames and xs:NOTATIONs, the prefix is preserved as described in 3.3.3 QNames and NOTATIONS.

  • 要素が混成内容を伴う複合型( xs:anyType も含む)を持つ場合、要素の typed-value は xs:untypedAtomic としての要素の dm:string-value If the element has a complex type with mixed content (including xs:anyType), its typed-value is its dm:string-value as an xs:untypedAtomic.

  • 他の場合、要素は element-only 内容を伴う複合型でなければならない。 そのような要素の typed-value は 未定義 存在しない とする。 dm:typed-value アクセサによるこのプロパティへのアクセスは常にエラーを生じさせる。 Otherwise, the element must be a complex type with element-only content. The typed-value of such an element is undefinedundefined. Attempting to access this property with the dm:typed-value accessor always raises an error.

is-id

要素が element-only 内容を伴う複合型の場合、 is-id プロパティは false になる。 他の場合、 要素の typed-value がきっかり1個の xs:ID 型(またはその派生型)の原子値からなるならば is-id プロパティは true, そうでなければ false になる。 If the element has a complex type with element-only content, the is-id property is false. Otherwise, if the typed-value of the element consists of exactly one atomic value and that value is of type xs:ID, or a type derived from xs:ID, the is-id property is true, otherwise it is false.

注記: これは、型が xs:ID からのリストで構築されている場合、リストの長さが1であればその ID が認識されることを意味する。 xs:ID を含む共用体として構築された型は実際の型が xs:ID 型であれば認識される。 This means that in the case of a type constructed by list from xs:ID, the ID is recognized provided that the list is of length one. A type constructed as a union involving xs:ID is recognized provided the actual value is of type xs:ID.

注記: is-id プロパティでマークされた要素、従って fn:id 関数で取得できる要素が、型付き値に xs:ID 値を持つノードである。 XML Schema に従えば、このノードがこの ID により一意的に識別される要素ノードの子である。 The element that is marked with the is-id property, and which will therefore be retrieved by the fn:id function, is the node whose typed value contains the xs:ID value. This node is a child of the element node that, according to XML Schema, is uniquely identified by this ID.

is-idrefs

要素が element-only 内容を伴う複合型である場合、 is-idrefs プロパティは false になる。 他の場合、要素の typed-value 内のどれかの原子値が xs:IDREF 型か xs:IDREFS型(またはそれらの派生型)ならば is-idrefs プロパティは true になり、そうでなければ false になる。 If the element has a complex type with element-only content, the is-idrefs property is false. Otherwise, if any of the atomic values in the typed-value of the element is of type xs:IDREF or xs:IDREFS, or a type derived from one of those types, the is-idrefs property is true, otherwise it is false.

他のすべてのプロパティは情報セットから構築される値と整合する値を持つ。 All other properties have values that are consistent with construction from an infoset.

6.2.5 情報セットとの対応付け

要素ノード要素情報項目 に対応付けられる。 An Element Node maps to an element information item.

次のプロパティがこの対応付けにより指定される: The following properties are specified by this mapping:

[namespace name]

dm:node-name の値の名前空間名。 The namespace name of the value of dm:node-name.

[local name]

dm:node-name の値の局所部。 The local part of the value of dm:node-name.

[prefix]

dm:node-name の値に結びつけられた接頭辞。 The prefix associated with the value of dm:node-name.

[children]

dm:children を順に処理してそれぞれを適切な情報項目に対応付けることにより得られる情報項目のリスト。 A list of information items obtained by processing each of the dm:children in order and mapping each to the appropriate information item(s).

[attributes]

dm:attributes を処理してそれぞれを適切な情報項目に対応付けることにより得られる順序の無い情報項目の集合。 An unordered set of information items obtained by processing each of the dm:attributes and mapping each to the appropriate information item(s).

[in-scope namespaces]

namespaces から構築される順序の無い 名前空間情報項目 の集合。 An unordered set of namespace information items constructed from the namespaces.

スコープに入る各名前空間は 名前空間情報項目 に対応する。 次のプロパティがこの対応付けにより指定される: Each in-scope namespace maps to a namespace information item. The following properties are specified by this mapping:

[prefix]

名前空間に結びつけられた接頭辞。 The prefix associated with the namespace.

[namespace name]

名前空間に結びつけられた URI 。 The URI associated with the namespace.

[base URI]

dm:base-uri の値。 The value of dm:base-uri.

[parent]
  • このノードが情報セットの対応付け処理のルートの場合、 unknown If this node is the root of the infoset mapping operation, unknown.

  • このノードが親を持つ場合、 dm:parent から返されるノードに対応する情報項目。 If this node has a parent, the information item that corresponds to the node returned by dm:parent.

  • 他の場合 no value Otherwise no value.

次のプロパティは値を持たない: [namespace attributes] The following property has no value: [namespace attributes].

6.3 属性ノード

6.3.1 概観

属性ノード は XML 属性を表現する。 属性は次のプロパティを持つ: Attribute Nodes represent XML attributes. Attributes have the following properties:

  • node-name
  • parent (空もとり得る)
  • type-name schema-type
  • string-value
  • typed-value
  • is-id
  • is-idrefs

属性ノード は次の制約を満たさなければならない Attribute Nodes must satisfy the following constraints.

  1. 属性ノード A が要素 Eattributes に現れる場合、 AparentEなければならない If an Attribute Node A is among the attributes of an element E, then the parent of A must be E.

  2. 属性ノード A が親要素 E の場合、 AEattributes に現れなければならない If a Attribute Node A has a parent element E, then A must be among the attributes of E.

    データモデルでは親の無い 属性ノード も許容される(例えば式の処理過程で部分的な結果を表現するため)。 そのような 名前空間ノード は、どの 要素ノードattributes にも現れてはならない The data model permits Attribute Nodes without parents (to represent partial results during expression processing, for example). Such attributes must not appear among the attributes of any Element Node.

  3. 属性ノードの node-name において名前空間 URI が存在するならば接頭辞も存在しなければならない In the node-name of an attribute node, if a namespace URI is present then a prefix must also be present.

簡便のため、この属性を所有する 要素ノード をその「親」と呼ぶ(属性ノード はその親要素の「子」にはならないが)。 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.

6.3.2 アクセサ

dm:attributes

空シーケンスを返す。 Returns the empty sequence.

dm:base-uri

属性の親の dm:base-uri の値を返す。属性に親が無ければ空シーケンスを返す。 If the attribute has a parent, returns the value of the dm:base-uri of its parent; otherwise it returns the empty sequence.

dm:children

空シーケンスを返す。 Returns the empty sequence.

dm:document-uri

空シーケンスを返す。 Returns the empty sequence.

dm:is-id

is-id プロパティの値を返す。 Returns the value of the is-id property.

dm:is-idrefs

is-idrefs プロパティの値を返す。 Returns the value of the is-idrefs property.

dm:namespace-bindings

空シーケンスを返す。 Returns the empty sequence.

dm:namespace-nodes

空シーケンスを返す。 Returns the empty sequence.

dm:nilled

空シーケンスを返す。 Returns the empty sequence.

dm:node-kind

attribute” を返す。 Returns “attribute”.

dm:node-name

node-name プロパティの値を返す。 Returns the value of the node-name property.

dm:parent

parent プロパティの値を返す。 Returns the value of the parent property.

dm:string-value

string-value プロパティの値を返す。 Returns the value of the string-value property.

dm:type-name

type-name schema-type プロパティの値を返す。 Returns the value of the type-name schema-type property.

dm:typed-value

typed-value プロパティの値を返す。 Returns the value of the typed-value property.

dm:unparsed-entity-public-id

空シーケンスを返す。 Returns the empty sequence.

dm:unparsed-entity-system-id

空シーケンスを返す。 Returns the empty sequence.

6.3.3 情報セットからの構築

属性情報項目 が必須になる。 それぞれの 属性情報項目 に対し 属性ノード が構築される。 The attribute information items are required. An Attribute Node is constructed for each attribute information item.

次の情報セットプロパティが要求される: [namespace name], [local name], [normalized value], [attribute type], [owner element] The following infoset properties are required: [namespace name], [local name], [normalized value], [attribute type], and [owner element].

属性ノード プロパティは次の様にして情報セットから導出される: Attribute Node properties are derived from the infoset as follows:

node-name

[prefix], [local name], [namespace name] プロパティから構築される xs:QName An xs:QName constructed from the [prefix], [local name], and [namespace name] properties.

parent

[owner element] プロパティの値に対応する 要素ノード 。 owner が存在しない場合は空シーケンス。 The Element Node that corresponds to the value of the [owner element] property or the empty sequence if there is no owner.

type-name schema-type

xs:untypedAtomic The value xs:untypedAtomic.

string-value

属性の [normalized value] The [normalized value] of the attribute.

typed-value

属性の typed-value は xs:untypedAtomic として属性の dm:string-value The attribute’s typed-value is its dm:string-value as an xs:untypedAtomic.

is-id

属性名に xml:id が与えられていて属性の [attribute type] プロパティが値 ID を持たない場合、 [xml:id] の処理が行われる。 これにより、値は型 ID を持つようになり、正しく正規化されるようになる。 xml:id の処理の間にエラーが生じた場合、実装は動的エラーを生じさせてもよい。 名前が xml:id の属性の is-id プロパティは常に true になる。 If the attribute is named xml:id and its [attribute type] property does not have the value ID, then [xml:id] processing is performed. This will assure that the value does have the type ID and that it is properly normalized. If an error is encountered during xml:id processing, an implementation may raise a dynamic error. The is-id property is always true for attributes named xml:id.

[attribute type] プロパティが値 ID を持つならば true, そうでなければ false If the [attribute type] property has the value ID, true, otherwise false.

is-idrefs

[attribute type] プロパティが値 IDREF または IDREFS を持つならば true, そうでなければ false If the [attribute type] property has the value IDREF or IDREFS, true, otherwise false.

6.3.4 PSVI からの構築

次の 属性ノード プロパティは PSVI プロパティから影響される: The following Attribute Node properties are affected by PSVI properties.

string-value
  • 存在すれば [schema normalized value] PSVI プロパティ。 The [schema normalized value] PSVI property if that exists.

  • そうでなければ [normalized value] プロパティ。 Otherwise, the [normalized value] property.

属性の型付き値のみを記憶する実装は string-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 property.

type-name schema-type

type-name schema-type3.3.1.1 要素, 属性ノード の型 に従って決定される。 The type-nameschema-type is determined as described in 3.3.1.1 Element and Attribute Node Type Names.

typed-value は次のように算出される: The typed-value is calculated as follows:

  • 属性の型が xs:untyped の場合、その typed-value はxs:untypedAtomic として属性の dm:string-value If the attribute is of type xs:untypedAtomic: its typed-value is its dm:string-value as an xs:untypedAtomic.

  • 他の場合、 3.3.1.2 型付き値の決定 で述べたように0個以上の原子値のシーケンスになる。 属性ノードの type-name, typed-value, string-value の関係は XML Schema 妥当性検証に整合する。 Otherwise, a sequence of zero or more atomic values as described in 3.3.1.2 Typed Value Determination. The relationship between the type-name, typed-value, and string-value of an attribute node is consistent with XML Schema validation.

is-id

属性名が xml:id で属性の [attribute type] プロパティが値 xs:ID または xs:ID の派生型を持つ場合、 [xml:id] の処理が行われる。 これにより、値は型 xs:ID を持ち、正しく正規化されるようになる。 xml:id の処理の間にエラーが生じた場合、実装は動的エラーを生じさせてもよい。 名前が xml:id の属性の is-id プロパティは常に true になる。 If the attribute is named xml:id and its [attribute type] property does not have the value xs:ID or a type derived from xs:ID, then [xml:id] processing is performed. This will assure that the value does have the type xs:ID and that it is properly normalized. If an error is encountered during xml:id processing, an implementation may raise a dynamic error. The is-id property is always true for attributes named xml:id.

他の場合、属性の typed-value がきっかり1個の原子値からなり、その値が xs:ID 型またはその派生型ならば is-id プロパティは true, そうでなければ false になる。 If the type-name is xs:ID or a type derived from xs:ID, true, otherwise false. Otherwise, if the typed-value of the attribute consists of exactly one atomic value and that value is of type xs:ID, or a type derived from xs:ID, the is-id property is true, otherwise it is false.

注記: これは、型が xs:ID からのリストから構築されている場合、その ID はリストの長さが1であれば認識されることを意味する。 xs:ID を含む共用体として構築された型は実際の値が xs:ID 型であれば認識される。 Note: This means that in the case of a type constructed by list from xs:ID, the ID is recognized provided that the list is of length one. A type constructed as a union involving xs:ID is recognized provided the actual value is of type xs:ID.

is-idrefs

属性の typed-value 内のどれかの原子値が xs:IDREF 型か xs:IDREFS型(またはそれらの派生型)ならば is-idrefs プロパティは true, そうでなければ false になる。 If any of the atomic values in the typed-value of the attribute is of type xs:IDREF or xs:IDREFS, or a type derived from one of those types, the is-idrefs property is true, otherwise it is false.

注記: この規則は、 xs:IDREF 型(またはその派生型)の項のリストとして構築される型は、リストの型が xs:IDREFS と名付けられているかまたは xs:IDREFS の派生型になっているか, あるいはそのいずれでもないか, を示す is-idrefs プロパティを持つことを意味する。 共用体型も許容されるので、 is-idrefs プロパティを伴う要素や属性は xs:IDREF 型の原子値も他の型の値と並んで含み得ることも意味する。 Note: This rule means that a type constructed by list with an item type of xs:IDREF (or a type derived from xs:IDREF) has the is-idrefs property, whether or not the list type is named xs:IDREFS or is derived from xs:IDREFS. Because union types are allowed, it also means that an element or attribute with the is-idrefs property can contain atomic values of type xs:IDREF alongside values of other types.

他のすべてのプロパティは情報セットから構築される値と整合する値を持つ。 All other properties have values that are consistent with construction from an infoset.

注記: XML Schema インスタンス名前空間 " http://www.w3.org/2001/XMLSchema-instance " からの属性( xsi:schemaLocation, xsi:type, 等々) は、データモデルにおいては通常の属性として現れる。 Note: attributes from the XML Schema instance namespace, " http://www.w3.org/2001/XMLSchema-instance ", (xsi:schemaLocation, xsi:type, etc.) appear as ordinary attributes in the data model.

6.3.5 情報セットとの対応付け

属性ノード属性情報項目 に対応付けられる。 An Attribute Node maps to an attribute information item.

次のプロパティがこの対応付けにより指定される: The following properties are specified by this mapping:

[namespace name]

dm:node-name の値の名前空間名。 The namespace name of the value of dm:node-name.

[local name]

dm:node-name の値の局所部。 The local part of the value of dm:node-name.

[prefix]

dm:node-name の値に結びつけられた接頭辞。 The prefix associated with the value of dm:node-name.

[normalized value]

dm:string-value の値。 The value of dm:string-value.

[owner element]
  • このノードが親を持つならば dm:parent から返されるノードに対応する情報項目。 If this node has a parent, the information item that corresponds to the node returned by dm:parent.

  • 他の場合 no value Otherwise no value.

次のプロパティは値を持たない: [specified], [attribute type], [references] The following properties have no value: [specified] [attribute type] [references].

6.4 名前空間ノード

6.4.1 概観

それぞれの 名前空間ノード は名前空間 URI から名前空間接頭辞または既定の名前空間への束縛を表現する。 名前空間ノード を利用しない実装は同じ情報を要素ノードの namespaces プロパティを用いて表現してもよい。 名前空間 は次のプロパティを持つ: 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 property of an element node. Namespaces have the following properties:

  • prefix (空もとり得る)
  • uri
  • parent (空もとり得る)

名前空間ノード は次の制約を満たさなければならない Namespace Nodes must satisfy the following constraints.

  1. 名前空間ノード N が要素 E の名前空間に現れる場合、 N の親は Eなければならない If a Namespace Node N is among the namespaces of an element E, then the parent of N must be E.

  2. 名前空間ノード N が親要素 E を持つ場合、 NE の名前空間に現れなければならない If a Namespace Node N has a parent element E, then N must be among the namespaces of E.

  3. 名前空間ノード は名前 xmlns も文字列値 http://www.w3.org/2000/xmlns/ も持ってはならない A Namespace Node must not have the name xmlns nor the string-value http://www.w3.org/2000/xmlns/.

データモデルでは親の無い 名前空間ノード も許容される。 下を見よ。 The data model permits Namespace Nodes without parents, see below.

XPath 1.0においては 名前空間ノード は名前空間軸を通してアプリケーションから直接アクセスできていたが、 XPath 2.0 においては名前空間軸は非推奨になり、 XQuery 1.0 では完全に利用できなくなっている。 XPath 2.0 の実装には名前空間軸の公開は要求されない(後方互換性を提供するためにそうしてもよいが)。 In XPath 1.0, Namespace Nodes were directly accessible by applications, by means of the namespace axis. In XPath 2.0 the namespace axis is deprecated, and it is not available at all in XQuery 1.0. XPath 2.0 implementations are not required to expose the namespace axis, though they may do so if they wish to offer backwards compatibility.

代わりに、名前空間ノードに保持されている情報は [XQuery 1.0 と XPath 2.0 の関数と演算子(第2版)] [XQuery と XPath の関数と演算子 3.0] に定義されている関数を用いてアプリケーションから利用できるようになっている。 名前空間ノード の一部のプロパティはこれらの関数でも公開されていない: 特に、 名前空間ノード の識別, それらの親, 文書順における位置などに関連するプロパティ。 従って、名前空間軸を公開しない実装はこの情報を管理するオーバーヘッドを避けられる。 The information held in namespace nodes is instead made available to applications using functions defined in [ XQuery 1.0 and XPath 2.0 Functions and Operators (Second Edition) XQuery and XPath Functions and Operators 3.0 ]. Some properties of Namespace Nodes are not exposed by these functions: in particular, properties related to the identity of Namespace Nodes, their parentage, and their position in document order. Implementations that do not expose the namespace axis can therefore avoid the overhead of maintaining this information.

名前空間軸を公開する実装は、それぞれの要素に対し一意的な 名前空間ノード を提供しなければならない。 各要素は、結びつけられる 名前空間ノード の集合を持ち、それぞれが要素のスコープの中で互いに異なる名前空間接頭辞を持つ( [XML 名前空間] により暗黙に宣言される xml 接頭辞と要素のスコープに入る既定の名前空間も含む)。 要素はこれらの 名前空間ノード の親になる。 ただし、 名前空間ノード はその親要素の子ではない。 名前空間軸を公開する実装においては、要素が名前空間ノードを共有することはない。 Implementations that expose the namespace axis must provide unique Namespace Nodes for each element. Each element has an associated set of Namespace Nodes, one for each distinct namespace prefix that is in scope for the element (including the xml prefix, which is implicitly declared by [Namespaces in XML] and one for the default namespace if one is in scope for the element. The element is the parent of each of these Namespace Nodes; however, a Namespace Node is not a child of its parent element. In implementations that expose the namespace axis, elements never share namespace nodes.

注記: 名前空間軸を公開しない実装においては、名前空間ノードが共有されているかどうかをホスト言語から伝える手段は存在せず、そのような状況においては名前空間ノードの共有がとても理にかなった実装方策になり得る。 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.

6.4.2 アクセサ

dm:attributes

空シーケンスを返す。 Returns the empty sequence.

dm:base-uri

空シーケンスを返す。 Returns the empty sequence.

dm:children

空シーケンスを返す。 Returns the empty sequence.

dm:document-uri

空シーケンスを返す。 Returns the empty sequence.

dm:is-id

空シーケンスを返す。 Returns the empty sequence.

dm:is-idrefs

空シーケンスを返す。 Returns the empty sequence.

dm:namespace-bindings

空シーケンスを返す。 Returns the empty sequence.

dm:namespace-nodes

空シーケンスを返す。 Returns the empty sequence.

dm:nilled

空シーケンスを返す。 Returns the empty sequence.

dm:node-kind

namespace” を返す。 Returns “namespace”.

dm:node-name

prefix が空でない場合、 local-name 内の prefix プロパティの値と空の名前空間名を伴う xs:QName を返し、他の場合、空シーケンスを返す。 If the prefix is not empty, returns an xs:QName with the value of the prefix property in the local-name and an empty namespace name, otherwise returns the empty sequence.

dm:parent

parent プロパティの値を返す。 Returns the value of the parent property.

dm:string-value

uri プロパティの値を返す。 Returns the value of the uri property.

dm:type-name

空シーケンスを返す。 Returns the empty sequence.

dm:typed-value

uri プロパティの値を xs:string として返す。 Returns the value of the uri property as an xs:string.

dm:unparsed-entity-public-id

空シーケンスを返す。 Returns the empty sequence.

dm:unparsed-entity-system-id

空シーケンスを返す。 Returns the empty sequence.

6.4.3 情報セットからの構築

名前空間情報項目 が必須になる。 The namespace information items are required.

次の情報セットプロパティが要求される: [prefix], [namespace name] . The following infoset properties are required: [prefix], [namespace name].

名前空間ノード プロパティは次の様にして情報セットから導出される: Namespace Node properties are derived from the infoset as follows:

prefix

[prefix] プロパティ。 The [prefix] property.

uri

[namespace name] プロパティ. The [namespace name] property.

parent

実装が 名前空間ノードdm:parent アクセサへアクセスする仕組みを公開している場合、 名前空間情報項目[in-scope namespaces] プロパティの中に現れる要素。 The element in whose [in-scope namespaces] property the namespace information item appears, if the implementation exposes any mechanism for accessing the dm:parent accessor of Namespace Nodes.

6.4.4 PSVI からの構築

PSVI からの構築は情報セットからの構築と同じである。 Construction from a PSVI is identical to construction from the Infoset.

6.4.5 情報セットとの対応付け

名前空間ノード名前空間情報項目 に対応付けられる。 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]

dm:string-value の値。 The value of dm:string-value.

6.5 処理命令ノード

6.5.1 概観

処理命令ノード は XML 処理命令をカプセル化する。 処理命令 は次のプロパティを持つ: Processing Instruction Nodes encapsulate XML processing instructions. Processing instructions have the following properties:

  • target
  • content
  • base-uri (空もとり得る)
  • parent (空もとり得る)

処理命令ノード は次の制約を満たさなければならない Processing Instruction Nodes must satisfy the following constraints.

  1. 文字列 "?>" が content 内に現れてはならない The string "?>" must not occur within the content.

  2. targetNCNameなければならない The target must be an NCName.

6.5.2 アクセサ

dm:attributes

空シーケンスを返す。 Returns the empty sequence.

dm:base-uri

base-uri プロパティの値を返す。 Returns the value of the base-uri property.

dm:children

空シーケンスを返す。 Returns the empty sequence.

dm:document-uri

空シーケンスを返す。 Returns the empty sequence.

dm:is-id

空シーケンスを返す。 Returns the empty sequence.

dm:is-idrefs

空シーケンスを返す。 Returns the empty sequence.

dm:namespace-bindings

空シーケンスを返す。 Returns the empty sequence.

dm:namespace-nodes

空シーケンスを返す。 Returns the empty sequence.

dm:nilled

空シーケンスを返す。 Returns the empty sequence.

dm:node-kind

processing-instruction” を返す。 Returns “processing-instruction”.

dm:node-name

local-name 内の target プロパティの値と空の名前空間 URI と空の接頭辞を伴う xs:QName を返す。 Returns an xs:QName with the value of the target property in the local-name and an empty namespace URI and empty prefix.

dm:parent

parent プロパティの値を返す。 Returns the value of the parent property.

dm:string-value

content プロパティの値を返す。 Returns the value of the content property.

dm:type-name

空シーケンスを返す。 Returns the empty sequence.

dm:typed-value

content プロパティの値を xs:string として返す。 Returns the value of the content property as a xs:string.

dm:unparsed-entity-public-id

空シーケンスを返す。 Returns the empty sequence.

dm:unparsed-entity-system-id

空シーケンスを返す。 Returns the empty sequence.

6.5.3 情報セットからの構築

無視されなかった 処理命令情報項目 のそれぞれに対し 処理命令ノード が構築される。 A Processing Instruction Node is constructed for each processing instruction information item that is not ignored.

次の情報セットプロパティが要求される: [target], [content], [base URI], [parent] The following infoset properties are required: [target], [content], [base URI], and [parent].

処理命令ノード プロパティは次の様にして情報セットから導出される: Processing Instruction Node properties are derived from the infoset as follows:

target

[target] プロパティの値。 The value of the [target] property.

content

[content] プロパティの値。 The value of the [content] property.

base-uri

(もしあれば) [base URI] プロパティの値。 (もしあれば)基底 URI プロパティは URI に許容されない Unicode 文字が含まれるとしても、(絶対 URI が算出可能ならば)常に絶対 URI になることに注意。 これらの文字が出現し、それらが base-uri プロパティ内に存在し、 URI 検索が要求された場合はそれに適した形になるようにアプリケーションにより符号化されエスケープされなければならない。 The value of the [base URI] property, if available. Note that the base URI property, if available, is always an absolute URI (if an absolute URI can be computed) though it may contain Unicode characters that are not allowed in URIs. These characters, if they occur, are present in the base-uri property and will have to be encoded and escaped by the application to obtain a URI suitable for retrieval, if retrieval is required.

実施においては [base URI] が常に判明するとは限らない。この場合、文書ノードの base-uri プロパティの値は空シーケンスになる。 これは基底 URI に依存する一部の処理の失敗をもたらすが、本質的なエラーではない。 In practice a [base URI] is not always known. In this case the value of the base-uri property of the document node will be the empty sequence. This is not intrinsically an error, though it may cause some operations that depend on the base URI to fail.

parent

[parent] プロパティの値に対応するノード。 The node corresponding to the value of the [parent] property.

文書 type declaration情報項目 の子の処理命令に対する 処理命令ノード は存在しない。 There are no Processing Instruction Nodes for processing instructions that are children of a document type declaration information item.

6.5.4 PSVI からの構築

PSVI からの構築は情報セットからの構築と同じである。 Construction from a PSVI is identical to construction from the Infoset.

6.5.5 情報セットとの対応付け

処理命令ノード処理命令情報項目 に対応付けられる。 An Processing Instruction Node maps to a processing instruction information item.

次のプロパティがこの対応付けにより指定される: The following properties are specified by this mapping:

[target]

dm:node-name の値の局所部。 The local part of the value of dm:node-name.

[content]

dm:string-value の値。 The value of dm:string-value.

[base URI]

dm:base-uri の値。 The value of dm:base-uri.

[parent]
  • このノードが情報セットとの対応付け処理のルートになっている場合、 unknown If this node is the root of the infoset mapping operation, unknown.

  • このノードが親を持つ場合、 dm:parent から返されるノードの情報項目。 If this node has a parent, the information item that corresponds to the node returned by dm:parent.

  • 他の場合、 no value Otherwise no value.

[notation]

no value. no value.

6.6 コメントノード

6.6.1 概観

コメントノード XML comments をカプセル化する。 コメントは次のプロパティを持つ: Comment Nodes encapsulate XML comments. Comments have the following properties:

  • content
  • parent (空もとり得る)

コメントノード は次の制約を満たさなければならない Comment Nodes must satisfy the following constraints.

  1. 文字列 "--" が content に現れてはならない The string "--" must not occur within the content.

  2. 文字 "-" が content の最後の文字として現れてはならない The character "-" must not occur as the last character of the content.

6.6.2 アクセサ

dm:attributes

空シーケンスを返す。 Returns the empty sequence.

dm:base-uri

コメントが親を持つ場合はその親の dm:base-uri の値を返し、他の場合は空シーケンスを返す。 If the comment has a parent, returns the value of the dm:base-uri of its parent; otherwise, returns the empty sequence.

dm:children

空シーケンスを返す。 Returns the empty sequence.

dm:document-uri

空シーケンスを返す。 Returns the empty sequence.

dm:is-id

空シーケンスを返す。 Returns the empty sequence.

dm:is-idrefs

空シーケンスを返す。 Returns the empty sequence.

dm:namespace-bindings

空シーケンスを返す。 Returns the empty sequence.

dm:namespace-nodes

空シーケンスを返す。 Returns the empty sequence.

dm:nilled

空シーケンスを返す。 Returns the empty sequence.

dm:node-kind

comment” を返す。 Returns “comment”.

dm:node-name

空シーケンスを返す。 Returns the empty sequence.

dm:parent

parent プロパティの値を返す。 Returns the value of the parent property.

dm:string-value

content プロパティの値を返す。 Returns the value of the content property.

dm:type-name

空シーケンスを返す。 Returns the empty sequence.

dm:typed-value

content プロパティの値を xs:string として返す。 Returns the value of the content property as a xs:string.

dm:unparsed-entity-public-id

空シーケンスを返す。 Returns the empty sequence.

dm:unparsed-entity-system-id

空シーケンスを返す。 Returns the empty sequence.

6.6.3 情報セットからの構築

コメント情報項目 はオプションである。 The comment information items are optional.

それぞれの コメント情報項目 に対し コメントノード が構築される。 A Comment Node is constructed for each comment information item.

次の情報セットプロパティが要求される: [content], [parent] The following infoset properties are required: [content] and [parent].

コメントノード プロパティは次の様にして情報セットから導出される: Comment Node properties are derived from the infoset as follows:

content

[content] プロパティの値。 The value of the [content] property.

parent

[parent] プロパティの値に対応するノード。 The node corresponding to the value of the [parent] property.

文書型宣言情報項目 の子のコメントに対応する コメントノード は存在しない。 There are no Comment Nodes for comments that are children of a document type declaration information item.

6.6.4 PSVI からの構築

PSVI からの構築は情報セットからの構築と同じである。 Construction from a PSVI is identical to construction from the Infoset.

6.6.5 情報セットとの対応付け

コメントノードコメント情報項目 に対応付けられる。 A Comment Node maps to a comment information item.

次のプロパティがこの対応付けにより指定される: The following properties are specified by this mapping:

[content]

dm:string-value の値。 The value of the dm:string-value.

[parent]
  • このノードが情報セット対応付け処理のルートになっている場合、 unknown If this node is the root of the infoset mapping operation, unknown.

  • このノードが親を持つ場合、 dm:parent から返されるノードの情報項目。 If this node has a parent, the information item that corresponds to the node returned by dm:parent.

  • 他の場合、 no value Otherwise no value.

6.7 テキストノード

6.7.1 概観

テキストノードは XML 文字内容をカプセル化する。 テキスト は次のプロパティを持つ: Text Nodes encapsulate XML character content. Text has the following properties:

  • content
  • parent (空もとり得る)

テキストノード は次の制約を満たさなければならない Text Nodes must satisfy the following constraint:

  1. テキストノードの parent が空でないならば、 テキストノードcontent として長さ0の文字列を含んではならない If the parent of a text node is not empty, the Text Node must not contain the zero-length string as its content.

加えて 文書, 要素ノード においては、2つの テキストノード は決して隣接する同胞として連続しない制約が課される。 文書 または 要素ノード が構築される際は、隣接する テキストノード は1個の テキストノード に連結されなければならない 。 結果の テキストノード が空の場合、その親の子にしてはならず、単に削除される。 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 be combined into a single Text Node. If the resulting Text Node is empty, it must never be placed among the children of its parent, it is simply discarded.

6.7.2 アクセサ

dm:attributes

空シーケンスを返す。 Returns the empty sequence.

dm:base-uri

テキストノード が親を持つ場合はその親の dm:base-uri の値を返し、他の場合は空シーケンスを返す。 If the Text Node has a parent, returns the value of the dm:base-uri of its parent; otherwise, returns the empty sequence.

dm:children

空シーケンスを返す。 Returns the empty sequence.

dm:document-uri

空シーケンスを返す。 Returns the empty sequence.

dm:is-id

空シーケンスを返す。 Returns the empty sequence.

dm:is-idrefs

空シーケンスを返す。 Returns the empty sequence.

dm:namespace-bindings

空シーケンスを返す。 Returns the empty sequence.

dm:namespace-nodes

空シーケンスを返す。 Returns the empty sequence.

dm:nilled

空シーケンスを返す。 Returns the empty sequence.

dm:node-kind

text” を返す。 Returns “text”.

dm:node-name

空シーケンスを返す。 Returns the empty sequence.

dm:parent

parent プロパティの値を返す。 Returns the value of the parent property.

dm:string-value

content プロパティの値を返す。 Returns the value of the content property.

dm:type-name

xs:untypedAtomic を返す。 Returns xs:untypedAtomic.

dm:typed-value

content プロパティの値を xs:untypedAtomic として返す。 Returns the value of the content property as an xs:untypedAtomic.

dm:unparsed-entity-public-id

空シーケンスを返す。 Returns the empty sequence.

dm:unparsed-entity-system-id

空シーケンスを返す。 Returns the empty sequence.

6.7.3 情報セットからの構築

文字情報項目 が必須になる。 文字情報項目 の文書順による最長の連なりのそれぞれに対し テキストノード が構築される。 The character information items are required. A Text Node is constructed for each maximal sequence of character information items in document order.

次の情報セットプロパティが要求される: [character code], [parent] The following infoset properties are required: [character code] and [parent].

次の情報セットプロパティはオプションである: [element content whitespace] The following infoset properties are optional: [element content whitespace].

次の制約を満たすとき、 文字情報項目 の連なりは最長であるとする: A sequence of character information items is maximal if it satisfies the following constraints:

  1. 連なり内のすべての情報項目が同じ親を持つ。 All of the information items in the sequence have the same parent.

  2. 連なりは 他の型の情報項目が間に挟まれること無く隣り合う 文字情報項目 からなる。 The sequence consists of adjacent character information items uninterrupted by other types of information item.

  3. 同じ 文字情報項目 のどれかを含むような連なりでより長いものが存在しない No other such sequence exists that contains any of the same character information items and is longer.

テキストノード プロパティは次の様にして情報セットから導出される: Text Node properties are derived from the infoset as follows:

content

それぞれの 文字情報項目[character code] プロパティに対応する文字からなる文字列。 A string comprised of characters that correspond to the [character code] properties of each of the character information items.

結果の テキストノード 全体が空白からなり、このノードの構築に利用された 文字情報項目[element content whitespace] プロパティが true の場合、 テキストノードcontent は長さ0の文字列。 空の テキストノード は親を持たないものに限り許容される。 親が存在する空の テキストノード はその親が構築された時点で破棄される。 If the resulting Text Node consists entirely of whitespace and the [element content whitespace] property of the character information items used to construct this node are true, the content of the Text Node is the zero-length string. 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.

テキストノード の内容は [文字モデル] で述べられているように正規化される必要はない。 正規化されたテキストを供する役割はデータ生成側がその責を負う。 処理においてテキストの正規化状態が維持されるようにする責はアプリケーション側が負う。 The content of the Text Node is not necessarily normalized as described in the [Character Model]. It is the responsibility of data producers to provide normalized text, and the responsibility of applications to make sure that operations do not de-normalize text.

parent

[parent] プロパティの値に対応するノード。 The node corresponding to the value of the [parent] property.

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.

6.7.4 PSVI からの構築

要素の [schema normalized value] から構築された テキストノード に対し、 content[schema normalized value] の値を含む。 For Text Nodes constructed from the [schema normalized value] of elements, content contains the value of the [schema normalized value].

他の場合、 PSVI からの構築は content プロパティを除き、情報セットからの構築と同じである。 content プロパティを構築する際に [element content whitespace] は空白が畳まれるかどうかの判定に利用されない。 代わりに、もし、結果の テキストノード 全体が空白からなり、このノードの構築に用いられた 文字情報項目 が親を持ち、その親が要素であり、その要素の {content type} が “mixed”でない場合、 テキストノードcontent は長さ0の文字列になる。 Otherwise, construction from a PSVI is the same as construction from the Infoset except for the content property. When constructing the content property, [element content whitespace] is not used to test if whitespace is collapsed. Instead, if the resulting Text Node consists entirely of whitespace and the character information items used to construct this node have a parent and that parent is an element and its {content type} is not “mixed”, then the content of the Text Node is the zero-length string.

空の テキストノード は親を持たないものに限り許容される。 親が存在する空の テキストノード はその親が構築された時点で破棄される。 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.

6.7.5 情報セットとの対応付け

テキストノード文字情報項目 の連なりに対応付けられる。 A Text Node maps to a sequence of character information items.

ノードの dm:string-value の各文字は次の対応付けにより 文字情報項目 に変換される: Each character of the dm:string-value of the node is converted into a character information item as specified by this mapping:

[character code]

文字の Unicode 符号位置値。 The Unicode code point value of the character.

[parent]
  • このノードが情報セット対応付け処理のルートになっている場合、 unknown If this node is the root of the infoset mapping operation, unknown.

  • このノードが親を持つ場合、 dm:parent から返されるノードの情報項目。 If this node has a parent, the information item that corresponds to the node returned by dm:parent.

  • 他の場合 no value Otherwise no value.

[element content whitespace]

Unknown Unknown.

この文字の連なりが情報セット対応付けを構成する。 This sequence of characters constitutes the infoset mapping.

7 適合性

データモデルの主要な意図は他の仕様から利用できる部品としてのものになる。 従って、データモデルに対する適合性基準の指定は、それを利用する仕様( [XML Path 言語 (XPath) 2.0 (第2版)], [XSL 2.0 (第2版)], [XQuery] [XML Path 言語 (XPath) 3.0], [XSL 変換 (XSLT) 3.0], [XQuery 3.0: XML Query 言語] など)それぞれの環境に依存する。 データモデルの利用において適合性基準を定める仕様は、この仕様に示された制約を緩めてはならない。 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) 2.0 (Second Edition)], [XSLT 2.0 (Second Edition)], and [XQuery]) to specify conformance criteria for the data model in their respective environments. Specifications that set conformance criteria for their use of the data model must not relax the constraints expressed in this specification.

データモデルの利用に対する適合性基準の制定にあたっては、次に挙げるデータモデルの特色に特に注意が払われるべきである: Authors of conformance criteria for the use of the data model should pay particular attention to the following features of the data model:

  1. 3.2 3.2 情報セットからの構築 で述べた情報セットからの標準的な構築のサポート。 Support for the normative construction from an infoset described in 3.2 Construction from an Infoset.

  2. 3.3 PSVI からの構築 で述べた PSVI からの標準的な構築のサポート。 Support for the normative construction from a PSVI described in 3.3 Construction from a PSVI.

  3. XML 1.0 と XML 1.1 のサポート。 Support for XML 1.0 and XML 1.1.

  4. XML Schema 1.0 と XML Schema 1.1 のデータ型のサポート。 Support for data types in XML Schema 1.0 and XML Schema 1.1.

  5. ノードを通してか、別の実装依存の表現を通してか、名前空間をどのような形でサポートするか。 How namespaces are supported, through nodes or through the alternative, implementation-dependent representation.

XML 情報セットに対する適合性

この仕様は XML 情報セット [Infoset] に適合する。 データモデルの構築のためには、次の情報項目が(特にオプションとして明記されない限り)情報セット生成側から公開されなければならない This specification conforms to the XML Information Set [Infoset]. The following information items must be exposed by the infoset producer to construct a data model unless they are explicitly identified as optional:

情報セットプロセッサから供されるその他の情報項目とプロパティは無視される。 上のプロパティに加え、データモデルが PSVI から構築される場合は次の PSVI プロパティが 要素情報項目属性情報項目 に要求される: 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 and Attribute Information Items if the data model is constructed from a PSVI:

B 参照文献

B.1 規範にする参照文献

情報セット
XML Information Set (Second Edition), Richard Tobin and John Cowan, Editors. World Wide Web Consortium, 04 Feb 2004. This version is http://www.w3.org/TR/2004/REC-xml-infoset-20040204/. The latest version is available at http://www.w3.org/TR/xml-infoset/.
XML 名前空間
Namespaces in XML 1.0 (Third Edition), Richard Tobin, Dave Hollander, Tim Bray, and Andrew Layman, Editors. World Wide Web Consortium, 16 Aug 2006. This version is http://www.w3.org/TR/2006/REC-xml-names-20060816. The latest version is available at http://www.w3.org/TR/xml-names/.
Namespaces in XML 1.0 (Third Edition), Dave Hollander, Richard Tobin, Tim Bray, et. al., Editors. World Wide Web Consortium, 08 Dec 2009. This version is http://www.w3.org/TR/2009/REC-xml-names-20091208/. The latest version is available at http://www.w3.org/TR/xml-names/.
XML 1.1 名前空間
Namespaces in XML 1.1 (Second Edition), Dave Hollander, Tim Bray, Andrew Layman, and Richard Tobin, Editors. World Wide Web Consortium, 16 Aug 2006. This version is http://www.w3.org/TR/2006/REC-xml-names11-20060816. The latest version is available at http://www.w3.org/TR/xml-names11/.
xml:id
xml:id Version 1.0, Norman Walsh, Daniel Veillard, and Jonathan Marsh, Editors. World Wide Web Consortium, 09 Sep 2005. This version is http://www.w3.org/TR/2005/REC-xml-id-20050909/. The latest version is available at http://www.w3.org/TR/xml-id/.
XPath 言語 (XPath) 2.0 (第2版)
XML Path Language (XPath) 2.0 (Second Edition), Don Chamberlin, Jonathan Robie, Anders Berglund, Scott Boag, et. al., Editors. World Wide Web Consortium, 14 December 2010. This version is http://www.w3.org/TR/2010/REC-xpath20-20101214/. The latest version is available at http://www.w3.org/TR/xpath20/.
XML パス言語 (XPath) 3.0
XML Path Language (XPath) 3.0, Jonathan Robie, Don Chamberlin, Michael Dyck, John Snelson, Editors. World Wide Web Consortium, 13 December 2011. This version is http://www.w3.org/TR/2011/WD-xpath-30-20111213/. The latest version is available at http://www.w3.org/TR/xpath-30/.
XQuery 1.0 と XPath 2.0 の関数と演算子(第2版)
XQuery 1.0 and XPath 2.0 Functions and Operators (Second Edition), Ashok Malhotra, Jim Melton, Norman Walsh, and Michael Kay, Editors. World Wide Web Consortium, 14 December 2010. This version is http://www.w3.org/TR/2009/REC-xpath-functions-20101214/. The latest version is available at http://www.w3.org/TR/xpath-functions/.
XQuery と XPath の関数と演算子 3.0
XQuery and XPath Functions and Operators 3.0, Michael Kay, Editor. World Wide Web Consortium, 13 December 2011. This version is http://www.w3.org/TR/2011/WD-xpath-functions-30-20111213/. The latest version is available at http://www.w3.org/TR/xpath-functions-30/.
Schema Part 1
XML Schema Part 1: Structures Second Edition, David Beech, Henry S. Thompson, Murray Maloney, and Noah Mendelsohn, Editors. World Wide Web Consortium, 28 Oct 2004. This version is http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/. The latest version is available at http://www.w3.org/TR/xmlschema-1/.
Schema Part 2
XML Schema Part 2: Datatypes Second Edition, Ashok Malhotra and Paul V. Biron, Editors. World Wide Web Consortium, 28 Oct 2004. This version is http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/. The latest version is available at http://www.w3.org/TR/xmlschema-2/.
Schema 1.1 Part 1
W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures, Murray Maloney, Noah Mendelsohn, David Beech, et. al., Editors. World Wide Web Consortium, 03 Dec 2009. This version is http://www.w3.org/TR/2009/WD-xmlschema11-1-20091203/. The latest version is available at http://www.w3.org/TR/xmlschema11-1/.
Schema 1.1 Part 2
W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes, Henry S. Thompson, Ashok Malhotra, Shudi (Sandy) Gao, et. al., Editors. World Wide Web Consortium, 03 Dec 2009. This version is http://www.w3.org/TR/2009/WD-xmlschema11-2-20091203/. The latest version is available at http://www.w3.org/TR/xmlschema11-2/.
XSLT 2.0 と XQuery 1.0 直列化(第2版)
XSLT 2.0 and XQuery 1.0 Serialization (Second Edition), Scott Boag, Michael Kay, Joanne Tong, Norman Walsh, and Henry Zongaro, Editors. World Wide Web Consortium, 14 December 2010. This version is http://www.w3.org/TR/2010/REC-xslt-xquery-serialization-20101214/. The latest version is available at http://www.w3.org/TR/xslt-xquery-serialization/.
XSLT と XQuery 直列化 3.0
XSLT and XQuery Serialization 3.0, Henry Zongaro, Editor. World Wide Web Consortium, 13 December 2011. This version is http://www.w3.org/TR/2011/WD-xslt-xquery-serialization-30-20111213/. The latest version is available at http://www.w3.org/TR/xslt-xquery-serialization-30/.
XQuery 1.0 と XPath 2.0 の形式的意味内容
XQuery 1.0 and XPath 2.0 Formal Semantics (Second Edition), Jérôme Siméon, Denise Draper, Peter Frankhauser, et. al., Editors. World Wide Web Consortium, 14 December 2010. This version is http://www.w3.org/TR/2010/REC-xquery-semantics-20101214/. The latest version is available at http://www.w3.org/TR/xquery-semantics/.
RFC 2119
Key words for use in RFCs to Indicate Requirement Levels, S. Bradner. Network Working Group, IETF, Mar 1997.
RFC 3986
Uniform Resource Identifier (URI): Generic Syntax, T. Berners-Lee, R. Fielding, and L. Masinter. Network Working Group, IETF, Jan 2005.
RFC 2987
Internationalized Resource Identifiers (IRIs), M. Duerst and M. Suignard. Network Working Group, IETF, Jan 2005.
文字モデル
Character Model for the World Wide Web 1.0: Fundamentals, François Yergeau, Richard Ishida, Martin J. Dürst, et. al., Editors. World Wide Web Consortium, 15 Feb 2005. This version is http://www.w3.org/TR/2005/REC-charmod-20050215/. The latest version is available at http://www.w3.org/TR/charmod/.

B.2 その他の参照文献

XML Query データモデル
XML Query Data Model, Mary Fernández and Jonathan Robie, Editors. World Wide Web Consortium, 15 Feb 2001.
XML Base
XML Base (Second Edition), Jonathan Marsh and Richard Tobin, Editors. World Wide Web Consortium, 28 Jan 2009. This version is http://www.w3.org/TR/2009/REC-xmlbase-20090128/. The latest version is available at http://www.w3.org/TR/xmlbase/.
XPath 1.0
XML Path Language (XPath) Version 1.0, James Clark and Steven DeRose, Editors. World Wide Web Consortium, 16 Nov 1999. This version is http://www.w3.org/TR/1999/REC-xpath-19991116. The latest version is available at http://www.w3.org/TR/xpath/.
XPath 2.0 Requirements
XPath Requirements Version 2.0, Mary Fernández, K Karun, and Mark Scardina, Editors. World Wide Web Consortium, 3 Jun 2005. This version is http://www.w3.org/TR/2005/WD-xpath20req-20050603/. The latest version is available at http://www.w3.org/TR/xpath20req/.
XSLT 2.0 (Second Edition)
XSL Transformations (XSLT) Version 2.0 (Second Edition), Michael Kay, Editor. World Wide Web Consortium, 14 December 2010. The latest version is available at http://www.w3.org/TR/xslt20/.
XSL Transformations (XSLT) Version 3.0
XSL Transformations (XSLT) Version 3.0 (expected), Michael Kay, Editor. World Wide Web Consortium, (not yet published but anticipated in 2012; see the list of XSLT specifications)
XML Query Working Group
XML Query Working Group, World Wide Web Consortium. Home page: http://www.w3.org/XML/Query/
XSL Working Group
XSL Working Group, World Wide Web Consortium. Home page: http://www.w3.org/Style/XSL/
XQuery
XQuery 1.0: An XML Query Language (Second Edition), Don Chamberlin, Jonathan Robie, Anders Berglund, Scott Boag, et. al., Editors. World Wide Web Consortium, 14 December 2010. This version is http://www.w3.org/TR/2010/REC-xquery-20101214/. The latest version is available at http://www.w3.org/TR/xquery/.
XQuery 3.0: An XML Query Language
XQuery 3.0: An XML Query Language, Jonathan Robie, Don Chamberlin, Michael Dyck, John Snelson, Editors. World Wide Web Consortium, 13 December 2011. This version is http://www.w3.org/TR/2011/WD-xquery-30-20111213/. The latest version is available at http://www.w3.org/TR/xquery-30/.
XML Query Requirements
XML Query (XQuery) Requirements, Don Chamberlin, Peter Fankhauser, Massimo Marchiori, and Jonathan Robie, Editors. World Wide Web Consortium, 3 Jun 2005. This version is http://www.w3.org/TR/2005/WD-xquery-requirements-20050603/. The latest version is available at http://www.w3.org/TR/xquery-requirements/.
XQuery 3.0 Requirements
XQuery 3.0 Requirements, Daniel Engovatov, Jonathan Robie, Editors. World Wide Web Consortium, 16 September 2010. This version is http://www.w3.org/TR/2010/WD-xquery-30-requirements-20100916/. The latest version is available at http://www.w3.org/TR/xquery-30-requirements/.
ISO 8601
ISO (International Organization for Standardization). Representations of dates and times, 2000-08-03. Available from: http://www.iso.org/

C 拡張 XS 名前空間のスキーマ

次のスキーマは、この文書により特定されている xs: 名前空間に追加の型を定義する。 The following schema defines the additional types in the xs: namespace identified by this document.

この名前空間の公式のスキーマは http://www.w3.org/2007/xpath-datatypes から取得できる。 You can retrieve the normative schema for this namespace from http://www.w3.org/2007/xpath-datatypes.

この名前空間の公式のスキーマは http://www.w3.org/2010/xpath-datatypes/xpath-datatypes.xsd から取得できる。 You can retrieve the normative schema document for this namespace from http://www.w3.org/2010/xpath-datatypes/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>

D 索引(参考)

E 例(参考)

F 実装定義の項と実装依存の項(参考)

F.1 実装定義の項

次に挙げる項は 実装定義 になる。 The following items are implementation-defined.

  1. 追加の利用者定義や実装定義の型のサポートは実装定義とする。( 2.6.12.7.1 型の表現 を見よ。) Support for additional user-defined or implementation-defined types is implementation-defined. (See 2.6.12.7.1 Representation of Types)

  2. データモデルにおける一部の型付き値は 未定義 である。 未定義のプロパティに対するアクセスは常にエラーである。 未定義のプロパティへのアクセスは常にエラーとする。 これらの場合におけるふるまいは実装定義であり、結果の扱いはホスト言語が責を負う。 ( 5 アクセサ を見よ。) Some typed values in the data model are undefined. Attempting to access an undefined property is always an error. Behavior in these cases is implementation-defined and the host language is responsible for determining the result. (See 5 Accessors)

F.2 実装依存の項

次に挙げる項は 実装依存 である。 The following items are implementation-dependent.

  1. 名前空間ノード ノードの相対順序は安定かつ実装依存( 2.4 文書順 を見よ) The relative order of Namespace Node nodes is stable but implementation-dependent. (See 2.4 Document Order)

  2. 属性ノード ノードの相対順序は安定かつ実装依存( 2.4 文書順 を見よ) The relative order of Attribute Nodes nodes is stable but implementation-dependent. (See 2.4 Document Order)

  3. 異なるツリー間の相対順序は安定かつ実装依存( 2.4 文書順 を見よ) The relative order of distinct trees is stable but implementation-dependent. (See 2.4 Document Order)

  4. 匿名型の名前は実装依存( 2.6.12.7.1 型の表現 を見よ) The names of anonymous types are implementation-dependent. (See 2.6.12.7.1 Representation of Types)

  5. 型名に結びつけられた接頭辞は実装依存( 3.3.1.1 要素, 属性ノード の型名 を見よ) The prefix associated with type names is implementation-dependent. (See 3.3.1.1 Element and Attribute Nodes Type Names)

  6. dm:namespace-bindings アクセサから返される接頭辞/URI の組の集合の表現は実装依存( 5.7 namespace-bindings アクセサ を見よ) The representation of the set of prefix/URI pairs returned by the dm:namespace-bindings accessor is implementation-dependent. (See 5.7 namespace-bindings Accessor)

  7. 名前空間の表現、すなわち、それらがノードとして表現し得るかどうかは 実装依存( 6 ノード を見よ)

G 初版からの変更点(参考)

この文書の初版からの変更点についての詳細は エラータ に記されている。 各エラータの本義は対応する Bugzilla データベースエントリに述べられている。 次の表に適用されているエラータをまとめる。 The changes made to this document are described in detail in the Errata to the first edition. The rationale for each erratum is explained in the corresponding Bugzilla database entry. The following table summarizes the errata that have been applied.

エラータ Bugzilla 分類 説明
E001 4352 編集上
(editorial)

例の中のスキーマが妥当でない。

E002 4413 実質的
(substantive)

データモデル仕様がスキーマ型が単純内容を伴う複合型の要素に対する型付き値を決定するに不十分。 The data model spec doesn't adequately cover the determination of the typed value for an element whose schema type is a complex type with simple content.

E003 4486 実質的

データモデルが名前空間 'http://www.w3.org/2000/xmlns/' の利用に対する制約を示していない。 XDM 文書を名前空間整形式 XML 文書に確実に直列化できるようにするためにはそのような制約が必要になる。 The Data Model does not state any constraints on the use of the namespace 'http://www.w3.org/2000/xmlns/'. Such constraints are needed to ensure that an XDM document can be serialized as a namespace-well-formed XML document.

E004 4487 実質的

名前空間 URI が属性ノードのノード名に存在するならば接頭辞も存在しなければならないという制約が XDM のどこにも示されていない。 XDM 文書を名前空間整形式 XML 文書に確実に直列化できるようにするためにはそのような制約が必要になる。 Nowhere does XDM state the constraint that if a namespace URI is present in the node-name of an attribute node then a prefix must also be present. This is necessary to ensure that an XDM document can be serialized as namespace-well-formed XML.

E005 4519 実質的

PSVI から構築された要素ノードの is-id プロパティに対する規則が根拠なく属性ノードの規則と異なる。 The rules for is-id property for an element node constructed from a PSVI appear arbitrarily different from the rule for attribute nodes.

E006 4984 編集上

(削除) (superseded)

E007 5002 編集上

用語:ルートノードの概念。 Terminology: root node concept.

E008 5212 編集上

古い xdt: が xs: 接頭辞の代わりに用いられている。 Obsolete xdt: rather than xs: prefixes used.

E009 5267 編集上

xs:dayTimeDuration, xs:yearMonthDuration が原始単純型として挙げられている。 xs:dayTimeDuration and xs:yearMonthDuration listed as a primitive simple type.

E010 4622 実質的

dm:unparsed-entity-system-id が返す URI は絶対か相対か? dm:unparsed-entity-system-id absolute or relative URI?

E011 5207 実質的

未定義の静的文脈基底 URI へのアクセスと XPST0001 Accessing undefined static context base URI and XPST0001

E012 5983 編集上

xs:integer は原始型でない xs:integer is not primitive

E013 6139 編集上

空のテキストノードに関する注意 reminders re empty Text Nodes

E014 6255 編集上

妥当性検証後の基底 URI Base URI after validation

E015 6374 編集上

参考注記 non-normative notes

E016 6287 編集上

用語: "undefined" Terminology: "undefined"

2007年 1月 23日付け勧告から以下の変更が加えられている。 The following changes have been made to this document since the Recommendation of 23 January 2007.

  • W3C Schema 1.1 dateTimeStamp データ型が追加された。 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.

H アクセサ要約(参考)

この節は各アクセサの返り値をノード種別に要約する。 This section summarizes the return values of each accessor by node type.

H.1 dm:attributes アクセサ

H.2 dm:base-uri アクセサ

H.3 dm:children アクセサ

H.4 dm:document-uri アクセサ

H.5 dm:is-id アクセサ

H.6 dm:is-idrefs アクセサ

H.7 dm:namespace-bindingsアクセサ

H.8 dm:namespace-nodes アクセサ

H.9 dm:nilled アクセサ

H.10 dm:node-kind アクセサ

H.11 dm:node-name アクセサ

H.12 dm:parent アクセサ

H.13 dm:string-value アクセサ

H.14 dm:type-name アクセサ

H.15 dm:typed-value アクセサ

H.16 dm:unparsed-entity-public-id アクセサ

H.17 dm:unparsed-entity-system-id アクセサ

I 情報セットからの構築 要約(参考)

各ノード種の情報項目に対する情報セットからのデータモデル構築をこの節に要約する。 全般的事項は 3.2 情報セットからの構築 を見よ。 This section summarizes data model construction from an Infoset for each kind of information item. General notes occur elsewhere.

I.1 文書ノード 情報項目

I.2 要素ノード 情報項目

I.3 属性ノード 情報項目

I.4 名前空間ノード 情報項目

I.5 処理命令ノード 情報項目

I.6 コメントノード 情報項目

I.7 テキストノード 情報項目

J PSVI からの構築 要約(参考)

各ノード種の情報項目に対する PSVI からのデータモデル構築をこの節に要約する。 全般的事項については 3.3 PSVI からの構築 を見よ。 This section summarizes data model construction from a PSVI for each kind of information item. General notes occur elsewhere.

J.1 文書ノード 情報項目

J.2 要素ノード 情報項目

J.3 属性ノード 情報項目

J.4 名前空間ノード 情報項目

J.5 処理命令ノード 情報項目

J.6 コメントノード 情報項目

J.7 テキストノード 情報項目

K 情報セットとの対応付け 要約(参考)

各ノード種の情報項目に対する 情報セットとの対応付けをこの節に要約する。 全般的事項については 情報セットとの対応付け を見よ。 This section summarizes the infoset mapping for each kind of node. General notes occur elsewhere.

K.1 文書ノード 情報項目

K.2 要素ノード 情報項目

K.3 属性ノード 情報項目

K.4 名前空間ノード 情報項目

K.5 処理命令ノード 情報項目

K.6 コメントノード 情報項目

K.7 テキストノード 情報項目

文書ノード
要素ノード
属性ノード
名前空間ノード
処理命令ノード
コメントノード
テキストノード