• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Confusion in namespace

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know the meaning of targetnameSpace. Suppose I have used the following elements in the XML

<employee>
Raj
</employee>

Now the XML parser will know the above element is belong to the targetnameSpace.



But what my doubt is what is the meaning of urn:fibonacci in the above xml? Which thing this points to? Whether it's just like a package name and we can give anything we want?
for example: In the below the namespace xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" if I use like: <wsdlsoap:example>blah..</wsdlsoap:example>, then the meaning is the example should be an element of wsdlsoap.
Here my doubt is it's pointing to an url, but I have not connected to an internet, then how it will know what are the elements available in wsdlsoap.
What actually the below lines means? Whether any resources will be there in the follwoing url?
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"

I have clicked the above url and a page opened and seems to be an ordinary page. Whether the namespace should be always point to an url?



Why should we use the above two namespaces?. whether the following targetnampSpace is not enough?

 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mike Thomson:
I know the meaning of targetnameSpace.



Well - according to your description you do not.

  • absolute URIs act as namespace identifiers only. There is no requirement that the URI is in fact a valid address. It can be but it doesn't have to be. For the purposes of validation you will have to provide an address at which the schema can be found separately (schemaLocation). In many cases you would actually provide the parser the schema locations separately from the document that references the schema.
  • targetNamespace simply identifies the namespace into which any new types and elements are defined. To access these new elements and types you still need a separate namespace declaration.


  • See:namespace and targetnamespace

    Ronald Bourret's XML Namespaces FAQ
    James Clark: XML Namespaces
     
    my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic