JAXB: Mapping XML to Existing Java Objects??

J

John Davison

In Castor I can defined how I want to map existing XML to an existing
(not auto-generated) object. Can I do the same in JAXB? I have
searched the JAXB documentation, but haven't found a way to map XML to
Java without having JAXB generate the Java classes from a schema.

http://castor.exolab.org/xml-mapping.html

-- John
 
I

iksrazal

In Castor I can defined how I want to map existing XML to an existing
(not auto-generated) object. Can I do the same in JAXB? I have
searched the JAXB documentation, but haven't found a way to map XML to
Java without having JAXB generate the Java classes from a schema.

http://castor.exolab.org/xml-mapping.html

-- John

Having a XML schema is the heart of JAXB in its current form - without
one nothing can happen. And it uses a schema to auto generate java
source files. Any vision of something that does not have at least
those two steps is not in the scope of JAXB, as I understand it.

Any questions that first involve those two steps I might be able to
help out with, as I'm doing a lot with JAXB at the moment.

HTH

Outsource to an American programmer living in brazil!
http://www.braziloutsource.com/
iksrazal
 
I

iksrazal

Perhaps JSR 222 will address this issue?

http://www.jcp.org/en/jsr/detail?id=222

-- John

As for what you said what you're looking for, doesn't seem like it.
Its backwards compatible with JSR31. The focus this time around seems
to be more complete schema support (a notoriously complex spec), web
services stuff like serialization/de-serialization issues and binding
to WSDL datatypes , and for my needs a cool feature - binding to "only
parts of an XML document."

So you still need a xml schema, which creates auto-generated source.
That hasn't changed best I can tell.

JSR31 changed a bunch though - starting with a DTD requirement and
then going to a xml schema requirement. And it took forever - starting
in 1999 and only becomming usable IMHO within the last year or so.
Since this JSR is in "Early Draft" we'll just have to wait and see. I
wasn't aware of JSR222 though - thanks.

iksrazal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top