This is my XML
<?xml version="1.0"?>
<gpx version="1.1" creator="Example" xmlns="http://www.Example.com/1" xmlns:football="https://www.Example-football.com/xsd/football-ext">
<metadata>
<name>hello world</name>
<time>2018-04-26T12:32:52</time>
<extensions>
<sportsMeta>
<football:length>5080.3714454417996</football:length>
</sportsMeta>
</extensions>
</metadata>
</gpx>
Added this to package-info.java
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.Example.com/1", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED, attributeFormDefault = XmlNsForm.UNQUALIFIED, xmlns = {
@javax.xml.bind.annotation.XmlNs(prefix = "football", namespaceURI = "https://www.Example-football.com/xsd/football-ext"),
@javax.xml.bind.annotation.XmlNs(prefix = "", namespaceURI = "https://www.Example-football.com/xsd/football-ext/1/1") })
package com.example.football.share.gpx;
import javax.xml.bind.annotation.XmlNsForm;
I am able to read name, time. But not able to read guid, length.
Here is SportsMeta.java
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "sportsMeta", propOrder = {
"length"
})
public class SportsMeta {
protected BigDecimal length;
public BigDecimal getLength() {
return length;
}
public void setLength(BigDecimal length) {
this.length = length;
}
}
How can I read length info from the XML file.