| <grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="urn:test:simple.rng"> |
| <start> |
| <choice> |
| <element name="simple-element"> |
| <ref name="simple-element" /> |
| </element> |
| <element name="optional-element"> |
| <ref name="optional-element" /> |
| </element> |
| <element name="simple-attribute"> |
| <ref name="simple-attribute" /> |
| </element> |
| <element name="optional-attribute"> |
| <ref name="optional-attribute" /> |
| </element> |
| <element name="fixed-attribute"> |
| <ref name="fixed-attribute" /> |
| </element> |
| <element name="attribute-choice"> |
| <ref name="attribute-choice" /> |
| </element> |
| <element name="value-choice"> |
| <ref name="value-choice" /> |
| </element> |
| <element name="token-datatype"> |
| <ref name="token-datatype" /> |
| </element> |
| </choice> |
| </start> |
| |
| <define name="attribute-choice"> |
| <choice> |
| <group> |
| <attribute name="type"> |
| <value>a</value> |
| </attribute> |
| <element name="a"><empty /></element> |
| </group> |
| <group> |
| <attribute name="type"> |
| <value>b</value> |
| </attribute> |
| <element name="b"><empty /></element> |
| </group> |
| </choice> |
| </define> |
| |
| <define name="simple-element"> |
| <element name="b"> |
| <empty /> |
| </element> |
| </define> |
| |
| <define name="optional-element"> |
| <element name="b"> |
| <optional> |
| <element name="c"> |
| <empty /> |
| </element> |
| </optional> |
| </element> |
| </define> |
| |
| <define name="simple-attribute"> |
| <attribute name="x" /> |
| </define> |
| |
| <define name="optional-attribute"> |
| <optional> |
| <attribute name="x" /> |
| </optional> |
| </define> |
| |
| <define name="fixed-attribute"> |
| <attribute name="x"> |
| <value>1.0</value> |
| </attribute> |
| </define> |
| |
| <define name="value-choice"> |
| <attribute name="x"> |
| <choice> |
| <choice> |
| <value>a</value> |
| <value>b</value> |
| </choice> |
| </choice> |
| </attribute> |
| </define> |
| |
| <define name="token-datatype"> |
| <attribute name="a"><value>v</value></attribute> |
| <attribute name="b"><value>v</value></attribute> |
| <attribute name="c"><value>x y</value></attribute> |
| <attribute name="s1"><value type="string">v</value></attribute> |
| <attribute name="s2"><value type="string"> v </value></attribute> |
| <attribute name="s3"><value type="string">v</value></attribute> |
| </define> |
| </grammar> |