Method enginePerformTransform
try {
/**
* If the actual input is an octet stream, then the application MUST
* convert the octet stream to an XPath node-set suitable for use by
* Canonical XML with Comments. (A subsequent application of the
* REQUIRED Canonical XML algorithm would strip away these comments.)
*
* ...
*
* The evaluation of this expression includes all of the document's nodes
* (including comments) in the node-set representing the octet stream.
*/
CachedXPathAPIHolder.setDoc(this._transformObject.getElement().getOwnerDocument());
Element xpathElement =XMLUtils.selectDsNode(
this._transformObject.getElement().getFirstChild(),
Constants._TAG_XPATH,0);
if (xpathElement == null) {
Object exArgs[] = { "ds:XPath", "Transform" };
throw new TransformationException("xml.WrongContent", exArgs);
}
Node xpathnode = xpathElement.getChildNodes().item(0);
String str=CachedXPathFuncHereAPI.getStrFromNode(xpathnode);
input.setNeedsToBeExpanded(needsCircunvent(str));
if (xpathnode == null) {
throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
"Text must be in ds:Xpath");
}
input.addNodeFilter(new XPathNodeFilter( xpathElement, xpathnode, str));
input.setNodeSet(true);
return input;
} catch (DOMException ex) {
throw new TransformationException("empty", ex);
}