<[EMAIL PROTECTED]> on Monday, April 11, 2005 at 1:31 AM wrote: >I have a XML file that contains data for multiple records (lets say multiple >employees) >and I need to load this data into multiple java objects (multiple employee >objects). >Whatever examples that I have seen till now only talk about loading the data >in an >xml file to a single java object.
you can think of it this way: 1) XML is a tree-structured way of looking at data and a well-formed XML document will always have a root to the tree... that's the object you would unmarshall into and marshall out of 2) say you have a tree with a root element "Company_Employees" and it has a series of zero to many child elements "Worker" 3) when you unmarshall an instance document you get the contents of an XML file from a stream and turn it into a single tree of Java objects 3) the "single java object" you get in our example would be the "Company_Employees" root element with all the "Worker" child elements inserted into the tree make more sense now? of course once loaded any given "Worker" can be thought of and treated as a sub-tree of its own and so on... basically everything is about acyclic tree graphs jeffs -- Jeff Sonstein, Assistant Professor Department of Information Technology Rochester Institute of Technology =========================================== IT Dept Webspace: http://www.it.rit.edu/~jxs/ Blog: http://streamer.rit.edu/technobabble/ xVRML Project: http://www.xvrml.net/ Public Key: http://ariadne.iz.net/~jeffs/jeffs.asc Disclaimer: http://www.it.rit.edu/~jxs/emailDisclaimer.html there are no bugs there are just undocumented features ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-user
