Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Nest tags

Reply
Thread Tools

Nest tags

 
 
terry
Guest
Posts: n/a
 
      11-25-2004
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>

:
:
 
Reply With Quote
 
 
 
 
Morris M. Keesan
Guest
Posts: n/a
 
      11-25-2004
On 24 Nov 2004 21:38:57 -0800, http://www.velocityreviews.com/forums/(E-Mail Removed) (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 -- (E-Mail Removed)

 
Reply With Quote
 
 
 
 
terry
Guest
Posts: n/a
 
      11-26-2004
Morris M. Keesan <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>. ..
> On 24 Nov 2004 21:38:57 -0800, (E-Mail Removed) (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?
 
Reply With Quote
 
Keith M. Corbett
Guest
Posts: n/a
 
      11-27-2004
"terry" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m...
> Morris M. Keesan <(E-Mail Removed)> wrote in message

news:<(E-Mail Removed)>. ..
> > On 24 Nov 2004 21:38:57 -0800, (E-Mail Removed) (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


 
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
How to nest 2nd datalist instead of gridview staeri@gmail.com ASP .Net 0 03-02-2006 02:51 PM
relative sizing does not nest? PJ6 ASP .Net 0 08-15-2005 12:01 AM
Nest Web Projects =?Utf-8?B?UmFlZCBTYXdhbGhh?= ASP .Net 1 07-19-2005 02:45 PM
how to nest CheckBoxList in DataSet ( asp.net vb ) krzysiek ASP .Net 0 10-18-2004 01:33 PM
Nest controls in a MS Treeview Web Control Chad ASP .Net 1 12-18-2003 05:00 PM



Advertisments