I am very new to JAXB. I have an XML document that contains a serialized object inside one of its elements:
<?xml> <structure> ...blah-blah <serializedElement> ... JAXB xml block </serializedElement> </structure> </xml>
How to disable such an element?
I wrote the following:
org.w3c.dom.Document doc = db.parse(new StringInputStream(rawXml)); org.w3c.dom.Element obj = (org.w3c.dom.Element) doc.getElementsByTagName("serializedElement").item(0); JAXBElement<MyJaxBObject> je = um.unmarshal(obj, MyJaxBObject.class); System.out.println(je.getValue());
but this always returns an empty value object (although the correct class).
What am I doing wrong?
Thanks!
source share