0

我已经阅读了通过 google 找到的几篇文章以及关于命名空间和 xml 方案的 wiki 文章,但我不知道.. 我只是不太了解默认命名空间和目标命名空间之间的区别..

所以默认命名空间是默认使用的命名空间(如果没有为某些元素定义其他命名空间),而目标命名空间似乎具有相同的用途?

另外,正如我所读到的,属性默认签署到空命名空间?什么是空命名空间?

在我的例子中:

<test xmlns="www.example.org" attribute1="1" attribute2="tbla" attribute3="helloworld">
  <child1></child1>
</test>

所以 child1 在 www.example.org 命名空间中,而 attribute1 /attribute2 和属性 3 在 null 命名空间中?

4

1 回答 1

0

我认为您可以从这个问题中受益:为什么我们需要 targetNamespace?

我的理解是,开发 targetNamespace 是为了将 XML 模式 (.xsd) 与使用该模式的 XML 文档相匹配。但上述问题和讨论更深入地回答了它。

于 2013-05-02T16:15:32.140 回答