code: private final boolean checkProximityPosition(XPathContext xctxt,
            int predPos, DTM dtm, int context, int pos)
    {
  
      try
      {
        DTMAxisTraverser traverser =
          dtm.getAxisTraverser(Axis.PRECEDINGSIBLING);
  
        for (int child = traverser.first(context); DTM.NULL != child;
                child = traverser.next(context, child))
        {
          try
          {
            xctxt.pushCurrentNode(child);
  
            if (NodeTest.SCORE_NONE != super.execute(xctxt, child))
            {
              boolean pass = true;
  
              try
              {
                xctxt.pushSubContextList(this);
  
                for (int i = 0; i < predPos; i++)
                {
                  xctxt.pushPredicatePos(i);
                  try
                  {
                    XObject pred = m_predicates[i].execute(xctxt);
                    
                    try
                    {
                      if (XObject.CLASS_NUMBER == pred.getType())
                      {
                        throw new Error("Why: Should never have been called");
                      }
                      else if (!pred.boolWithSideEffects())
                      {
                        pass = false;
      
                        break;
                      }
                    }
                    finally
                    {
                      pred.detach();
                    }
                  }
                  finally
                  {
                    xctxt.popPredicatePos();
                  }
                }
              }
              finally
              {
                xctxt.popSubContextList();
              }
  
              if (pass)
                pos--;
  
              if (pos < 1)
                return false;
            }
          }
          finally
          {
            xctxt.popCurrentNode();
          }
        }
      }
      catch (javax.xml.transform.TransformerException se)
      {
  
        // TODO: should keep throw sax exception...
        throw new java.lang.RuntimeException(se.getMessage());
      }
  
      return (pos == 1);
    }
docs: New Method to check whether the current node satisfies a position predicate
  
  @param xctxt The XPath runtime context.
  @param predPos Which predicate we're evaluating of foo[1][2][3].
  @param dtm The DTM of the current node.
  @param context The currentNode.
  @param pos The position being requested, i.e. the value returned by
  m_predicates[predPos].execute(xctxt).
  
  @return true of the position of the context matches pos, false otherwise.