Methods Summary |
---|
public com.sun.org.apache.xpath.internal.objects.XObject | execute(com.sun.org.apache.xpath.internal.XPathContext xctxt)Execute the function. The function must return
a valid object.
XNumber xnum = new XNumber((double) getCountOfContextNodeList(xctxt));
// System.out.println("last: "+xnum.num());
return xnum;
|
public void | fixupVariables(java.util.Vector vars, int globalsSize)No arguments to process, so this does nothing.
// no-op
|
public int | getCountOfContextNodeList(com.sun.org.apache.xpath.internal.XPathContext xctxt)Get the position in the current context node list.
// assert(null != m_contextNodeList, "m_contextNodeList must be non-null");
// If we're in a predicate, then this will return non-null.
SubContextList iter = m_isTopLevel ? null : xctxt.getSubContextList();
// System.out.println("iter: "+iter);
if (null != iter)
return iter.getLastPos(xctxt);
DTMIterator cnl = xctxt.getContextNodeList();
int count;
if(null != cnl)
{
count = cnl.getLength();
// System.out.println("count: "+count);
}
else
count = 0;
return count;
|
public void | postCompileStep(com.sun.org.apache.xpath.internal.compiler.Compiler compiler)Figure out if we're executing a toplevel expression.
If so, we can't be inside of a predicate.
m_isTopLevel = compiler.getLocationPathDepth() == -1;
|