Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Re: Nested XML Elements - Legal?

Reply
Thread Tools

Re: Nested XML Elements - Legal?

 
 
Andy Fish
Guest
Posts: n/a
 
      08-18-2003
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 ?



 
Reply With Quote
 
 
 
 
PaulC
Guest
Posts: n/a
 
      08-18-2003
Thanks.

"Andy Fish" <> wrote in
news:vL40b.322$:

> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How *build* new elements and *replace* elements with xml.dom.minidom? Chris Seberino Python 3 06-12-2009 05:08 AM
replacing xml elements with other elements using lxml Ultrus Python 4 08-30-2007 07:17 AM
dealing with nested xml within nested xml within...... Ultrus Python 3 07-09-2007 09:00 PM
XML elements to JavaScript Array elements Conversion P XML 1 07-07-2006 09:08 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57