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

Discussion in 'XML' started by =?UTF-8?b?5byg6Z+h5q2m?=, Oct 19, 2006.

  1. 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?
    =?UTF-8?b?5byg6Z+h5q2m?=, Oct 19, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?UTF-8?b?5byg6Z+h5q2m?=
    Replies:
    8
    Views:
    410
    =?UTF-8?b?5byg6Z+h5q2m?=
    Oct 20, 2006
  2. =?UTF-8?b?5byg6Z+h5q2m?=
    Replies:
    1
    Views:
    335
    =?UTF-8?b?5byg6Z+h5q2m?=
    Oct 19, 2006
  3. Denny
    Replies:
    1
    Views:
    763
  4. John Reye
    Replies:
    28
    Views:
    1,337
    Tim Rentsch
    May 8, 2012
  5. Jason Mellone
    Replies:
    3
    Views:
    80
    Jurko Gospodnetić
    May 7, 2014
Loading...

Share This Page