use of org.sirix.axis.filter.PIFilter in project sirix by sirixdb.
the class XPathParser method parsePITest.
/**
* Parses the the rule PITest according to the following production rule:
* <p>
* [58] PITest ::= <"processing-instruction" "("> (NCName | StringLiteral)? ")" .
* </p>
*
* @return filter
*/
private Filter parsePITest() {
consume("processing-instruction", true);
consume(TokenType.OPEN_BR, true);
Filter filter = new PIFilter(getTransaction());
if (!is(TokenType.CLOSE_BR, true)) {
String stringLiteral;
if (isQuote()) {
final byte[] param = ((ValueNode) getTransaction().getItemList().getItem(parseStringLiteral()).get()).getRawValue();
stringLiteral = Arrays.toString(param);
} else {
stringLiteral = parseNCName();
}
consume(TokenType.CLOSE_BR, true);
filter = new NestedFilter(getTransaction(), filter, new NameFilter(getTransaction(), stringLiteral));
}
return filter;
}
Aggregations