How to deserialize such strange XML. In my opinion, the props-entity is missing (around the props), but I can\'t change the source of this XML (a web service).
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;
}
public class Parent {
@JacksonXmlProperty(isAttribute=true)
public String name;
public String description;
@JacksonXmlElementWrapper(useWrapping=false)
public List 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.