use of org.sirix.axis.filter.DocumentRootNodeFilter in project sirix by sirixdb.
the class XPathParser method parseDocumentTest.
/**
* Parses the the rule DocumentCreater according to the following production rule:
* <p>
* [55] DocumentCreater ::= <"document-node" "("> (ElementTest | SchemaElementTest)? ")" .
* <p>
*
* @return filter
*/
private Filter parseDocumentTest() {
consume("document-node", true);
consume(TokenType.OPEN_BR, true);
Filter filter = new DocumentRootNodeFilter(getTransaction());
Filter innerFilter;
if (mToken.getContent().equals("element")) {
innerFilter = parseElementTest();
filter = new NestedFilter(getTransaction(), filter, innerFilter);
} else if (mToken.getContent().equals("schema-element")) {
innerFilter = parseSchemaElementTest();
filter = new NestedFilter(getTransaction(), filter, innerFilter);
}
consume(TokenType.CLOSE_BR, true);
return filter;
}
Aggregations