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.
XML Schema keys: targetNamespaceWhen the namespace of the root element does not match the targetNamespace, it's an error (well, I think). I would compare this to having no "matching" rules in XSLT. See ( 3.3.4 Element Declaration Validation Rules Validation Rule: Element Locally Valid (Element): no. 1 ). We can't say what's wrong - whether the schema or the document.
Invalid document <f:root xsi:schemaLocation="http://foo incorrect_0.xsd" xmlns:f="http://foo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > test </f:root> |
Incorrect XML Schema (incorrect_0.xsd) <xsd:schema targetNamespace="http://bar" xmlns:xsd="http://www.w3.org/2001/XMLSchema" > <xsd:element name="root" type="xsd:string"/> </xsd:schema> |