ZVON > Tutorials > XML Schema and Relax NG Tutorial |
Intro / Search / ZVON |
Index | >> Example 2 / 4 << | Prev | Next | |
Please, send all comments, bug-reports, and contributions to Jiri.Jirat@systinet.com. Thank you very much.
XML Schema keys: elementFormDefaultAgain, it does not make a difference, whether we use "qualified" or "unqualified" value. 3.3.2 XML Representation of Element Declaration Schema Components . Because these elements are top-level (they have "schema" as a parent), they must be from the "targetNamespace".
Valid document <f:root xsi:schemaLocation="http://foo correct_0.xsd" xmlns:f="http://foo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > test </f:root> |
Correct XML Schema (correct_0.xsd) <xsd:schema targetNamespace="http://foo" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:foo="http://foo" > <xsd:element name="root" type="xsd:string"/> </xsd:schema> |
The value of the "elementFormDefault" does not play any role, explanation see above.
Valid document <f:root xsi:schemaLocation="http://foo correct_0.xsd" xmlns:f="http://foo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > test </f:root> |
Correct XML Schema (correct_0.xsd) <xsd:schema targetNamespace="http://foo" elementFormDefault="unqualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:foo="http://foo" > <xsd:element name="root" type="xsd:string"/> </xsd:schema> |