开发者

XML schema: the same name of the parent element attribute and child element

开发者 https://www.devze.com 2023-01-26 21:39 出处:网络
More precisely, can child node\'s name be ever the same as any of the 开发者_运维百科parent node attribute names?

More precisely, can child node's name be ever the same as any of the 开发者_运维百科parent node attribute names?

Example:

<categories>
    <category id="10" **name**="someName">   -parent node [contains 'name' attribute']
            <**name** lang="eng">Drill</name>    -child node [named: 'name']
    </category>
</categories>


Yes, having attributes and elements with the same name are allowed by XML, although arguably not a great practice.

0

精彩评论

暂无评论...
验证码 换一张
取 消