if (ast == null)
throw new XPathException("Unknown XQuery parser error: the parser returned an empty syntax tree.");
PathExpr expr = new PathExpr(context);
if (xpointer)
treeParser.xpointer(ast, expr);
else
treeParser.xpath(ast, expr);
if (treeParser.foundErrors()) {
throw new StaticXQueryException(
treeParser.getErrorMessage(),