Simple Java Xml to POJO mapping/binding? -


i'm trying figure out simplest way map xml file to plain old java object.

note: in example xml doesn't quite match intended pojo.

///////// xml <?xml version="1.0" encoding="utf-8"?> <animal>   <standardname>     <name>cat</name>   </standardname>   <standardversion>     <versionidentifier>v02.00</versionidentifier>   </standardversion> </animal>   ////// intended pojo class animal {  private string name;  private string versionidentifier; } 

regular jaxb (with annotations) won't work jaxm element name annotations don't allow me specifiy nested elements. (i.e. standardname/name).

i've looked @ jibx seems overly complicated, , no full examples provided want do.

castro seems able want (using mapping files), wonder if there other possible solutions. (possibly allow me skip mapping files, , allow me specify in annotations).

thanks

this article may you... requires know xpath http://onjava.com/onjava/2007/09/07/schema-less-java-xml-data-binding-with-vtd-xml.html


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -