jackson xml deserialize inline array jackson xml deserialize inline array xml xml

jackson xml deserialize inline array


It should be possible to handle "unwrapped" style of list elements with Jackson XML module 2.1, with @JacksonXmlElementWrapper(useWrapping=false).

Structure should be something like this:

@JacksonXmlRootElement(localName="parents")public class Parents {  @JacksonXmlElementWrapper(useWrapping=false)  public List<Parent> parent;}public class Parent {  @JacksonXmlProperty(isAttribute=true)  public String name;  public String description;  @JacksonXmlElementWrapper(useWrapping=false)  public List<Prop> prop;}public class Prop {  @JacksonXmlProperty(isAttribute=true)  public String name;  public String value;}

so your solution was quite close.

Note that if inner classes are used, they need to have 'static' in declaration.I tested this with 2.1.4, and it works for me.