E
Elhanan
i'm trying to use jaxb with eclipse , I have allready generated the
classes and they are ok but if try :
j
final JAXBContext
context=JAXBContext.newInstance(Party.class.getPackage().getName());
Unmarshaller
unmarshaller=context.createUnmarshaller();
Marshaller ms=context.createMarshaller();
DocumentBuilderFactory f =
DocumentBuilderFactory.newInstance();
DocumentBuilder b= f.newDocumentBuilder();
Document d = b.parse("test001.xml");
// Unmarshall the document
final RespParty respParty = (RespParty)
unmarshaller.unmarshal(d);
javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException: unexpected root element (uri:"",
local:"party"). Expected elements are <{http://nokis.baw.de/}party>]
so instead of using the document object, i used a file object and it
was ok, but, if i try to create a objects and turn it to xml i can't.
classes and they are ok but if try :
j
final JAXBContext
context=JAXBContext.newInstance(Party.class.getPackage().getName());
Unmarshaller
unmarshaller=context.createUnmarshaller();
Marshaller ms=context.createMarshaller();
DocumentBuilderFactory f =
DocumentBuilderFactory.newInstance();
DocumentBuilder b= f.newDocumentBuilder();
Document d = b.parse("test001.xml");
// Unmarshall the document
final RespParty respParty = (RespParty)
unmarshaller.unmarshal(d);
javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException: unexpected root element (uri:"",
local:"party"). Expected elements are <{http://nokis.baw.de/}party>]
so instead of using the document object, i used a file object and it
was ok, but, if i try to create a objects and turn it to xml i can't.