• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML namespace url doubt

 
Divya Gehlot
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have doubt regarding XML namespace.
FOr eg.in below example in
xmlns="http://simple.example.com/CInfoXmlDoc"

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<ContactInformation
xmlns="http://simple.example.com/CInfoXmlDoc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://simple.example.com/CInfoXmlDoc
file:./CInfoXmlDoc.xsd">
<Name>John doe</Name>
<Address>
<Street>4140 Network Circle</Street>
<City>Santa Clara</City>
<State>California</State>
<Country>USA</Country>
</Address>
<HomePhone>123-456-7890</HomePhone>
<EMail>j2eeblueprints@sun.com</EMail>
</ContactInformation>

Can any one tell what it means will it refer any document.
I am not getting any clear idea of it.
what the usage of the url
As I dont have practical experience of JWS.
Can any one elaborate on this.
Thanks in advance.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"http://simple.example.com/CInfoXmlDoc" in xmlns="http://simple.example.com/CInfoXmlDoc" isn't a URL (Universal Resource Locator) it is a URI (Universal Resource Identifier). A URI isn't an address, so doesn't have to "point" to anything. In this particular case the location of the schema for the "http://simple.example.com/CInfoXmlDoc" elements is given by
xsi:schemaLocation="http://simple.example.com/CInfoXmlDoc file:./CInfoXmlDoc.xsd"
so the schema is in the same directory as this XML file under the name of CInfoXmlDoc.xsd.

xmlns="http://simple.example.com/CInfoXmlDoc" identifies the default namespace for any nested elements without a prefix. So the fully qualified names for the elements are actually:
{http://simple.example.com/CInfoXmlDoc}Name
{http://simple.example.com/CInfoXmlDoc}Address
{http://simple.example.com/CInfoXmlDoc}Street
{http://simple.example.com/CInfoXmlDoc}City
{http://simple.example.com/CInfoXmlDoc}State
{http://simple.example.com/CInfoXmlDoc}Country
{http://simple.example.com/CInfoXmlDoc}Address
{http://simple.example.com/CInfoXmlDoc}HomePhone
{http://simple.example.com/CInfoXmlDoc}EMail

See also here and here

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic