protected XPath compileXPath(String xpath) throws XPathParserException, StaticError {
    if (useNewApi) {
      newXPath = new Engine().parseExpression(xpath, staticContextBuilder);
      return null;
    } else {
      XPathParser xpp = new JFlexCupParser();
      XPath path = oldXPath = xpp.parse(xpath);

      StaticChecker name_check = new StaticNameResolver(dynamicContext);
      name_check.check(path);
      return path;
    }
  }
  protected XPath compileXPath(String xpath, boolean isRootlessAccess)
      throws XPathParserException, StaticError {
    XPathParser xpp = new JFlexCupParser();
    XPath path = null;
    if (isRootlessAccess) {
      path = xpp.parse(xpath, isRootlessAccess);
    } else {
      path = xpp.parse(xpath);
    }

    StaticChecker name_check = new StaticNameResolver(dynamicContext);
    name_check.check(path);
    return path;
  }