[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

how to construct data - getting confused ...... converting native datato

  • From: mark hu <mark@f...>
  • To: xml-dev@l...
  • Date: Wed, 09 Aug 2000 13:44:38 -0400

construct data
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  .... ???



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.