XQueryLexer lexer = new XQueryLexer(new StringReader(xquery));
XQueryLexer lexer = new XQueryLexer(context, new StringReader(xquery));
	protected PathExpr compile(User user, DBBroker broker, String xquery,			Hashtable parameters) throws Exception {		String baseURI = (String) parameters.get(RpcAPI.BASE_URI);		XQueryContext context = new XQueryContext(broker);		context.setBaseURI(baseURI);		Hashtable namespaces = (Hashtable)parameters.get(RpcAPI.NAMESPACES);		if(namespaces != null && namespaces.size() > 0) {			context.declareNamespaces(namespaces);		}		//	declare static variables		Hashtable variableDecls = (Hashtable)parameters.get(RpcAPI.VARIABLES);		if(variableDecls != null) {			for (Iterator i = variableDecls.entrySet().iterator(); i.hasNext();) {				Map.Entry entry = (Map.Entry) i.next();				LOG.debug("declaring " + entry.getKey().toString() + " = " + entry.getValue());				context.declareVariable((String) entry.getKey(), entry.getValue());			}		}		LOG.debug("compiling " + xquery);		XQueryLexer lexer = new XQueryLexer(new StringReader(xquery));		XQueryParser parser = new XQueryParser(lexer);		XQueryTreeParser treeParser = new XQueryTreeParser(context);		parser.xpath();		if (parser.foundErrors()) {			throw new EXistException(parser.getErrorMessage());		}		AST ast = parser.getAST();		PathExpr expr = new PathExpr(context);		treeParser.xpath(ast, expr);		if (treeParser.foundErrors()) {			throw new EXistException(treeParser.getErrorMessage());		}		return expr;	}