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

All > Relax NG > other > Test 127

Previous sample | Next sample

Author: James Clark
Origin: Testsuite for Relax NG


ElementsAttributes
attributens |
elementname |
name
text

ZVON comment: If the name element does not have any ns attribute, then the attribute is inherited from its ancestor which has ns attribute (if any, otherwise it is empty string). The attribute "bar" must be from the namespace "http://www.example.com".

Correct schema

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


Valid document:
<foo x:bar="whatever" xmlns:x="http://www.example.com" />

Invalid document:
<foo bar="whatever"/>