handler.fatalError(new TranscoderException(
"Unspecified transcoding hints: KEY_DOCUMENT_ELEMENT"));
return;
}
// parse the XML document
DocumentFactory f = createDocumentFactory(domImpl, parserClassname);
boolean b =
((Boolean)hints.get(KEY_XML_PARSER_VALIDATING)).booleanValue();
f.setValidating(b);
try {
if (input.getInputStream() != null) {
document = f.createDocument(namespaceURI,
documentElement,
input.getURI(),
input.getInputStream());
} else if (input.getReader() != null) {
document = f.createDocument(namespaceURI,
documentElement,
input.getURI(),
input.getReader());
} else if (input.getXMLReader() != null) {
document = f.createDocument(namespaceURI,
documentElement,
input.getURI(),
input.getXMLReader());
} else if (uri != null) {
document = f.createDocument(namespaceURI,
documentElement,
uri);
}
} catch (DOMException ex) {
handler.fatalError(new TranscoderException(ex));