users@jaxb.java.net

Can generated classes be used to create "new" in-memory representation which are then marshalled?

From: Gary R Martin <gmartin3_at_us.ibm.com>
Date: Thu, 13 Jan 2005 14:52:45 -0500

I have to decide if JAXB is an appropriate technology to satisfy the
following functional requirements.
I would appreciate an answer to question 1).
Comments on any of the other questions are also welcome.

a) unmarshall an XML document valid with respect to schemaA into an in
memory representation (we discussed both DOM and JAXB generated classes,
and decided to pursue JAXB)
b) read some properties from a relational database based on key derived
from data from xmlA
c) using data from the in-memory representation of xmlA and the properties
from the DB, create an in-memory representation of what will later be
marshalled into a xmlB document valid with respect to schemaB.
d) marshal the newly created in-memory representation into an XML document
- xmlB - that is valid with respect to schemaB

Key assumptions:

1) - schemaA and schemaB are significantly different
2) - step c involves "random access" to most all of the data contained in
xmlA and significant "business calculations/logic (makes SAX clumsy;
"business" in-memory representation preferable to DOM)

Questions for further research:

1) in step c) can JAXB classes generated by compiling schemaB be used
(without ever having unmarshalled a document instance of schemaB)
     to create the in-memory representation of what will be marshalled
into xmlB

2) is XMLBeans a viable replacement for JAXB technology? Specifically,
does XMLBeans have a marshal operation?

3) is Castor a appropriate technology?


Regards,

Gary

Senior I/T Architect
Phone (voice, faxmail): 1-513-274-4094 T/364-2632
Internet: gmartin3_at_us.ibm.com