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

All > Relax NG > Simplification - mixed element > Test 138

Previous sample | Next sample

Author: James Clark
Origin: Testsuite for Relax NG


ElementsAttributes
elementname |
empty
mixed

ZVON comment: Element "foo" must have mixed content with exactly 3 "bar" children and no other elements.

Correct schema

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


Valid document:
<foo>
     <bar/>
     <bar/>
     <bar/>
</foo>

Invalid document:
<foo>
     <bar/>
     <bar/>
     <bar/>
     <bar/>
     <bar/>
     <bar/>
</foo>

Invalid document:
<foo>
     <bar/>
     <bar/>
</foo>

Invalid document:
<foo>
     <bar/>
</foo>

Invalid document:
<foo/>

Valid document:
<foo>
     <bar/>X
     <bar/>
     <bar/>
</foo>

Invalid document:
<foo>X</foo>

Invalid document:
<foo>
     <bar/>
     <bar/>
     <bar/>
     <bar/>
</foo>