Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

XML namespace url doubt

 
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.
 
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

 
Here. Have a potato. I grew it in my armpit. And from my other armpit, this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic