my dog learned polymorphism*
The moose likes XML and Related Technologies and the fly likes XmlBeans and Java Objects 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 "XmlBeans and Java Objects" Watch "XmlBeans and Java Objects" New topic
Author

XmlBeans and Java Objects

Lee Miller
Greenhorn

Joined: May 23, 2008
Posts: 5
Hi,

I have a number of Java Objects which I need to convert to XmlBeans. I am using Castor to marshall the Java Objects to a String and am using the parse method on XmlBeans to create the XmlBean object. The String produced as a result of Castor mapping is correct for creating an XmlBean (with a bit of tweaking) but the problem is that the fields are not in the correct sequence and the XmlBean is therefore not valid. I presume I could get round this by specifically mapping every field in a castor mapping file in the correct order, but there are hundreds of Java Objects, and I was hoping to take advantage of the auto complete feature as much as possible.

I'm basically looking for any suggestions as to how I can create an XmlBean from a Java Object without having to go down specifying each individual field in order, either using the way I describe or something else.

All the best.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XmlBeans and Java Objects