What xmlns = "" means exactly

Given the next (piece) of soap call;

<m1:NextCommencementDateInput xmlns:m1="http://foo.bar.com/Types">
    <aDate xmlns="">2010-06-02</aDate>
</m1:NextCommencementDateInput>

Uppermost is the same as (when checking on xsd using XMLSpy)

<m1:NextCommencementDateInput xmlns:m1="http://foo.bar.com/Types">
    <aDate>2010-06-02</aDate>
</m1:NextCommencementDateInput>

So what does xmlns = "" do exactly?

Edit: To find out why I am asking about this, I call a third party, and now they are claiming that we must remove xmlns = "" from our requests. However, I believe that they are the same, and they must change their side.

+5
source share
2 answers

xmlns=""clears the default namespace definition (aka empty prefix). After this declaration, all elements without a prefix are considered to have an empty namespace.

So the difference is as follows:

  • ( xmlns = "") , aDate .

  • . aDate . xmlns = "some: namespace", aDate . .

, XML xmlns = "", xmlns = "some: namespace" ...

+5
+1

All Articles