ISO/IEC 19757-2:2008 情報技術—ドキュメントスキーマ定義言語(DSDL)—パート2:正規文法ベースの検証— RELAX NG | ページ 2

※一部、英文及び仏文を自動翻訳した日本語訳を使用しています。

序文

ISO (国際標準化機構) と IEC (国際電気標準会議) は、世界標準化のための専門システムを形成しています。 ISO または IEC のメンバーである各国団体は、特定の技術活動分野に対処するためにそれぞれの組織によって設立された技術委員会を通じて国際規格の開発に参加しています。 ISO と IEC の技術委員会は、相互に関心のある分野で協力します。政府および非政府の他の国際機関も、ISO および IEC と連携してこの作業に参加しています。情報技術の分野では、ISO と IEC は共同技術委員会 ISO/IEC JTC 1 を設立しました。

国際規格は、ISO/IEC 指令第 2 Part に規定されている規則に従って草案されています。

合同技術委員会の主な任務は、国際規格を作成することです。合同技術委員会によって採択された国際規格草案は、投票のために各国機関に配布されます。国際規格として発行するには、投票を行っている国家機関の少なくとも 75% による承認が必要です。

この文書の要素の一部が特許権の対象となる可能性があることに注意してください。 ISO および IEC は、そのような特許権の一部またはすべてを特定する責任を負わないものとします。

ISO/IEC 19757-2 は、合同技術委員会 ISO/IEC JTC 1, 情報技術、サブ委員会 SC 34, 文書記述および処理言語によって作成されました。

この第 2 版は、第 1 版 (ISO/IEC 19757-2:2003) を廃止し、置き換えるものであり、そのマイナーリビジョンを構成します。また、改正 ISO/IEC 19757-2:2003/Amd.1:2006 も組み込まれています。

ISO/IEC 19757 は、情報技術 — ドキュメント スキーマ定義言語 (DSDL) という一般タイトルのもと、次の部分で構成されています。

  • Part 2: 通常の文法ベースの検証 — RELAX NG
  • Part 3: ルールベースの検証 — Schematron
  • Part 4: 名前空間ベースの検証ディスパッチ言語 — NVDL
  • Part 8: ドキュメント セマンティクスの名前変更言語 — DSRL
  • Part 9: 文書Type 定義 (DTD) における名前空間とデータ型の宣言

以下の部分が準備中です。

  • Part 1: 概要
  • Part 5: 拡張可能なデータ型
  • Part 7: 文字レパートリー記述言語 (CREPDL)

導入

ISO/IEC 19757 のこの部分の構造は次のとおりです。第 5 項では、データ モデルについて説明します。データ モデルは、文書の残りの部分全体で使用される XML 文書の抽象化です。条項 6 では、RELAX NG スキーマの構文について説明します。第 7 条では、RELAX NG スキーマを簡素化するために適用される一連の変換について説明し、RELAX NG スキーマに関する追加の要件も指定します。第 8 条では、変換を適用した結果得られる構文について説明します。この単純な構文は完全な構文のサブセットです。第 9 条では、単純な構文を使用する正しい RELAX NG スキーマのセマンティクスについて説明します。セマンティクスは、RELAX NG スキーマに関して要素がいつ有効であるかを指定します。第 10 条では、単純な形式に変換された後の RELAX NG スキーマに適用される要件について説明します。最後に、第 11 条では、RELAX NG バリデータの適合要件について説明します。

ISO/IEC 19757 のこの部分は RELAX NG 仕様[1] に基づいており、付録 C に示されているコンパクト構文は RELAX NG コンパクト構文[3] に基づいています。RELAX NG のチュートリアルは別途入手可能です (RELAX NGチュートリアル[2] )。

1 スコープ

ISO/IEC 19757 のこの部分では、XML のスキーマ言語である RELAX NG が指定されています。 RELAX NG スキーマは、XML ドキュメントの構造とコンテンツのパターンを指定します。パターンは通常のツリー文法を使用して指定されます。 ISO/IEC 19757 のこの部分では、RELAX NG スキーマの要件を確立し、XML ドキュメントが RELAX NG スキーマで指定されたパターンに一致する場合を指定します。

2 規範的参照

この文書を適用するためには、以下の参照文書が不可欠です。日付が記載された参考文献については、引用された版のみが適用されます。日付のない参照については、参照文書の最新版 (修正を含む) が適用されます。

