[
Lists Home |
Date Index |
Thread Index
]
- From: mark hu <mark@fintrack.com>
- To: xml-dev@lists.xml.org
- Date: Wed, 09 Aug 2000 13:44:38 -0400
Hi, guys:
After couple of hours work - I got a situation that I should decide how
to construct my data - OK, here's the case, maybe some fo your guys can help
me out or give me a guide:
Background: I wrote a Data Objects ( Java/CORBA based ) and it takes
data from Sybase through JDBC - then the data needs be re-constructed into
XML data stream, here's how the data looks like:
parent root ( with ID )
Child Level 1 ( with parent root ID and its-self unique ID)
Child Level 2 ( with Child Level 1 ID as parent ID and its-self
unique ID )
Child Level 3 ( with Child Level 2 ID as parent ID and its-self
unique ID )
......... to unknown level N
and there're multi-parent roots, so the tree structure above will be
multi-level based, like this:
parent root1 ( with ID )
Child Level 1-1 ( with parent root ID and its-self unique ID)
Child Level 1-2 ( with Child Level 1-1 ID as parent ID and its-self
unique ID )
Child Level 1-3 ( with Child Level 1-2 ID as parent ID and
its-self unique ID )
parent root2 ( with ID )
Child Level 2-1 ( with parent root ID and its-self unique ID)
Child Level 2-2 ( with Child Level 2-1 ID as parent ID and its-self
unique ID )
Child Level 2-3 ( with Child Level 2-2 ID as parent ID and
its-self unique ID )
parent root3 ( with ID )
Child Level 3-1 ( with parent root ID and its-self unique ID)
Child Level 3-2 ( with Child Level 3-1 ID as parent ID and its-self
unique ID )
Child Level 3-3 ( with Child Level 3-2 ID as parent ID and
its-self unique ID )
......... to unknown level N
and since the level of child is un-known, it comes the question ?? -> I need
create a XML stream to host the data model above - and the way I am writing
right now is to create a collection to handle a generic TREE ( e.g. parent
root1 ), then adding the other available TREEs into the same collections,
and this collection is linking to a HashMap, so the client side Applet can
point to - NOW SINCE I DID NOT KNOW HOW MANY LEVEL CHILDS I CAN HAVE , looks
like I can not finish constructing the generic TREE structure, and CAN SOME
ONE HELP ME to find a way to resolve this - in a world, how to convert the
unknown type of collection ( Vector in Java ) and embed it into a XML stream
???? - one way I am thinking about this question is that I can retrieve the
level of child when I retrieve the data from database, then construct the
TREE - then how I should design my DTD or schema .... ???
|