Understanding URIs : Namespace « Namespace « XML Tutorial






A URI (Uniform Resource Identifier) is a string of characters that identifies a resource. 
URI could be URL (Uniform Resource Locator), or URN (Universal Resource Name). 
The first part of the URL specifies the protocol.
For example, here's a URL to a web page on the Internet: http://www.google.com/intl/en/about.html 
A URN looks something like this: urn:foo:a123,456 

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.java2s.com" 
  xmlns="http://www.java2s.com"
  elementFormDefault="qualified">


  <xsd:element name="name" type="xsd:string" />

  <xsd:element name="source" type="xsd:string" />

</xsd:schema>








2.1.Namespace
2.1.1.Why We Need Namespaces
2.1.2.How XML Namespaces Work
2.1.3.Default Namespaces
2.1.4.Declaring Namespaces on Descendants
2.1.5.Understanding URIs
2.1.6.Change URI of namespace
2.1.7.Using Prefixes