if (nodeType > 0 && nodeType != Node.DOCUMENT_NODE) {
// add a document node wrapper
Node sourceNode = (Node)inSourceDoc;
Document sourceDoc = sourceNode.getOwnerDocument();
HTMLDocumentWrapper htmlDoc = new HTMLDocumentWrapper(sourceDoc, sourceDoc.getURL(), config, DocType.UNKNOWN);
fetchedSourceDoc = htmlDoc.wrap(sourceNode);
} else {
fetchedSourceDoc = SaxonceApi.getDocSynchronously(inSourceDoc, config);
}
}
// this method only runs if transformInvoked == false - need to get sourceDoc reference if not invoked