Paul Clapham wrote:All your element names are in the same namespace as the corresponding element names in the sample XML, namely the http://www.foobar.ca/foo namespace. The sample XML uses a namespace prefix and your XML uses the default namespace to cause that to happen, but the two documents should be treated identically by namespace-compliant software.
Paul Clapham wrote:(Caveat: namespaces are not well understood and there's a lot of software which isn't namespace-compliant.)
Paul Clapham wrote:In the sample XML, xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" declares a namespace which is not used anywhere in the document. So it would make no difference if it were removed.
In your XML, you have a couple of "nil" attributes which are in the http://www.w3.org/2001/XMLSchema-instance namespace. Their namespace declarations appear in the element which encloses them rather than in the root element, but that makes no difference to the structure of the document. Namespaces can be declared at any level of the tree and they are inherited at lower levels unless they are overridden. Whether the presence of those attributes is a problem depends on the software that will be processing the document.