Nest tags

Discussion in 'XML' started by terry, Nov 25, 2004.

  1. terry

    terry Guest

    Hi,

    Is it legal or formal to nest tag names? My code is in the following.
    The <name> is nested. I used java to read the xml file but it seems to
    not know the nested structure. I need to write the nest structure as
    it is a multi-level catalog description. That means a catalog is a
    sub-catalog of the another. If it is illegal or not formal, how to
    solve this?

    Thanks!

    <?xml version='1.0' encoding='utf-8'?>
    <root>
    <name>
    All
    </name>
    <name>
    <name>
    Connector
    </name>
    <name>
    Inline
    </name>
    <name>
    PCB
    </name>
    </name>
    <name>
    Crystal_and_Resonator
    </name>

    :
    :
    terry, Nov 25, 2004
    #1
    1. Advertising

  2. On 24 Nov 2004 21:38:57 -0800, (terry) wrote:
    >Hi,
    >
    >Is it legal or formal to nest tag names? My code is in the following.
    >The <name> is nested. I used java to read the xml file but it seems to
    >not know the nested structure.

    ....
    > <name>
    > <name>
    > Connector
    > </name>
    > <name>
    > Inline
    > </name>
    > <name>
    > PCB
    > </name>
    > </name>


    Yes, this is legal, easily expressed in a DTD. An XML application that
    comes immediately to mind is XBEL,
    <http://pyxml.sourceforge.net/topics/xbel/>, the bookmark exchange
    language, in which folders can contain other folders. If your java is
    not seeing the structure, it's probably a bug in the parser you're
    using, or more likely a bug in your own code.
    --
    Morris M. Keesan --
    Morris M. Keesan, Nov 25, 2004
    #2
    1. Advertising

  3. terry

    terry Guest

    Morris M. Keesan <> wrote in message news:<>...
    > On 24 Nov 2004 21:38:57 -0800, (terry) wrote:
    > >Hi,
    > >
    > >Is it legal or formal to nest tag names? My code is in the following.
    > >The <name> is nested. I used java to read the xml file but it seems to
    > >not know the nested structure.

    > ...
    > > <name>
    > > <name>
    > > Connector
    > > </name>
    > > <name>
    > > Inline
    > > </name>
    > > <name>
    > > PCB
    > > </name>
    > > </name>

    >
    > Yes, this is legal, easily expressed in a DTD. An XML application that
    > comes immediately to mind is XBEL,
    > <http://pyxml.sourceforge.net/topics/xbel/>, the bookmark exchange
    > language, in which folders can contain other folders. If your java is
    > not seeing the structure, it's probably a bug in the parser you're
    > using, or more likely a bug in your own code.


    Could u explain how to use DTD to do this?
    terry, Nov 26, 2004
    #3
  4. "terry" <> wrote in message
    news:...
    > Morris M. Keesan <> wrote in message

    news:<>...
    > > On 24 Nov 2004 21:38:57 -0800, (terry) wrote:
    > > >Hi,
    > > >
    > > >Is it legal or formal to nest tag names? My code is in the following.
    > > >The <name> is nested. I used java to read the xml file but it seems to
    > > >not know the nested structure.

    > > ...
    > > > <name>
    > > > <name>
    > > > Connector
    > > > </name>
    > > > <name>
    > > > Inline
    > > > </name>
    > > > <name>
    > > > PCB
    > > > </name>
    > > > </name>

    > >
    > > Yes, this is legal, easily expressed in a DTD. An XML application that
    > > comes immediately to mind is XBEL,
    > > <http://pyxml.sourceforge.net/topics/xbel/>, the bookmark exchange
    > > language, in which folders can contain other folders. If your java is
    > > not seeing the structure, it's probably a bug in the parser you're
    > > using, or more likely a bug in your own code.

    >
    > Could u explain how to use DTD to do this?


    You could write a DTD to inform XML processors to enforce structure rules,
    such as "a 'name' element may contain zero or more 'name' elements".

    This probably won't help with your current problem.

    But what is your current problem, exactly? It is not at all clear what you
    mean by "[my program does] not know the nested structure". If you need
    further help, you should provide details about your program and the problem
    you are seeing.

    /kmc
    Keith M. Corbett, Nov 27, 2004
    #4
    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. Chad
    Replies:
    1
    Views:
    425
    Natty Gur
    Dec 18, 2003
  2. krzysiek
    Replies:
    0
    Views:
    1,570
    krzysiek
    Oct 18, 2004
  3. =?Utf-8?B?UmFlZCBTYXdhbGhh?=

    Nest Web Projects

    =?Utf-8?B?UmFlZCBTYXdhbGhh?=, Jul 19, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    401
    Brock Allen
    Jul 19, 2005
  4. PJ6

    relative sizing does not nest?

    PJ6, Aug 15, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    331
  5. Replies:
    0
    Views:
    1,694
Loading...

Share This Page