throws TransformationException {
try {
this.inputSet = input.getNodeSet(true);
CachedXPathFuncHereAPI xPathFuncHereAPI =
new CachedXPathFuncHereAPI(CachedXPathAPIHolder.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 xpathElement = XMLUtils.selectNode(transformElement.getFirstChild(),
Transforms.TRANSFORM_XPATHFILTERCHGP,
XPathFilterCHGPContainer._TAG_XPATHCHGP,0);
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,CachedXPathFuncHereAPI.getStrFromNode(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,
CachedXPathFuncHereAPI.getStrFromNode(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,
CachedXPathFuncHereAPI.getStrFromNode(excludeCtxNode),
xpathContainer.getElement());
}