是否允许多个XML默认命名空间?

前端之家收集整理的这篇文章主要介绍了是否允许多个XML默认命名空间?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
考虑以下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>

是使用多个无别名的默认名称空间有效吗?

解决方法

是.

您有多个默认命名空间的情况在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.

猜你在找的XML相关文章