I have the following xml file:
<TEST>
<NEED ID="0">OK</NEED>
</TEST>
I simply want to get the attribute of the tag NEED and save it into an Integer variable.
@XmlRootElement(name = "TEST")
@XmlAccessorType (XmlAccessType.FIELD)
public class Resp {
@XmlAttribute(name = "ID", required = true)
protected Integer resultId;
// getters, setters, constructor
}
How to receive the ID value?