throws TransformationException {
try {
this.inputSet = input.getNodeSet();
CachedXPathFuncHereAPI xPathFuncHereAPI =
new CachedXPathFuncHereAPI(input.getCachedXPathAPI());
CachedXPathAPI myXPathAPI =
new CachedXPathAPI(input.getCachedXPathAPI());
if (this.inputSet.size() == 0) {
Object exArgs[] = { "input node set contains no nodes" };
throw new TransformationException("empty", exArgs);
}
Element transformElement = this._transformObject.getElement();
Document doc = transformElement.getOwnerDocument();
// create the XPathFilterCHGPContainer so that we easily can read it out
Element nscontext =
XMLUtils.createDSctx(doc, "dsig-xpathalt",
Transforms.TRANSFORM_XPATHFILTERCHGP);
Element xpathElement =
(Element) myXPathAPI
.selectSingleNode(transformElement, "./dsig-xpathalt:"
+ XPathFilterCHGPContainer
._TAG_XPATHCHGP, nscontext);
if (xpathElement == null) {
Object exArgs[] = { "{" + TransformXPathFilterCHGP.implementedTransformURI + "}XPath",
"Transform" };
throw new TransformationException("xml.WrongContent", exArgs);
}
XPathFilterCHGPContainer xpathContainer =
XPathFilterCHGPContainer.getInstance(xpathElement,
input.getSourceURI());
// get the document (root node) for the traversal
Document inputDoc = null;
{
Iterator it = this.inputSet.iterator();
if (it.hasNext()) {
inputDoc = XMLUtils.getOwnerDocument((Node) it.next());
}
}
{
// 'tag' the include-but-search nodes
Node includeButSearchCtxNode =
xpathContainer.getHereContextNodeIncludeButSearch();
NodeList includeButSearchNodes = null;
if (includeButSearchCtxNode != null) {
includeButSearchNodes = xPathFuncHereAPI.selectNodeList(doc,
includeButSearchCtxNode, xpathContainer.getElement());
}
this.includeSearchSet = nodeListToSet(includeButSearchNodes);
}
{
// 'tag' the exclude-but-search nodes
Node excludeButSearchCtxNode =
xpathContainer.getHereContextNodeExcludeButSearch();
NodeList excludeButSearchNodes = null;
if (excludeButSearchCtxNode != null) {
excludeButSearchNodes = xPathFuncHereAPI.selectNodeList(doc,
excludeButSearchCtxNode, xpathContainer.getElement());
}
this.excludeSearchSet = nodeListToSet(excludeButSearchNodes);
}
{
// 'tag' the exclude nodes
Node excludeCtxNode = xpathContainer.getHereContextNodeExclude();
NodeList excludeNodes = null;
if (excludeCtxNode != null) {
excludeNodes = xPathFuncHereAPI.selectNodeList(doc,
excludeCtxNode, xpathContainer.getElement());
}
this.excludeSet = nodeListToSet(excludeNodes);
}