I appear to have run into a limitation of Jackson XML but wanted to ask the community first to see if I am missing something. Given the following xml:
<Element1>
<Element2 attribute="Some String">Some element value</Element2>
<Element1>
Is it possible to create a POJO to deserialize the attribute value of Element2? My current POJO looks like:
@JacksonXmlRootElement(localName = "Element1")
public class Element1 implements Serializable {
@JacksonXmlProperty(isAttribute = true)
private String attribute;
}
This returns the value of the Element2 tag which in this case is "Some element value". However if I move the attribute to the Element1 tag, this same code is able to retrieve the attribute value. Is there some limitation of jackson xml to get nested attributes? I have also tried specifying the localname of the attribute but that doesnt work either. I feel I am missing something or this is a limitation of the library. TIA.