nesting in XML

Discussion in 'XML' started by jack, Dec 2, 2005.

  1. jack

    jack Guest

    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
     
    jack, Dec 2, 2005
    #1
    1. Advertising

  2. > 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.
     
    Lars Kellogg-Stedman, Dec 2, 2005
    #2
    1. Advertising

  3. 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
     
    David Dorward, Dec 2, 2005
    #3
  4. jack

    jack Guest

    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
     
    jack, Dec 2, 2005
    #4
  5. > 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.
     
    Lars Kellogg-Stedman, Dec 2, 2005
    #5
  6. jack

    Peter Flynn Guest

    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/
     
    Peter Flynn, Dec 3, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Hertz
    Replies:
    0
    Views:
    333
    Michael Hertz
    Sep 19, 2004
  2. Replies:
    10
    Views:
    921
    hereticmessiah
    May 1, 2006
  3. Paul Lee
    Replies:
    0
    Views:
    393
    Paul Lee
    Jan 23, 2004
  4. Michael Hertz
    Replies:
    3
    Views:
    451
    Peter Flynn
    Sep 22, 2004
  5. Trans
    Replies:
    10
    Views:
    312
    Sean O'Halpin
    Sep 16, 2005
Loading...

Share This Page