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

XML namespace question

 
Tong Chen
Ranch Hand
Posts: 1011
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the following example, what is the namespace scope for A, what is the namespace scope for B? Because A does not use prefix foo, is it valid declaration?
<A xmlns:foo="http://www.foo.org/" xmlns="http://www.bar.org/">
<B>abcd</B>
</A>

Thanks for your help!
 
Luciano Queiroz
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're not obligated to specify a prefix when you create a namespace. It's then known as a default namespace, and is applied to the element and all its children which don't use a prefix.
So, elements A and B uses the default namespace which URI is "http://www.bar.org".
 
Tong Chen
Ranch Hand
Posts: 1011
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Luciano Queiroz !!! I got it!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic