Hi, Sunil N wrote:
> Hi, > > I have a problem un/marshaling the following: > > <books> > <book.name> > <sample.element attr1=value1 attr2=value2>some value</sample.element>xyz, > <sample.element attr1=value1 attr2=value2>some value</sample.element>abc > </book.name> > </books> So you mean, this is the XML, you want to read? Actually it is not possible with XStream, because XStream does not support XML in mixed-mode i.e. tags embedded in plain text. > the sample.element element are added when required depending on a business > rule, If we do not have the sample.elements then we get the correct o/p > i.e as follows > > <books> > <book.name> > xyz, > abc > </book.name> > </books> > > but when we are using converter, we get the following o/p where we do not > have the text xyz and abc as follows: > > <books> > <book.name> > <sample.element attr1=value1 attr2=value2>some value</sample.element> > <sample.element attr1=value1 attr2=value2>some value</sample.element> > </book.name> > </books> > > what do we need to do in retain all info? > > We are using jdk 6, spring and xstream. > > Any clues or solution provided is much appreciated. XStream is designed for "Java to XML and back". It does not generate XML in mixed-mode and using XStream's readers, the behavior is simply undefined from XStream's point of view and depends on the underlaying XML parser. You may have a look at https://jira.codehaus.org/browse/XSTR-548 where Ken Arnold attached an enhancement, that does support mixed-mode XML for certain XML drivers. However, I cannot say anything about the configuration/setup of this functionality in Spring. Spring integration is done by the Spring people, I cannot help with it at all. - Jörg --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email