Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Transform xml from one XSD version to another(Using Moxy to Transform XML to a newer version XSD)
Transform xml from one XSD version to another [message #928789] Mon, 01 October 2012 01:00 Go to next message
steven hayes is currently offline steven hayesFriend
Messages: 1
Registered: October 2012
Junior Member
Can Moxy be used to transform an XML message from one version of an XSD to a newer version of an XSD? If it can, what are the basics of accomplishing this? The newer XSD has some new tag and prefix names and a few new fields. I briefly looked at Dozer to map between the two sets of JAXB classes and have also changed the DOM by parsing thru with XPATH commands, but there must be a better way.
Re: Transform xml from one XSD version to another [message #929499 is a reply to message #928789] Mon, 01 October 2012 14:06 Go to previous message
Blaise Doughan is currently offline Blaise DoughanFriend
Messages: 163
Registered: July 2009
Senior Member

Hi Steven,

Yes MOXy can be used to support mapping an object model to multiple versions of an XML schema by leveraging MOXy's external metadata.

Typical Approach

1. Map the object model to one version of the XML schema using annotations. Create a JAXBContext on this model.
2. Leverage MOXy's mapping document to override the mappings that have changed for the new version. Create another JAXBContext that leverages the annotations and mapping document.
3. You can apply multiple mapping documents so you could have one that represents the delta for each version.

If the document format changed a lot, then you can specify that the mapping document completely replaces any metadata supplied via annotations.

- http://blog.bdoughan.com/2011/09/mapping-objects-to-multiple-xml-schemas.html

-Blaise
Previous Topic:Creating BLOBs
Next Topic:Eclipselink mongoDB native query find() not working
Goto Forum:
  


Current Time: Sun Sep 22 14:41:28 GMT 2024

Powered by FUDForum. Page generated in 0.02364 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top