简体   繁体   中英

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>

是的,XML允许具有相同名称的属性和元素,尽管可以说这不是一个好习惯。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM