File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes creating objects from an XML file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "creating objects from an XML file" Watch "creating objects from an XML file" New topic

creating objects from an XML file

lupercal hill

Joined: Sep 28, 2005
Posts: 9
I want to pull data from an XML file and place it in a java object. Im using SAX to parse the file .

Do I need to wrap XML data in an objectinputstream method to use the values?
Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

An ObjectInputStream???

No. You get data from SAX as strings. Those strings may be element names or attribute values or text nodes or whatever. You can use normal Java programming techniques to create objects that contain those strings.
wood burning stoves
subject: creating objects from an XML file