...

View Full Version : simple namespace question



mlse
01-27-2009, 02:44 PM
Consider an element <aaa> that contains <bbb>, in the following 3 examples:



<aaa xmlns="http:www.whatever.com">
<bbb />
</aaa>



<root xmlns:x="http:www.whatever.com">
<x:aaa>
<x:bbb />
</x:aaa>
</root>



<root xmlns:x="http:www.whatever.com">
<x:aaa>
<bbb />
</x:aaa>
</root>

I know that in the first two examples, both <aaa> and <bbb> are part of the namespace x but is <bbb> part of x in the third example?

angst
01-27-2009, 04:41 PM
not 100% sure, but I would think that <bbb/> would still be a child of the x node.

Alex Vincent
01-28-2009, 07:03 AM
No. bbb in the third case lives in the default namespace, which is not specified in the root element.

mlse
01-30-2009, 02:01 PM
Thanks Alex, I suspected that that was the case!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum