// processor.error(XSLTErrorResources.ER_CANT_USE_DTM_FOR_OUTPUT); //Can't use a DTMLiaison for an output DOM node... pass a org.apache.xalan.xpath.xdom.XercesLiaison instead!");
switch(outputTarget.getNode().getNodeType())
{
case Node.DOCUMENT_NODE:
handler.setContentHandler(new FormatterToDOM((Document)outputTarget.getNode()).getSerializerObject());
processor.setDocumentHandler(handler);
break;
case Node.DOCUMENT_FRAGMENT_NODE:
handler.setContentHandler(new FormatterToDOM(outputTarget.getNode().getOwnerDocument(), // PR:DMAN4M6PK5 Submitted by:<bk@viae.de>
(DocumentFragment)outputTarget.getNode()).getSerializerObject());
processor.setDocumentHandler(handler);
break;
case Node.ELEMENT_NODE:
handler.setContentHandler(new FormatterToDOM(outputTarget.getNode().getOwnerDocument(), // PR:DMAN4M6PK5 Submitted by:<bk@viae.de>
(Element)outputTarget.getNode()).getSerializerObject());
processor.setDocumentHandler(handler);
break;
default:
m_sRootObject.error(XSLTErrorResources.ER_CAN_ONLY_OUTPUT_TO_ELEMENT); //"Can only output to an Element, DocumentFragment, Document, or PrintWriter.");
}
}
else
{
ParserAdapter handler = new ParserAdapter(new org.apache.xerces.parsers.SAXParser());
outputTarget.setNode(processor.getXMLProcessorLiaison().createDocument());
handler.setContentHandler(new FormatterToDOM((Document)outputTarget.getNode()).getSerializerObject());
processor.setDocumentHandler(handler);
}
// processor.resetCurrentState(sourceTree);
// processor.m_rootDoc = sourceTree;