You mark an XML element as optional by including minOccurs="0"
in the definition.
I used value as complex type . but when i use value as complex type i am not able to parse the string value from Value in JAXB
If you just define the complex type then you will need to pass the corresponding class to the unmarshal method:
Datapoint datapoint = unmarshaller.unmarshal(xml, Datapoint.class).getValue();
You do not need to use the class parameter if you define a global element for the complex type. If you define a global element that references a named complex type you will get an instance of JAXBElement<Datapoint>
back, and if you define a global element with an anonymous type you will get back an instance of Datapoint
.