Target Namespaces : Introduction « XML Schema « XML Tutorial






The primary purpose of XML Schemas is to declare vocabularies. 
These vocabularies can be identified by a namespace that is specified in the targetNamespace attribute.
Not all XML Schemas will have a targetNamespace.
Many XML Schemas define vocabularies that are reused in another XML Schema.

Possible targetNamespace declarations include the following: 

<schema xmlns="http://www.w3.org/2001/XMLSchema" 
        targetNamespace="http://www.java2s.com/name" 
        xmlns:target="http://www.java2s.com/name"> 

or 

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           targetNamespace="http://www.java2s.com/name" 
           xmlns="http://www.java2s.com/name"> 


In the first declaration, the <schema> element uses the default namespace. 
Because of this the target namespace http://www.java2s.com/name requires the use of a prefix. 

In the second declaration, the <schema> element requires the use of a prefix.
Because the target namespace http://www.java2s.com/nameis using a default namespace declaration.








3.1.Introduction
3.1.1.Getting Started with XML Schemas
3.1.2.XML Schema defines the name vocabulary.
3.1.3. Declarations
3.1.4. element is the root element within an XML Schema.
3.1.5.Target Namespaces
3.1.6.Simple and Complex Types
3.1.7.Primitive Datatypes
3.1.8.Derived Datatypes
3.1.9.Useful built-in simple types
3.1.10.Create global complex types
3.1.11.Derivation by extension
3.1.12.Derivation by restriction