1

I am using XStream for converting the java object to xml. But i am not getting the proper output. When i am iterating the object, I am able to get the information. But when that object is converted to xml by XStream, the data changes. I dont know what will be the problem.

Can you provide some alternate with some samples.

Thanks in advance. Easwar

2
  • 5
    can you post the code to reproduce, it shouldn't happen. Commented Aug 30, 2011 at 7:52
  • 1
    XStream normally works out of the box even if the XML isn't exactly what you expect. XStream creates an XML that it will be able to unmarshall with it's current configuration. How does the object look and what is your output XML? How did you expect the output to look? Commented Aug 30, 2011 at 8:10

2 Answers 2

3

Castor Mapping. can be a good alternative.

Sign up to request clarification or add additional context in comments.

Comments

1

Note: I'm the EclipseLink JAXB (MOXy) lead and a member of the JAXB 2 (JSR-222) expert group.

Have you considered using a JAXB implementation (Metro, MOXy, Apache JaxMe, etc)? Here is an example of mapping the same object model with JAXB and XStream for comparison:

In addition since JAXB is part of Java EE, it is the default binding layer for other Java EE technologies such as JAX-RS and JAX-WS:

MOXy also contains some very useful extensions beyond the JAXB specification:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.