namespace = ((XMLRoot)object).getNamespaceURI();
name = ((XMLRoot)object).getLocalName();
} else {
xmlDocument = objectToXML(object, xmlDescriptor, isXMLRoot);
}
DOMReader reader = new DOMReader();
reader.setProperty("http://xml.org/sax/properties/lexical-handler", lexicalHandler);
if (isFragment()) {
FragmentContentHandler fragmentHandler = new FragmentContentHandler(contentHandler);
reader.setContentHandler(fragmentHandler);
} else {
reader.setContentHandler(contentHandler);
}
reader.parse(xmlDocument, namespace, name);
} catch (XMLPlatformException e) {
throw XMLMarshalException.marshalException(e);
} catch (org.xml.sax.SAXNotRecognizedException e) {
//won't be thrown
} catch (SAXNotSupportedException e) {