Class FuncPosition

All Implemented Interfaces:
SourceLocator, ExpressionNode, XPathVisitable

public class FuncPosition extends Function
Execute the Position() function.
  • Constructor Details

    • FuncPosition

      public FuncPosition()
  • Method Details

    • postCompileStep

      public void postCompileStep(Compiler compiler)
      This function is currently only being used by Position() and Last(). See respective functions for more detail.
      Overrides:
      postCompileStep in class Function
    • getPositionInContextNodeList

      public int getPositionInContextNodeList(XPathContext xctxt)
      Get the position in the current context node list.
      Parameters:
      xctxt - Runtime XPath context.
      Returns:
      The current position of the iteration in the context node list, or -1 if there is no active context node list.
    • execute

      public XObject execute(XPathContext xctxt) throws TransformerException
      Execute an expression in the XPath runtime context, and return the result of the expression.
      Overrides:
      execute in class Function
      Parameters:
      xctxt - The XPath runtime context.
      Returns:
      The result of the expression in the form of a XObject.
      Throws:
      TransformerException - if a runtime exception occurs.