I have XML file where the last line is a commented text and contains unique ID XXX. The goal is a deserialize the comment value of a property.
<countries>
<code>AD<code/>
<code>AE<code/>
</countries>
<!-- RUID: [XXXX] -->
Expected class structure
@JacksonXmlRootElement(localName = "countries")
public class CountriesRS {
String RUID; // the property to store velue from <!-- RUID: [XXXX] -->
List<String> code;
}
Code to read value
XmlMapper xmlMapper = new XmlMapper();
CountriesRS rs = xmlMapper.readValue(detailsString, CountriesRS.class);
How can I configure XmlMapper to do this?
I have use jackson-dataformat-xml version 2.8