JIS X 4177-2:2005 文書スキーマ定義言語(DSDL)―第2部:正規文法に基づく妥当性検証―RELAX NG | ページ 8

                                                                                             33
X 4177-2 : 2005 (ISO/IEC 19757-2 : 2003)
<element>
<name ns="http://www.example.com/n2">bar2</name>
<empty/>
</element>
</define>
</grammar>
備考 厳密に言えば,単純化の結果はデータモデルに従うインスタンスであってXML文書ではない。
簡便さのために,データモデルに従うインスタンスをXML文書によって表現する。
B.4 妥当性検証の例 e0の値が,次のとおりと仮定する。
element( name( "", "foo" ), cx0, [{}], m )
ここで,mは次のとおりとする。
e1, e2
さらに,e1は及びe2はそれぞれ次のとおりとする。
element( name( "http://www.example.com/n1", "bar1" ), cx1, [{}], ( ) )
element( name( "http://www.example.com/n2", "bar2" ), cx2, [{}], ( ) )
cx0, cx1及びcx2が適切に定義されている場合,これらはB.1に示す文書を表現する。
B.3のスキーマに照らしてe0が妥当であることをどのように示すかを説明する。このスキーマは,次の
命題と同等になる。
start() = <ref name="foo"/>
deref("foo.element") = <element> <name ns=""> "foo" </name> <group> <ref name="bar1"/>
<ref name="bar2"/> </group> </element>
deref("bar1.element") = <element> <name ns="http://www.example.com/n1"> "bar1" </name>
<empty/> </element>
deref("bar2.element") = <element> <name ns="http://www.example.com/n2"> "bar2" </name>
<empty/> </element>
名前クラスnc1及びnc2が,それぞれ次であるとする。
<name ns="http://www.example.com/n1"> "bar1" </name>
<name ns="http://www.example.com/n2"> "bar2" </name>

――――― [JIS X 4177-2 pdf 36] ―――――

34
X 4177-2 : 2005 (ISO/IEC 19757-2 : 2003)
このとき,9.2の推論規則(name)によって,次の二つを得る。
name( "http://www.example.com/n1", "bar1" ) n nc1
name( "http://www.example.com/n2", "bar2" ) n nc2
9.3.3の推論規則(empty)によって,次の二つを得る。
cx1 |- [{}]; ( ) =~ <empty/>
cx2 |- [{}]; ( ) =~ <empty/>
9.3.7の推論規則(element)によって,次を得る。
cx0 |- [{}]; e1 =~ <ref name="bar1"/>
ここで,任意の文脈が利用できるので,cx0を選んでいることに注意する。
同様にして,次を得る。
cx0 |- [{}]; e2 =~ <ref name="bar2"/>
9.3.1の推論規則(group)によって,次を得る。
cx0 |- [{}]; e1, e2 =~ <group> <ref name="bar1"/> <ref name="bar2"/> </group>
9.3.7の推論規則(element)によって,次を得る。
cx3 |- [{}]; element( name( "", "foo" ), cx0, [{}], m ) =~ <ref name="foo"/>
ここで,cx3 は任意の文脈とする
このようにして,9.4の推論規則(valid)が適用できて,次を得る。
valid(e0)

――――― [JIS X 4177-2 pdf 37] ―――――

                                                                                             35
X 4177-2 : 2005 (ISO/IEC 19757-2 : 2003)
附属書C(参考)文献
この附属書は,本体及び附属書A(規定)に関連する事柄を補足するもので,規定の一部ではない。
[1] RELAX NG仕様書, OASIS Committee Specification, 2001年12月3日,
http://www.oasis-open.org/committees/relax-ng/spec-20011203.htmlから入手可能。
[2] RELAX NGチュートリアル, OASIS Committee Specification, 2001年12月3日,
http://www.oasis-open.org/committees/relax-ng/tutorial-20011203.htmlから入手可能。

――――― [JIS X 4177-2 pdf 38] ―――――

JIS X 4177-2:2005の引用国際規格 ISO 一覧

  • ISO/IEC 19757-2:2003(IDT)

JIS X 4177-2:2005の国際規格 ICS 分類一覧

JIS X 4177-2:2005の関連規格と引用規格一覧

規格番号
規格名称