Interview Questions

How do I undeclare the default XML namespace?

XML Interview Questions and Answers


(Continued from previous question...)

71. How do I undeclare the default XML namespace?

To "undeclare" the default XML namespace, you declare a default XML namespace with an empty (zero-length) name (URI). Within the scope of this declaration, unprefixed element type names do not belong to any XML namespace. For example, in the following, the default XML namespace is the http://www.google.org/ for the A and B elements and there is no default XML namespace for the C and D elements. That is, the names A and B are in the http://www.google.org/ namespace and the names C and D are not in any XML namespace.

<A xmlns="http://www.google.org/">
<B>
<C xmlns="">
<D>abcd</D>
</C>
</B>
</A>


(Continued on next question...)

Other Interview Questions