开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