XML Schema and Namespaces

For the most part, the XML Schema concept is easy to understand, but the namespaces need some clarifications.

XML Schema has three namespaces. The first is the XML Schema namespace, which refers to XML Schema definitions such as datatypes and XML Schema elements/attributes, shown as follows:

<xsd:schema xmlns:xsd=“http://www.w3.org/2001/XMLSchema”...>

The second namespace is the target namespace defined for XML documents:

<xsd:schema xmlns:xsd=“http://www.w3.org/2001/XMLSchema”

                         targetNamespace=“http://www.xmlbook.com”..

In XML Schema, you can specify if the defined document elements or attributes are qualified by the defined target namespace using the following XML Schema attributes:

elementFormDefault ...

Get Oracle Database 11g Building Oracle XML DB Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.