次の各文書には、本文内で文書を引用するために使用される一意の識別子があります。一意の識別子は、最初のカンマまでの参照の部分で構成されます。

  • W3C XML, Extensible Markup Language (XML) 1.0 (Second Edition) 、W3C 勧告、2000 年 10 月 6 日、 http://www.w3.org/TR/2000/REC-xml-20001006 で入手可能
  • W3C XML Names, Namespaces in XML 、W3C 勧告、1999 年 1 月 14 日、 http://www.w3.org/TR/1999/REC-xml-names-19990114/ で入手可能
  • W3C
  • W3C XML Infoset, XML Information Set 、W3C 勧告、2001 年 10 月 24 日、 http://www.w3.org/TR/2001/REC-xml-infoset-20011024/ で入手可能
  • IETF RFC 2045, 多目的インターネット メール拡張機能 (MIME) Part 1: インターネット メッセージ本文の形式、インターネット標準トラック仕様、1996 年 11 月、 http://www.ietf.org/rfc/rfc2045.txt で入手可能
  • IETF RFC 2046, 多目的インターネット メール拡張機能 (MIME) Part 2: メディア タイプ、インターネット標準トラック仕様、1996 年 11 月、 http://www.ietf.org/rfc/rfc2046.txt で入手可能
  • IETF RFC 2396, 統一リソース識別子 (URI): 汎用構文、インターネット標準トラック仕様、 1998 年 8 月、 http://www.ietf.org/rfc/rfc2396.txt で入手可能
  • IETF RFC 2732, URL 内のリテラル IPv6 アドレスの形式、インターネット標準トラック仕様、1999 年 12 月、 http://www.ietf.org/rfc/rfc2732.txt で入手可能
  • IETF RFC 3023, XML メディア タイプ、インターネット標準トラック仕様、 1998 年 8 月、 http://www.ietf.org/rfc/rfc3023.txt で入手可能

3 用語と定義

この文書の目的上、次の用語と定義が適用されます。

3.1

リソース.リソース

ID を持つもの、URI でアドレス指定できる可能性があるもの

3.2

URI

IETF RFC 2396 で定義された構文を使用して抽象リソースまたは物理リソースを識別するコンパクトな文字列

3.3

URIリファレンス

URI または相対 URI とオプションのフラグメント識別子

3.4

相対URI

ベース URI に関して解決して別の URI を生成できる URI 参照の形式

3.5

ベースURI

相対 URI を解決するために使用される URI

3.6

フラグメント識別子

URI の取得アクションが正常に実行された後にユーザー エージェントによって使用される URI 参照内の追加情報

3.7

実例

RELAX NG スキーマに関して検証中の XML ドキュメント

3.8

スペース文字

コード値 #x20 の文字

3.9

空白文字

コード値 #x20, #x9, #xA, または #xD を持つ文字

3.10

名前

URIとローカル名のペア

3.11

名前空間URI

名前の一部である URI

3.12

地元の名前

名前の一部である NCName

3.13

NC名

W3C XML 名の NCName 生成に一致する文字列

3.14

名前クラス

名前と照合できるスキーマの一部

3.15

パターン

一連の属性、一連の要素および文字列と照合できるスキーマの一部

3.16

外国の属性

名前空間 URI が空の文字列でも RELAX NG 名前空間 URI でもない名前を持つ属性

3.17

外部要素

名前空間 URI が RELAX NG 名前空間 URI ではない名前を持つ要素

3.18

完全な構文

簡略化前のRELAX NG文法の構文

3.19

単純な構文

簡略化後の RELAX NG 文法の構文

3.20

単純化

完全な構文の RELAX NG スキーマから単純な構文のスキーマへの変換

3.21

データ型ライブラリ

ローカル名からデータ型へのマッピング

注記 1:データ型ライブラリーは URI によって識別されます。

3.22

データ型

文字列のセットとそのセット上の等価関係

3.23

公理

無条件に証明できる命題

3.24

推論ルール

1 つ以上の正または負の先行件と 1 つの後件から構成されるルール。すべての正の先行件が証明可能であり、負の先行件がどれも証明できない場合に、一貫して証明可能になります。

3.25

スキーマに関して有効

スキーマによって記述された XML ドキュメントのセットのメンバー

3.26

スキーム

XML ドキュメントのセットの仕様

3.27

文法

NCName からパターンへのマッピングとともにパターンを開始します

3.28

正しいスキーム

ISO/IEC 19757 のこの部分のすべての要件を満たすスキーマ

3.29

バリデーター

スキーマが正しいかどうか、およびインスタンスがスキーマに関して有効であるかどうかを判断するソフトウェア モジュール

