Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > newbie question on how to format xml data in logical/common way

Reply
Thread Tools

newbie question on how to format xml data in logical/common way

 
 
=?UTF-8?b?5byg6Z+h5q2m?=
Guest
Posts: n/a
 
      10-19-2006
Hello. Recently in my web development project I wish to keep these data
in xml form, but I am not sure of the best way to organize this data
(being xml newbie). The data is a list of business categories (business
fields) like this:

Raw Material, Forestry and Agricultural Products, Environmental Services (category A)
+--- Raw Materials (Mining incl.) (category A01)
+- Ores (category A0101)
+- Coal (category A0102)
+- Minerals, Precious Stones (category A0103)
+- ....
+--- Food, Agriculture (category A02)
+- ....
+--- ....
Processing Industry
+--- ....
Service and Trade
+--- ....

Basically, the data has 3 level, each level has a code repersenting it,
each string have 2 language versions (only one language version is give
in the above example). I am thinking of several possibilities to keep
this data in XML:

idea A:

<category english="Raw Material, Forestry and Agricultural Products, Environmental Services"
chinese="*ϡֲƷũƷ"
>

<category english="Raw Materials (Mining incl.)"
chinese="*ϣɿҵ"
>

<category id="a0101"><english>Ores</english><chinese>ʯ</chinese>...</category>
...
</category>
...
</category>

idea B:
<category lang="english" id="a">
<name>Raw Material, Forestry and Agricultural Products, Environmental Services</name>
<category id="a01">
<name>Raw Materials (Mining incl.)</name>
<category id="a0101">Ores</category>
....
....
</category>
.....
</category>
<category lang="english" id="b">....</category>
<category lang="english" id="c">....</category>
<category lang="chinese" id="a">....</category>
<category lang="chinese" id="b">....</category>
<category lang="chinese" id="c">....</category>

Anyway, there are a lot of possibilities to store data in XML format,
and you can see through my example ideas that I am almost completely
blind on how we can organize data better in XML format. It's unlike
relational database that with XML we have many possibilities. I also
wish to store data in a format that is logically better rather then just
store it with the logic of the application that reads this xml data, so
that in the future even the application changes, the data is still
making sense.

How do you think?
 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Ruby newbie & XML - What's the simplest way to get XML data into a hash? darenbell@gmail.com Ruby 3 11-16-2006 11:23 PM
newbie question on how to format xml data in logical/common way =?UTF-8?b?5byg6Z+h5q2m?= XML 8 10-20-2006 02:11 AM
newbie question on how to format xml data in logical/common way =?UTF-8?b?5byg6Z+h5q2m?= XML 1 10-19-2006 07:55 AM
(XML) HTTP(S) in the Auto-lead Data Format (ADF) 1.0. HOW DO I READ THE DATA? Girish ASP General 0 02-13-2004 12:46 AM



Advertisments