Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > nesting in XML

Reply
Thread Tools

nesting in XML

 
 
jack
Guest
Posts: n/a
 
      12-02-2005
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

 
Reply With Quote
 
 
 
 
Lars Kellogg-Stedman
Guest
Posts: n/a
 
      12-02-2005
> 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

--
Lars Kellogg-Stedman <>
This email address will expire on 2005-11-23.

 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      12-02-2005
jack wrote:

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

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
jack
Guest
Posts: n/a
 
      12-02-2005
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

 
Reply With Quote
 
Lars Kellogg-Stedman
Guest
Posts: n/a
 
      12-02-2005
> 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.


The XML specs at w3c.org are always useful:

(XML) http://www.w3.org/TR/REC-xml/
(XSL) http://www.w3.org/TR/xsl/

(Others) http://www.w3.org/TR/

Google searches will often yield useful results.

-- Lars

--
Lars Kellogg-Stedman <>
This email address will expire on 2005-11-23.

 
Reply With Quote
 
Peter Flynn
Guest
Posts: n/a
 
      12-03-2005
jack wrote:

> 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
--
XML FAQ: http://xml.silmaril.ie/

 
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
Nesting XML Elements in Java dmckeon@ameritas.com Java 10 05-01-2006 06:47 AM
Module.nesting -> Kernel#nesting Trans Ruby 10 09-16-2005 12:21 AM
Searching für a big (!) XML document sample with attributes and approx 6 nesting levels Michael Hertz XML 3 09-22-2004 08:47 PM
Searching für a big (!) XML document sample with attributes and approx 6 nesting levels Michael Hertz Java 0 09-19-2004 03:46 PM
"Nesting" XML documents using DOM Paul Lee XML 0 01-23-2004 04:08 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