MSporna
MSporna

Reputation: 43

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>

Upvotes: 0

Views: 1301

Answers (1)

madisonw
madisonw

Reputation: 836

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

Upvotes: 1

Related Questions