Commit 80ec90ac authored by Daniel Veillard's avatar Daniel Veillard

More tests from section 9 of the tutorial, Daniel

parent 0fb01065
<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>
./test/relaxng/tutor9_6_1.xml validates
xmlRelaxNGValidateAttribute(name): 0
xmlRelaxNGValidateAttribute(email): 0
xmlRelaxNGValidateDefinition(): validated card : 0
xmlRelaxNGValidateDefinition(): validated addressBook : 0
Extra content for element addressBook
./test/relaxng/tutor9_6_2.xml validation generated an internal error
xmlRelaxNGValidateAttribute(name): 0
xmlRelaxNGValidateAttribute(email): -1
xmlRelaxNGValidateDefinition(): validated card : -1
error detected at relaxng.c:4341
xmlRelaxNGValidateDefinition(): validated addressBook : -1
Extra content for element addressBook
./test/relaxng/tutor9_6_3.xml validation generated an internal error
xmlRelaxNGValidateAttribute(name): 0
xmlRelaxNGValidateAttribute(email): 0
xmlRelaxNGValidateDefinition(): validated card : -1
error detected at relaxng.c:4341
xmlRelaxNGValidateDefinition(): validated addressBook : -1
<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>
<addressBook>
<card name="foo" email="bar"/>
</addressBook>
<addressBook>
<card name="foo"/>
</addressBook>
<addressBook>
<card name="foo" email="bar" error="extra"/>
</addressBook>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment