xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext();
else
throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext }));
if (expr == null || expr.length() == 0)
return new NodeSet();
NodeSet closureSet = new NodeSet();
closureSet.setShouldCacheNodes(true);
NodeList iterationList = nl;
do
{
NodeSet iterationSet = new NodeSet();
NodeSetDTM contextNodes = new NodeSetDTM(iterationList, xctxt);
xctxt.pushContextNodeList(contextNodes);
for (int i = 0; i < iterationList.getLength(); i++)
{
int contextNode = contextNodes.item(i);
xctxt.pushCurrentNode(contextNode);
XObject object = null;
try
{
XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(),
xctxt.getNamespaceContext(),
XPath.SELECT);
object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext());
if (object instanceof XNodeSet)
{
NodeList nodelist = null;
nodelist = ((XNodeSet)object).nodelist();
for (int k = 0; k < nodelist.getLength(); k++)
{
Node n = nodelist.item(k);
if (!iterationSet.contains(n))
iterationSet.addNode(n);
}
}
else
{
xctxt.popCurrentNode();
xctxt.popContextNodeList();
return new NodeSet();
}
}
catch (TransformerException e)
{
xctxt.popCurrentNode();
xctxt.popContextNodeList();
return new NodeSet();
}
xctxt.popCurrentNode();
}