G
Guest
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="Ô²ÄÁÏ¡¢ÁÖ²úÆ·ºÍÅ©²úÆ·¡¢»·¾³·þÎñ"
chinese="Ô²ÄÁÏ£¨°üÀ¨²É¿óÒµ£©"
...
</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?
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?