Mega Code Archive

 
Categories / XML Tutorial / XML Schema
 

Target Namespaces

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.rntsoft.com/name"          xmlns:target="http://www.rntsoft.com/name">  or  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"             targetNamespace="http://www.rntsoft.com/name"             xmlns="http://www.rntsoft.com/name">  In the first declaration, the <schema> element uses the default namespace.  Because of this the target namespace http://www.rntsoft.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.rntsoft.com/nameis using a default namespace declaration.