ZVON > Tutorials > XML Schema and Relax NG Tutorial |
Intro / Search / ZVON |
Index | >> Example 5 / 10 << | Prev | Next | |
The root element named "root" can have an arbitrary number of attributes from any namespace, except let's say "http://bar" and "http://baz". I do not know, how to do this with XML Schema.
We will exclude all attributes from namespaces "http://bar" and "http://baz" using the "except" and "nsName" elements.
Invalid document <root bar:a="1" xmlns="http://foo" xmlns:bar="http://bar" /> Invalid document <root baz:a="1" xmlns="http://foo" xmlns:baz="http://baz" /> Valid document <root a="1" xmlns="http://foo" /> Valid document <foo:root bzz:a="1" xmlns:foo="http://foo" xmlns:bzz="http://bzz" /> |
Correct Relax NG schema (correctRelax_0.rng) |