加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

xmlns =“”一个有效的xml命名空间?

发布时间:2020-12-16 08:04:22 所属栏目:百科 来源:网络整理
导读:“空”是XML命名空间的有效值吗?如果是,这是什么意思? 我有以下XML代码,但我不知道Field1和Field2元素属于哪个命名空间。 soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" soapenv:Header / soap:Body Root xmlns="uri" Fi
“空”是XML命名空间的有效值吗?如果是,这是什么意思?

我有以下XML代码,但我不知道Field1和Field2元素属于哪个命名空间。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header />
  <soap:Body>
    <Root xmlns="uri">
      <Field1 xmlns="">147079737</Field1>
      <Field2 xmlns="">POL</Field2>
    </Root>
  </soap:Body>
</soapenv:Envelope>
是的,它是有效的。 Section 6.2在 Namespaces in XML 1.0 Recommendation专门说:

The attribute value in a default namespace declaration MAY be empty. This has the same effect,within the scope of the declaration,of there being no default namespace.

引用自评论:

It is legal,and this is the way to bring an element into the global namespace.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读