Next in thread → Next in month →

RE: [xml-dev] recursive nesting

From
Jack Lindsey <>
To
, Jack Sparrow <>
Date
2005-12-07T04:41:12Z
ID
<>
Thread
RE: [xml-dev] recursive nesting
Aye, tis valid, Cap'n.
But since you say "recursive", I presume there is only one kind of 
<item>, no matter how deeply nested they are.  If that is correct, then 
your <item> element can have "mixed content", i.e. it can have its own 
content, e.g. How are you, and it can have subelements, i.e. more 
instances of <item>.  Therefore if you validate your xml against a W3C 
XML Schema, it would be equally valid to say:

<item>How are you
          <item>I am fine
                    <item>what is
                              <item>what is your profession?</item>
                              your name?
                    </item>
          </item>
          What the?
</item>
This might be OK in document-oriented XML, if your items were 
subparagraphs or bullet items, etc.  But in data-oriented XML, like a 
form or database record update, some shops strictly forbid this because 
it is oviously not going to be valid for field-by-field structured data. 

But others think of it as more of a guideline ;-)

Cheers
            Jack Lindsey

Jack Sparrow wrote:
 
Hi all,

I would like to know if its valid to do recursive nesting( like the 
pattern shown below) in XML.


<item>
   <item>How are you</item
   <item>I am fine</item>
<item>
<item>
    <item>
         <item>what is your name?</item>
         <item>what is your profession?</item>
    </item>
</item>

Please let me know.

Thanks,
Jack
Next in thread → Next in month →