Jan 11th, 2013, 03:43 AM
How to read xml attribute and value using staxEventItemReader
I have problem in
1.Mapping tag which contains attribute and value..for e.g
<aid IdScope="Sender">20110421000008</aid >
Here how to read IdScope attribute and its value.
2.I am getting duplicate entry exception for following as unstructAddressLine tag is repeated.
<UnstructAddressLine>kabban park street</UnstructAddressLine>
please help me to resolve these things.
Thanks in advance
Jan 15th, 2013, 09:00 AM
1. Take a look at XStreamMarshaller#setUseAttributeFor(Map<Class, String>) where the Class is the class that was previously aliased and the String is the name of the attribute.
2. Take a look at how to map collections (which I'm assuming UnstructAddress is) via XStreamMarshaller#setImplicitCollection.
You can read more about mapping at the XStream level here: http://xstream.codehaus.org/alias-tutorial.html
Jan 19th, 2013, 04:33 AM
I went through the tutorial, there its mentioned about how to create xml from objects,my requirement is opposite.
could you please tell How do i map the attribute and value of an element in configuration file.so that it will be helpful in reading xml.
Thanks in advance..