3.30

パス

/ または// で区切られた NCName のリスト

3.31

情報セット

W3C XML Infoset によって定義された XML ドキュメントの抽象化

3.32

情報項目

情報セットの一部

3.33

データモデル

ISO/IEC 19757 のこの部分で定義された XML ドキュメントの抽象表現

3.34

XMLドキュメント

W3C XML で定義されている整形式の XML ドキュメントである文字列

3.35

EBNF

拡張BNF

文脈自由文法を記述するために使用される表記法

3.36

弱いマッチング

9.3.7で詳細に指定されたマッチングの種類

3.37

範囲内の文法

最も近い祖先の文法要素

3.38

コンテンツタイプ

空、複雑、単純の 3 つの値のいずれか

3.39

混合シーケンス

要素と文字列の両方を含むシーケンス

参考文献

1RELAX NG 仕様、OASIS 委員会仕様、2001 年 12 月 3 日、 http://www.oasis-open.org/committees/relax-ng/spec-20011203.html で入手可能
2RELAX NG チュートリアル、OASIS 委員会仕様、2001 年 12 月 3 日、 http://www.oasis-open.org/committees/relax-ng/tutorial-20011203.html で入手可能
3RELAX NG Compact Syntax 、Oasis Committee の仕様、2002 年 11 月 21 日、 http://www.oasis-open.org/committees/relax-ng/compact-20021121 .html で入手可能

Foreword

ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1.

International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2.

The main task of the joint technical committee is to prepare International Standards. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote.

Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights.

ISO/IEC 19757-2 was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology, Subcommittee SC 34, Document description and processing languages.

This second edition cancels and replaces the first edition (ISO/IEC 19757-2:2003), of which it constitutes a minor revision. It also incorporates the Amendment ISO/IEC 19757-2:2003/Amd.1:2006.

ISO/IEC 19757 consists of the following parts, under the general title Information technology — Document SchemaDefinition Language (DSDL):

  • Part 2: Regular-grammar-based validation — RELAX NG
  • Part 3: Rule-based validation — Schematron
  • Part 4: Namespace-based validation dispatching language — NVDL
  • Part 8: Document semantics renaming language — DSRL
  • Part 9: Namespace and datatype declaration in Document Type Definitions (DTDs)

The following parts are under preparation:

  • Part 1: Overview
  • Part 5: Extensible Datatypes
  • Part 7: Character Repertoire Description Language (CREPDL)

Introduction

The structure of this part of ISO/IEC 19757 is as follows. Clause 5 describes the data model, which is the abstraction of an XML document used throughout the rest of the document. Clause 6 describes the syntax of a RELAX NG schema. Clause 7 describes a sequence of transformations that are applied to simplify a RELAX NG schema, and also specifies additional requirements on a RELAX NG schema. Clause 8 describes the syntax that results from applying the transformations; this simple syntax is a subset of the full syntax. Clause 9 describes the semantics of a correct RELAX NG schema that uses the simple syntax; the semantics specify when an element is valid with respect to a RELAX NG schema. Clause 10 describes requirements that apply to a RELAX NG schema after it has been transformed into simple form. Finally, Clause 11 describes conformance requirements for RELAX NG validators.

This part of ISO/IEC 19757 is based on the RELAX NG Specification [1] , and the compact syntax shown in Annex C is based on the RELAX NG Compact Syntax [3] , A tutorial for RELAX NG is available separately (see the RELAX NG Tutorial [2] ).

1 Scope

This part of ISO/IEC 19757 specifies RELAX NG, a schema language for XML. A RELAX NG schema specifies a pattern for the structure and content of an XML document. The pattern is specified by using a regular tree grammar. This part of ISO/IEC 19757 establishes requirements for RELAX NG schemas and specifies when an XML document matches the pattern specified by a RELAX NG schema.

2 Normative references

The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

