System.out.println("found: " + resultSet.getLength());
System.out.println("found: " + result.getLength());
	public void testQuery() throws XPathException {		//String query = "document()//p[. &= '\uB2E8\uACC4']";		String query =			"document()//p[. = '\u4ED6\u4E3A\u8FD9\u9879\u5DE5\u7A0B\u6295"				+ "\u5165\u4E86\u5341\u4E09\u5E74\u65F6\u95F4\u3002']";		// get a BrokerPool for access to the database engine		BrokerPool pool = null;		try {			pool = BrokerPool.getInstance();		} catch (EXistException e1) {			e1.printStackTrace();			fail(e1.getMessage());		}		User user = pool.getSecurityManager().getUser("admin");		DBBroker broker = null;		try {			// parse the xml source			broker = pool.get(user);			Collection collection = broker.getCollection("/db/test");			collection.addDocument(broker, "test.xml", xml);			// parse the query into the internal syntax tree			XQueryContext context = new XQueryContext(broker);			XQueryLexer lexer = new XQueryLexer(context, new StringReader(query));			XQueryParser xparser = new XQueryParser(lexer);			XQueryTreeParser treeParser = new XQueryTreeParser(context);			xparser.xpath();			if (xparser.foundErrors()) {				System.err.println(xparser.getErrorMessage());				return;			}			AST ast = xparser.getAST();			System.out.println("generated AST: " + ast.toStringTree());			PathExpr expr = new PathExpr(context);			treeParser.xpath(ast, expr);			if (treeParser.foundErrors()) {				System.err.println(treeParser.getErrorMessage());				return;			}			expr.analyze(null, 0);			// execute the query			Sequence result = expr.eval(null, null);			// check results			NodeSet resultSet = (NodeSet) result;			System.out.println("----------------------------------");			System.out.println("found: " + resultSet.getLength());		} catch (RecognitionException e) {			e.printStackTrace();		} catch (TokenStreamException e) {			e.printStackTrace();		} catch (EXistException e) {			e.printStackTrace();		} catch (PermissionDeniedException e) {			e.printStackTrace();		} catch (SAXException e) {			e.printStackTrace();		} catch (TriggerException e) {			e.printStackTrace();		} catch (LockException e) {			e.printStackTrace();		} finally {			pool.release(broker);		}		if (localDb)			try {				BrokerPool.stop();			} catch (EXistException e2) {				e2.printStackTrace();			}	}