@Test public void shouldParseRelativePathExpressionWithAbbreviatedDescendantOrSelfWithRelativeNumericLiteralPredicate() { assertThat(parser.parseRelativePathExpr(tokenize("a is(relativePathExpr(axisStep(nameTest("a")), descendantOrSelf(), filterStep(contextItem(), literal("3"))))); }
protected PathExpression parseRelativePathExpr( TokenStream tokens ) { List<StepExpression> steps = new ArrayList<StepExpression>(); steps.add(parseStepExpr(tokens)); while (tokens.canConsume('/')) { if (tokens.canConsume('/')) { steps.add(new DescendantOrSelf()); } if (tokens.hasNext()) { steps.add(parseStepExpr(tokens)); } } OrderBy orderBy = parseOrderBy(tokens); return new PathExpression(true, steps, orderBy); }
XPathParser { protected PathExpression parseRelativePathExpr( TokenStream tokens ) { List<StepExpression> steps = new ArrayList<StepExpression>(); steps.add(parseStepExpr(tokens)); while (tokens.canConsume('/')) { if (tokens.canConsume('/')) { steps.add(new DescendantOrSelf()); } if (tokens.hasNext()) { steps.add(parseStepExpr(tokens)); } } OrderBy orderBy = parseOrderBy(tokens); return new PathExpression(true, steps, orderBy); } }
XPathParser { protected PathExpression parseRelativePathExpr( TokenStream tokens ) { List<StepExpression> steps = new ArrayList<StepExpression>(); steps.add(parseStepExpr(tokens)); while (tokens.canConsume('/')) { if (tokens.canConsume('/')) { steps.add(new DescendantOrSelf()); } if (tokens.hasNext()) { steps.add(parseStepExpr(tokens)); } } OrderBy orderBy = parseOrderBy(tokens); return new PathExpression(true, steps, orderBy); } XPathParser( TypeSystem context ); }
XPathParser { protected PathExpression parseRelativePathExpr( TokenStream tokens ) { List<StepExpression> steps = new ArrayList<StepExpression>(); steps.add(parseStepExpr(tokens)); while (tokens.canConsume('/')) { if (tokens.canConsume('/')) { steps.add(new DescendantOrSelf()); } if (tokens.hasNext()) { steps.add(parseStepExpr(tokens)); } } OrderBy orderBy = parseOrderBy(tokens); return new PathExpression(true, steps, orderBy); } XPathParser( TypeSystem context ); Component parseXPath( String xpath ); }
XPathParser { protected PathExpression parseRelativePathExpr( TokenStream tokens ) { List<StepExpression> steps = new ArrayList<StepExpression>(); steps.add(parseStepExpr(tokens)); while (tokens.canConsume('/')) { if (tokens.canConsume('/')) { steps.add(new DescendantOrSelf()); } if (tokens.hasNext()) { steps.add(parseStepExpr(tokens)); } } OrderBy orderBy = parseOrderBy(tokens); return new PathExpression(true, steps, orderBy); } XPathParser( TypeSystem context ); Component parseXPath( String xpath );  }