ZVON > Tutorials > XML Schema and Relax NG Tutorial |
Intro / Search / ZVON |
Index | >> Example 3 / 3 << | Prev | Next | |
Please, send all comments, bug-reports, and contributions to Jiri.Jirat@systinet.com. Thank you very much.
Relax NG keys: ns, choiceWe allow the "root" element to be from several namespaces, let's say: "http://foo", "http://bar", or "http://baz". That's not possible in XML Schema.
The treating of namespaces in Relax NG is smooth, consistent, natural, and easy.
Valid document <root xmlns="http://foo" >aaa</root> Valid document <root xmlns="http://baz" >bbb</root> |
Correct Relax NG schema (correctRelax_0.rng) <grammar xmlns="http://relaxng.org/ns/structure/1.0" > <start> <element> <choice> <name ns="http://foo">root</name> <name ns="http://bar">root</name> <name ns="http://baz">root</name> </choice> <text/> </element> </start> </grammar> Correct Relax NG schema (correctRelax_1.rng) |