5.4. Namespaces
Schemas are reasonably well integrated with namespaces. The xs:schema element, for example, should normally have a targetNamespace attribute. It indicates the namespace in which the elements and attributes defined by the schema should appear. If no such attribute exists, the schema is intended for unqualified names—perhaps to validate some XML designed before namespaces were recommended.
When a targetNamespace exists, that namespace must qualify all global elements and attributes. Local elements and attributes are a different matter, however. By default, they are unqualified and, in effect, get their namespace from their nearest global ancestor. But either or both of the elementForm-Default and attributeFormDefault attributes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access