_database = database;
XAQLSyntaxParser parser = Parboiled.createParser(XAQLSyntaxParser.class);
ParsingResult<XAQLToken> result = new ReportingParseRunner<XAQLToken>(parser.XPathStatement()).run(new DefaultInputBuffer(pathExpression.toCharArray()));
if (result.hasErrors()) {
throw new WikiQueryException(WikiQueryException.InvalidWikiQuery, pathExpression + "\n" + ErrorUtils.printParseErrors(result));
} else {
_targetPath = new AbsoluteTargetPathGenerator().getTargetPath(database.schema().root(), database.versionIndex(), result.parseTreeRoot.getValue().children().firstElement().children().iterator());