use of org.sirix.axis.filter.FilterAxis in project sirix by sirixdb.
the class XPathParser method parseAbbrevForwardStep.
/**
* Parses the the rule AbrevForwardStep according to the following production rule:
* <p>
* [31] AbbrevForwardStep ::= "@"? NodeTest .
* </p>
*
* @return FilterAxis
*/
private AbstractAxis parseAbbrevForwardStep() {
AbstractAxis axis;
boolean isAttribute;
if (is(TokenType.AT, true) || mToken.getContent().equals("attribute") || mToken.getContent().equals("schema-attribute")) {
// in case of .../attribute(..), or .../schema-attribute() the
// default
// axis
// is the attribute axis
axis = new AttributeAxis(getTransaction());
isAttribute = true;
} else {
// default axis is the child axis
axis = new ChildAxis(getTransaction());
isAttribute = false;
}
final Filter filter = parseNodeTest(isAttribute);
return new FilterAxis(axis, filter);
}
use of org.sirix.axis.filter.FilterAxis in project sirix by sirixdb.
the class NodeWrapper method expandString.
/**
* Filter text nodes.
*
* @return concatenated String of text node values
*/
private String expandString() {
final FastStringBuffer fsb = new FastStringBuffer(FastStringBuffer.SMALL);
try {
final NodeReadTrx rtx = createRtxAndMove();
final FilterAxis axis = new FilterAxis(new DescendantAxis(rtx), new TextFilter(rtx));
while (axis.hasNext()) {
axis.next();
fsb.append(rtx.getValue());
}
rtx.close();
} catch (final SirixException exc) {
LOGGER.error(exc.toString());
}
return fsb.condense().toString();
}
Aggregations