This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
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: 19973

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.
I agree. Here's the link:
subject: creating objects from an XML file
It's not a secret anymore!