NOTE Each of the following documents has a unique identifier that is used to cite the document in the text. The unique identifier consists of the part of the reference up to the first comma.

  • W3C XML, Extensible Markup Language (XML) 1.0 (Second Edition), W3C Recommendation, 6 October 2000, available at http://www.w3.org/TR/2000/REC-xml-20001006
  • W3C XML-Names, Namespaces in XML, W3C Recommendation, 14 January 1999, available at http://www.w3.org/TR/1999/REC-xml-names-19990114/
  • W3C XLink, XML Linking Language (XLink) Version 1.0, W3C Recommendation, 27 June 2001, available at http://www.w3.org/TR/2001/REC-xlink-20010627/
  • W3C XML-Infoset, XML Information Set, W3C Recommendation, 24 October 2001, available at http://www.w3.org/TR/2001/REC-xml-infoset-20011024/
  • IETF RFC 2045, Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies, Internet Standards Track Specification, November 1996, available at http://www.ietf.org/rfc/rfc2045.txt
  • IETF RFC 2046, Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types, Internet Standards Track Specification, November 1996, available at http://www.ietf.org/rfc/rfc2046.txt
  • IETF RFC 2396, Uniform Resource Identifiers (URI): Generic Syntax, Internet Standards Track Specification, August 1998, available at http://www.ietf.org/rfc/rfc2396.txt
  • IETF RFC 2732, Format for Literal IPv6 Addresses in URL's, Internet Standards Track Specification, December 1999, available at http://www.ietf.org/rfc/rfc2732.txt
  • IETF RFC 3023, XML Media Types, Internet Standards Track Specification, August 1998, available at http://www.ietf.org/rfc/rfc3023.txt

3 Terms and definitions

For the purposes of this document, the following terms and definitions apply.

3.1

resource

something with identity, potentially addressable by a URI

3.2

URI

compact string of characters that uses the syntax defined in IETF RFC 2396 to identify an abstract or physical resource

3.3

URI reference

URI or relative URI and optional fragment identifier

3.4

relative URI

form of URI reference that can be resolved with respect to a base URI to produce another URI

3.5

base URI

URI used to resolve relative URIs

3.6

fragment identifier

additional information in a URI reference used by a user agent after the retrieval action on a URI has been successfully performed

3.7

instance

XML document that is being validated with respect to a RELAX NG schema

3.8

space character

character with the code value #x20

3.9

whitespace character

character with the code value #x20, #x9, #xA or #xD

3.10

name

pair of a URI and a local name

3.11

namespace URI

URI that is part of a name

3.12

local name

NCName that is part of a name

3.13

NCName

string that matches the NCName production of W3C XML-Names

3.14

name class

part of a schema that can be matched against a name

3.15

pattern

part of a schema that can be matched against a set of attributes and a sequence of elements and strings

3.16

foreign attribute

attribute with a name whose namespace URI is neither the empty string nor the RELAX NG namespace URI

3.17

foreign element

element with a name whose namespace URI is not the RELAX NG namespace URI

3.18

full syntax

syntax of a RELAX NG grammar before simplification

3.19

simple syntax

syntax of a RELAX NG grammar after simplification

3.20

simplification

transformation of a RELAX NG schema in the full syntax to a schema in the simple syntax

3.21

datatype library

mapping from local names to datatypes

Note 1 to entry: A datatype library is identified by a URI.

3.22

datatype

set of strings together with an equivalence relation on that set

3.23

axiom

proposition that is provable unconditionally

3.24

inference rule

rule consisting of one or more positive or negative antecendents and exactly one consequent, which makes the consequent provable if all the positive antecedents are provable and none of the negative antecendents is provable

3.25

valid with respect to a schema

member of the set of XML documents described by the schema

3.26

schema

specification of a set of XML documents

3.27

grammar

start pattern together with a mapping from NCNames to patterns

3.28

correct schema

schema that satisfies all the requirements of this part of ISO/IEC 19757

3.29

validator

software module that determine whether a schema is correct and whether an instance is valid with respect to a schema

3.30

path

list of NCNames separated by/ or//

3.31

infoset

an abstraction of an XML document defined by W3C XML-Infoset

3.32

information item

constituent of an information set

3.33

data model

abstract representation of an XML document defined by this part of ISO/IEC 19757

3.34

XML document

string that is a well-formed XML document as defined in W3C XML

3.35

EBNF

Extended BNF

notation used to described context-free grammars

3.36

weak matching

kind of matching specified in detail in 9.3.7

3.37

in-scope grammar

nearest ancestor grammar element

3.38

content-type

one of the three values empty, complex, or simple

3.39

mixed sequence

sequence that may contain both elements and strings

Bibliography

1RELAX NG Specification, OASIS Committee Specification, 3 December 2001, available at http://www.oasis-open.org/committees/relax-ng/spec-20011203.html
2RELAX NG Tutorial, OASIS Committee Specification, 3 December 2001, available at http://www.oasis-open.org/committees/relax-ng/tutorial-20011203.html
3RELAX NG Compact Syntax, Oasis Committee Specification, 21 November 2002, available at http://www.oasis-open.org/committees/relax-ng/compact-20021121 .html