You're fine. There is no confusion at all with having the same element name
in different places within a piece of XML.
obviously if you were using it to represent different things it would be a
bad idea, but as you're representing a hierarchy of similar objects, this is
exactly what I would do.
"PaulC" <> wrote in message
news:Xns93DB86A6B1395h6ygi756f4EAF@195.8.68.218...
> Just wondering if the below is legal XML, as I want to use it for the
> configuration file of one of my applications.
>
> -0-0-0 Snip 0-0-0-
>
> <menu caption = "File">
> <menu caption = "Open">
> <menu item = "Process" />
> <menu item = "File" />
> </menu>
> <menu item = "Save" />
> <menu item = "Exit" />
> </menu>
>
> -0-0-0 Snip 0-0-0-
>
> The idea of the above is create a menu entitled "File" where the "Open"
> item has subitems. The question is, can elements be nested in this way, or
> does each element have to have a different name than the one it's inside ?
|