I have a problem with my JAXB:
<element name="create">
<complexType>
<sequence>
<element name="name" type="string"></element>
</sequence>
</complexType>
</element>
My XML:
<Create>
<name> coco </name>
</Create>
My Java:
JAXBContext context = JAXBContext.newInstance("MyPackage");
Unmarshaller decodeur = context.createUnmarshaller();
System.out.println("text : " + message);
msgObject = decodeur.unmarshal(sr);
if (msgObject instanceof Create)
{
System.out.println(" action");
}
And I have this:
unexpected element (uri:"", local:"Create"). Expected elements are <{http://www.example.org/XSD_Maths}create>
And my code stopped at this line:
msgObject = decodeur.unmarshal(sr);
Is my XML OK or is there a problem with it? I'm not sure why I'm getting this error.