在同一元素内多次使用相同的 xmlns
Same xmlns multiple times inside the same element
我正在努力寻找如下示例:
<myElement>
<child xmlns="sameNamespace" color="blue"/>
<child xmlns="sameNamespace" color="red"/>
</myElement>
在这种情况下,完全相同的 xmlns 可以出现多次吗?
是的,可以在不同的元素上声明不同(或相同)的默认命名空间。
在您发布的示例中,两个 child
元素都在 sameNamespace
命名空间中,而 myElement
不在任何命名空间中。
我正在努力寻找如下示例:
<myElement>
<child xmlns="sameNamespace" color="blue"/>
<child xmlns="sameNamespace" color="red"/>
</myElement>
在这种情况下,完全相同的 xmlns 可以出现多次吗?
是的,可以在不同的元素上声明不同(或相同)的默认命名空间。
在您发布的示例中,两个 child
元素都在 sameNamespace
命名空间中,而 myElement
不在任何命名空间中。