How do I use XML namespaces with DOM Level 3?
DOM Level 3 supports namespaces in the same way as DOM Level 2, except that it adds a few new methods and supports version 1.1 of the Namespaces in XML recommendation. The most important new method is Document.normalizeDocument which, among other things, cleans up namespace declarations. Thus, it is no longer necessary to explicitly add namespace declarations (xmlns attributes). Instead, you can call Document.normalizeDocument and the DOM implementation will do it for you. (Exactly what is done depends on a number of configuration parameters. See DOMConfiguration for details.) For example, the DOM Level 2 code in question 11.
DOM Level 3 supports namespaces in the same way as DOM Level 2, except that it adds a few new methods and supports version 1.1 of the Namespaces in XML recommendation. The most important new method is Document.normalizeDocument which, among other things, cleans up namespace declarations. Thus, it is no longer necessary to explicitly add namespace declarations (xmlns attributes). Instead, you can call Document.normalizeDocument and the DOM implementation will do it for you. (Exactly what is done depends on a number of configuration parameters.