nesting in XML

J

jack

Hi

I wanna know if nesting of tags inside similar tags is possible in XML.
To be more clear,

is

<person>
<son>
<person>
<son>david</son>
</person>
</son>
</person>

Is this kind of nesting possible in XML?

Please let me know.

Thanks,
Jack
 
L

Lars Kellogg-Stedman

I wanna know

"want to"
<person>
<son>
<person>
<son>david</son>
</person>
</son>
</person>

Is this kind of nesting possible in XML?

Sure. Unless you're using someone else's DTD or schema, there aren't
really any restrictions to how your arrange your data. What really
matters is what you do with the XML data afterwards -- that whatever is
parsing the XML knows if and how to differentiate person/son from
person/son/person/son.

-- Lars
 
D

David Dorward

jack said:
I wanna know if nesting of tags inside similar tags is possible in XML.
To be more clear,
<person> <son> <person>
Is this kind of nesting possible in XML?

Yes. For a real world example, take XHTML:

<object data="foo.png" type="image/png" width="100" height="100">
<object data="foo.gif" type="image/gif" width="100" height="100">
<p>Here would go a detailed description of the image</p>
</object>
</object>
 
J

jack

Hi David,

Thanks a lot, so can we nest tags( inside the same tags) as many times
we want or is there any limitation to this nesting? Also, is there a
comprehensive reference for XML Online where I can look up all these
details? I have the Orielly book but it doesnt cover all these details.

Thanks,
Jack
 
P

Peter Flynn

jack said:
Hi David,

Thanks a lot, so can we nest tags( inside the same tags) as many times
we want or is there any limitation to this nesting?

Limited only by the ability of your software and hardware to cope with
the depth to which you nest it. XML has no limit of its own.
Also, is there a
comprehensive reference for XML Online where I can look up all these
details? I have the Orielly book but it doesnt cover all these
details.

A good introduction to the principles of XML encoding is the chapter
of the TEI Guidelines "A Gentle Introduction to XML" at
http://www.tei-c.org/P4X/SG.html

///Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top