ZVON > References > Zvon Example Repository
Example repository: index | categories | search

All > Relax NG > Simplification - number of child elements > Test 140

Previous sample | Next sample

Author: James Clark
Origin: Testsuite for Relax NG


ElementsAttributes
anyName
element
empty
except
name

ZVON comment: The root element can have any name with the exception of "foo", "bar", or "baz".

Correct schema

<element xmlns:html="http://www.w3.org/TR/REC-html40" xmlns="http://relaxng.org/ns/structure/1.0" >
     <anyName>
          <except>
               <name>foo</name>
               <name>bar</name>
               <name>baz</name>
          </except>
     </anyName>
     <empty/>
</element>


Valid document:
<xyzzy/>

Invalid document:
<foo/>

Invalid document:
<bar/>

Invalid document:
<baz/>