39 付録: XML文法形式のためのスキーマ

この付録が標準となる。

	<?xml version="1.0" encoding="ISO-8859-1"?>
	<schema targetNamespace="http://www.w3.org/2001/06/grammar"
	           xmlns:xml="http://www.w3.org/XML/1998/namespace"
	           xmlns:t="http://www.w3.org/2001/06/grammar"
	           xmlns="http://www.w3.org/2001/XMLSchema"
	           elementFormDefault="qualified">
	  <import namespace="http://www.w3.org/XML/1998/namespace" 
	           schemaLocation="http://www.w3.org/2001/xml.xsd"/>
	  <simpleType name="lang-list">
	    <restriction base="NMTOKENS"/>
	  </simpleType>
	  <simpleType name="tag">
	    <restriction base="string"/>
	  </simpleType>
	  <simpleType name="example">
	    <restriction base="string"/>
	  </simpleType>
	  <group name="rule-expansion">
	    <choice>
	      <element name="token" type="t:token"/>
	      <element name="ruleref" type="t:ruleref"/>
	      <element name="item" type="t:item"/>
	      <element name="one-of" type="t:one-of"/>
	      <element name="tag" type="t:tag"/>
	    </choice>
	  </group>
	  <complexType name="ruleref">
	    <attribute name="type" type="string"/>
	    <attribute name="uri" type="anyURI"/>
	    <attribute name="alias" type="string"/>
	    <attribute name="special">
	      <simpleType>
	        <restriction base="NMTOKEN">
	          <enumeration value="NULL"/>
	          <enumeration value="VOID"/>
	          <enumeration value="GARBAGE"/>
	        </restriction>
	      </simpleType>
	    </attribute>
	    <attribute name="lang-list" type="t:lang-list"/>
	  </complexType>
	  <complexType name="token" mixed="true">
	    <annotation>
	      <documentation>
	       does not expression the constraint that empty content is illegal
	      </documentation>
	    </annotation>
	    <attribute name="lang-list" type="t:lang-list"/>
	  </complexType>
	  <complexType name="one-of">
	    <sequence minOccurs="0" maxOccurs="unbounded">
	      <element name="item" type="t:item"/>
	    </sequence>
	    <attribute name="lang-list" type="t:lang-list"/>
	  </complexType>
	  <complexType name="item" mixed="true">
	    <choice minOccurs="0" maxOccurs="unbounded">
	      <group ref="t:rule-expansion"/>
	    </choice>
	    <attribute name="repeat-prob">
	      <simpleType>
	        <restriction base="float">
	          <minInclusive value="0.0"/>
	          <maxInclusive value="1.0"/>
	          <pattern value="[0-9]+(.[0-9]+)?"/>
	          <pattern value="([0-9]+)?.[0-9]+"/>
	        </restriction>
	      </simpleType>
	    </attribute>
	    <attribute name="repeat">
	      <simpleType>
	        <annotation>
	          <documentation>
	 does not expression the constraint in n-m that m must be greater than n
	          </documentation>
	        </annotation>
	        <restriction base="string">
	          <pattern value="[0-9]+"/>
	          <pattern value="[0-9]+-([0-9]+)?"/>
	          <pattern value="([0-9]+)?-[0-9]+"/>
	        </restriction>
	      </simpleType>
	    </attribute>
	    <attribute name="weight">
	      <simpleType>
	        <restriction base="float">
	          <minInclusive value="0.0"/>
	          <pattern value="[0-9]+"/>
	          <pattern value="([0-9]+)?.[0-9]+"/>
	        </restriction>
	      </simpleType>
	    </attribute>
	  </complexType>
	  <complexType name="rule" mixed="true">
	    <choice minOccurs="0" maxOccurs="unbounded">
	      <group ref="t:rule-expansion"/>
	      <element name="example" type="t:example"/>
	    </choice>
	    <attribute name="id" use="required">
	      <simpleType>
	        <annotation>
	          <documentation>
does not expression the constraint that NULL VOID GARBAGE are illegal as \
    rule name
	          </documentation>
	        </annotation>
	        <restriction base="ID">
	          <pattern value="[^.:-]+"/>
	        </restriction>
	      </simpleType>
	    </attribute>
	    <attribute name="scope" default="private">
	      <simpleType>
	        <restriction base="NMTOKEN">
	          <enumeration value="private"/>
	          <enumeration value="public"/>
	        </restriction>
	      </simpleType>
	    </attribute>
	  </complexType>
	  <complexType name="alias">
	    <attribute name="type" type="string"/>
	    <attribute name="uri" type="anyURI" use="required"/>
	    <attribute name="name" type="NMTOKEN" use="required"/>
	  </complexType>
	  <complexType name="lexicon">
	    <attribute name="uri" type="anyURI" use="required"/>
	  </complexType>
	  <complexType name="meta">
	    <attribute name="name" type="NMTOKEN"/>
	    <attribute name="content" type="string" use="required"/>
	    <attribute name="http-equiv" type="NMTOKEN"/>
	  </complexType>
	  <complexType name="grammar">
	    <choice minOccurs="0" maxOccurs="unbounded">
	      <element name="alias" type="t:alias"/>
	      <element name="lexicon" type="t:lexicon"/>
	      <element name="meta" type="t:meta"/>
	      <element name="rule" type="t:rule"/>
	    </choice>
	    <attribute name="tag-format" type="string"/>
	    <attribute name="version" type="NMTOKEN" use="required"/>
	    <attribute ref="xml:lang"/>
	    <attribute name="root">
	      <simpleType>
	        <annotation>
	          <documentation>
	 does not expression the constraint that NULL VOID GARBAGE are illegal as \
    rule name
	          </documentation>
	        </annotation>
	        <restriction base="IDREF">
	          <pattern value="[^.:-]+"/>
	        </restriction>
	      </simpleType>
	    </attribute>
	    <attribute name="mode" default="voice">
	      <simpleType>
	        <restriction base="NMTOKEN">
	          <enumeration value="voice"/>
	          <enumeration value="dtmf"/>
	        </restriction>
	      </simpleType>
	    </attribute>
	  </complexType>
	  <element name="grammar" type="t:grammar"/>
	</schema>