More tests from section 9 of the tutorial, Daniel

This commit is contained in:
Daniel Veillard 2003-01-30 14:12:27 +00:00
parent 0fb0106547
commit 80ec90acf1
11 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,24 @@
<grammar>
<start>
<element name="addressBook">
<zeroOrMore>
<element name="card">
<ref name="card.attlist"/>
</element>
</zeroOrMore>
</element>
</start>
<define name="card.attlist">
<group>
<attribute name="name">
<text/>
</attribute>
<attribute name="email">
<text/>
</attribute>
</group>
</define>
</grammar>

View File

@ -0,0 +1 @@
./test/relaxng/tutor9_6_1.xml validates

View File

@ -0,0 +1,4 @@
xmlRelaxNGValidateAttribute(name): 0
xmlRelaxNGValidateAttribute(email): 0
xmlRelaxNGValidateDefinition(): validated card : 0
xmlRelaxNGValidateDefinition(): validated addressBook : 0

View File

@ -0,0 +1,2 @@
Extra content for element addressBook
./test/relaxng/tutor9_6_2.xml validation generated an internal error

View File

@ -0,0 +1,5 @@
xmlRelaxNGValidateAttribute(name): 0
xmlRelaxNGValidateAttribute(email): -1
xmlRelaxNGValidateDefinition(): validated card : -1
error detected at relaxng.c:4341
xmlRelaxNGValidateDefinition(): validated addressBook : -1

View File

@ -0,0 +1,2 @@
Extra content for element addressBook
./test/relaxng/tutor9_6_3.xml validation generated an internal error

View File

@ -0,0 +1,5 @@
xmlRelaxNGValidateAttribute(name): 0
xmlRelaxNGValidateAttribute(email): 0
xmlRelaxNGValidateDefinition(): validated card : -1
error detected at relaxng.c:4341
xmlRelaxNGValidateDefinition(): validated addressBook : -1

24
test/relaxng/tutor9_6.rng Normal file
View File

@ -0,0 +1,24 @@
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<element name="addressBook">
<zeroOrMore>
<element name="card">
<ref name="card.attlist"/>
</element>
</zeroOrMore>
</element>
</start>
<define name="card.attlist">
<group>
<attribute name="name">
<text/>
</attribute>
<attribute name="email">
<text/>
</attribute>
</group>
</define>
</grammar>

View File

@ -0,0 +1,3 @@
<addressBook>
<card name="foo" email="bar"/>
</addressBook>

View File

@ -0,0 +1,3 @@
<addressBook>
<card name="foo"/>
</addressBook>

View File

@ -0,0 +1,3 @@
<addressBook>
<card name="foo" email="bar" error="extra"/>
</addressBook>