Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are multiple XML default namespaces allowed?

Consider the following xml

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"  xmlns="mycompany.com.myservice">
<soap:Header>
<To xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://mycompany.com/myservice</To>
<Action xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">mycompany.com/myservice/dosomething</Action>
</soap:Header>
<soap:Body>
<mypayload>hello world</mypayload>
</soap:Body>
</soap:Envelope>

is the use of multiple un-aliased default namespaces valid?

like image 845
barrypicker Avatar asked Feb 18 '23 07:02

barrypicker


2 Answers

Yes.

The case where you have multiple default namespaces is covered in the spec:

The scope of a default namespace declaration extends from the beginning of the start-tag in which it appears to the end of the corresponding end-tag, excluding the scope of any inner default namespace declarations.

like image 145
Quentin Avatar answered Feb 20 '23 17:02

Quentin


Yes.

(that's all I was going to say but StackOverflow doesn't like short answers).

like image 39
Michael Kay Avatar answered Feb 20 '23 18:02

Michael Kay