if (nextSibling != null)
handler.setNextSibling(nextSibling);
String encoding = format.getProperty(OutputKeys.ENCODING);
xoh = new ToXMLSAXHandler(handler, (LexicalHandler)handler, encoding);
}
else if (outputTarget instanceof SAXResult)
{
ContentHandler handler = ((SAXResult) outputTarget).getHandler();
if (null == handler)
throw new IllegalArgumentException(
"handler can not be null for a SAXResult");
LexicalHandler lexHandler;
if (handler instanceof LexicalHandler)
lexHandler = (LexicalHandler) handler;
else
lexHandler = null;
String encoding = format.getProperty(OutputKeys.ENCODING);
String method = format.getProperty(OutputKeys.METHOD);
ToXMLSAXHandler toXMLSAXHandler = new ToXMLSAXHandler(handler, lexHandler, encoding);
toXMLSAXHandler.setShouldOutputNSAttr(false);
xoh = toXMLSAXHandler;
String publicID = format.getProperty(OutputKeys.DOCTYPE_PUBLIC);
String systemID = format.getProperty(OutputKeys.DOCTYPE_SYSTEM);