Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assigning xml namespaces to a prefix

 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First we assign xmlns o to a url which can be anything,then we use po ,why this process, can anyone tell me???
<po urchaseOrder orderDate="2003-09-22"
xmlns o="http://www.Monson-Haefel.com/jwsbook/PO"
xmlns:addr="http://www.Monson-Haefel.com/jwsbook/ADDR">
 
wise owen
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although a namespace usually looks like a URL, that doesn't mean that one must be connected to the Internet to actually declare and use namespaces. Rather, the namespace is intended to serve as a virtual "container" for vocabulary and undisplayed content that can be shared in the Internet space. In the Internet space URLs are unique, hence you would usually choose to use URLs to uniquely identify namespaces. Typing the namespace URL in a browser doesn't mean it would show all the elements and attributes in that namespace; it's just a concept.

Note that the address used to identify the namespace, is not used by the parser to look up information. The only purpose is to give the namespace a unique name. However, very often companies use the namespace as a pointer to real Web page containing information about the namespace.

The namespace attribute is placed in the start tag of an element. A namespace prefix is considered in-scope on the declaration element as well as on any of its descendant elements. Once declared, the prefix can be used in front of any element or attribute name separated by a colon (such as s:student).

XML Namespaces Tutorial
[ October 07, 2006: Message edited by: wise owen ]
 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you are saying is very correct.
but i want to know,suppose in this line :

<f:table xmlns:f="http://www.w3schools.com/furniture">

why is :

xmlns:f="http://www.w3schools.com/furniture" thing needed,and also the url does not point to any resource.

Instead we can directly write <f:table> and use it..
The declaration standard is that way only,that is ok but i think that this(<f:table> can also be one shorter way...
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic