Search in sources :

Example 1 with DocumentRootNodeFilter

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;
}
Also used : NestedFilter(org.sirix.axis.filter.NestedFilter) ItemFilter(org.sirix.axis.filter.ItemFilter) AttributeFilter(org.sirix.axis.filter.AttributeFilter) NameFilter(org.sirix.axis.filter.NameFilter) TypeFilter(org.sirix.axis.filter.TypeFilter) NestedFilter(org.sirix.axis.filter.NestedFilter) DocumentRootNodeFilter(org.sirix.axis.filter.DocumentRootNodeFilter) CommentFilter(org.sirix.axis.filter.CommentFilter) WildcardFilter(org.sirix.axis.filter.WildcardFilter) PIFilter(org.sirix.axis.filter.PIFilter) SchemaElementFilter(org.sirix.service.xml.xpath.filter.SchemaElementFilter) Filter(org.sirix.api.Filter) SchemaAttributeFilter(org.sirix.service.xml.xpath.filter.SchemaAttributeFilter) TextFilter(org.sirix.axis.filter.TextFilter) ElementFilter(org.sirix.axis.filter.ElementFilter) NodeFilter(org.sirix.axis.filter.NodeFilter) DocumentRootNodeFilter(org.sirix.axis.filter.DocumentRootNodeFilter)

Aggregations

Filter (org.sirix.api.Filter)1 AttributeFilter (org.sirix.axis.filter.AttributeFilter)1 CommentFilter (org.sirix.axis.filter.CommentFilter)1 DocumentRootNodeFilter (org.sirix.axis.filter.DocumentRootNodeFilter)1 ElementFilter (org.sirix.axis.filter.ElementFilter)1 ItemFilter (org.sirix.axis.filter.ItemFilter)1 NameFilter (org.sirix.axis.filter.NameFilter)1 NestedFilter (org.sirix.axis.filter.NestedFilter)1 NodeFilter (org.sirix.axis.filter.NodeFilter)1 PIFilter (org.sirix.axis.filter.PIFilter)1 TextFilter (org.sirix.axis.filter.TextFilter)1 TypeFilter (org.sirix.axis.filter.TypeFilter)1 WildcardFilter (org.sirix.axis.filter.WildcardFilter)1 SchemaAttributeFilter (org.sirix.service.xml.xpath.filter.SchemaAttributeFilter)1 SchemaElementFilter (org.sirix.service.xml.xpath.filter.SchemaElementFilter)1