"terry" <le*******@yahoo.com> wrote in message
news:99*************************@posting.google.co m...
Morris M. Keesan <ke****@alum.bu.edu> wrote in message
news:<nd********************************@4ax.com>. ..
On 24 Nov 2004 21:38:57 -0800, le*******@yahoo.com (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