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

All > Relax NG > Simplification - ns attribute > Test 123

Previous sample | Next sample

Author: James Clark
Origin: Testsuite for Relax NG


ElementsAttributes
attribute
elementname | ns |
name

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


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

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