I read xml files with JAXB. I have the following structure
<A>
<B value="some string" />
</A>
I have the following model
@XmlRootElement
class A{
@XmlElement(name = "B", required = true)
@XmlPath("B/@value")
String b;
}
I read the B tags value attribute in my b Instance variable.
But in some XML files i have in the B tag following Structure <#B/>
While JAXB unmarshall the files i become exception that the format is not correct.
javax.xml.stream.XMLStreamException: ParseError at [row,col]:[19,4]
You should just have the following without the
@XmlElement
annotation: