0

I am using Simple xml framework, its amazing. It meets all my need except one, sometimes I need to store inner xml as value of field during deserialization of xml. For instance

<A>
  <a1>1</a1>
  <b>
    <b1>1</b1>
    <b2>2</b2>
    <b3>3</b3>
  </b>
</A>

in the above xml I need to store the node value of 'b' as value of the field in the class A. Is there some annotation or way to achieve this using Simple xml framework ??

It should look something like this

Class A{
String a1; //holds 1
String b; //holds <b><b1>1</b1><b2>2</b2><b3>2</b3></b>
}
Jeevan
  • 8,532
  • 14
  • 49
  • 67

1 Answers1

0

I guess that's possible, but it might be difficult. You can try a implementation of Transform, but maybe you have to mix it with a Converter.

ollo
  • 24,797
  • 14
  • 106
  • 155
  • Could you point me to blog or code snippet which talks more about Transform ? – Jeevan Jul 15 '13 at 10:21
  • 1
    sure ... here's an example: http://stackoverflow.com/questions/12277887/parse-date-with-simpleframework/12492925#12492925 - ´read()` and `write()` are the methods you need. – ollo Jul 15 '13 at 10:29