473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Nest tags

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>

:
:
Jul 20 '05 #1
3 1625
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.
--
Morris M. Keesan -- ke****@alum.bu.edu

Jul 20 '05 #2
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?
Jul 20 '05 #3
"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
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Martin | last post by:
Hallo, can you help me writing a generic xslt transformation (useable with xsql from oracle)? The problem is how to get the escaping characters .... === INPUT-File in.xml <?xml version =...
1
by: darrel | last post by:
I know you CAN'T nest templates, so what would be the logic to use otherwise? Here's what I am doing: I have a template set to match a specific node based on one of it's elements. If it...
1
by: Chad | last post by:
I want to nest a grid within a MS Treeview ASP Web Control. It seems that I cannot add controls to a nodes Controls collection, however, I can put HTMLText in the Node.Text property of a Node...
1
by: edu | last post by:
there some way to nest transactions with bd destination sql server? thank you
4
by: Dave | last post by:
If so, what is wrong with this code in APS 3.0? I open a recordset with order info. Each record contains the order header info plus a line item from the order detail. So the recordset looks...
4
by: Tim Streater | last post by:
Not sure is this is quite the right NG, but anyway: I have rows in a table which I want to have represent nested data, which I want to show and hide. I can hide a row easily enough by doing: ...
3
by: Steven Nagy | last post by:
Hi all, ASP.NET : Framework 2.0 - C# A recent addition to my code generater will create GridView's and ObjectDataSource's in a control (ASCX). So the code gen creates an ascx, ascx.cs,...
10
by: Al | last post by:
Hi all, (Apologies if this is in a FAQ somewhere, I couldn't find anything). Almost every time I do any significant amount of coding in C or C++, I end up wishing C-style comments would nest....
2
kmartinenko
by: kmartinenko | last post by:
Hi, I am very new to Python and I would like to know if it is possible to nest 'for' statements? The question precipitates from a certain problem I am having with running a simple calculation...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.