Exemplo n.º 1
0
  public String toXPathCondition() {
    String xPathExpression;
    if ("*".equals(this.xPathExpression)) {
      xPathExpression = MATCH_EVERYTHING_XPATH_CONDITIONAL;
    } else {
      xPathExpression = "local-name() = '" + this.xPathExpression + "'";
    }
    ElementFilterList elementFilterList = this.elementFilterList; // should be a copy

    for (XPathComponent other : combinatedComponents) {
      elementFilterList = other.mergeFilterAsCondition(elementFilterList);
      xPathExpression = other.mergeExpressionAsCondition(xPathExpression);
    }
    return xPathExpression;
  }
Exemplo n.º 2
0
  public String toXPath() {
    String xPathExpression;
    if ("*".equals(this.xPathExpression)) {
      xPathExpression = ".//*";
    } else {
      xPathExpression = ".//*[self::" + this.xPathExpression + "]";
    }
    ElementFilterList elementFilterList = this.elementFilterList; // should be a copy

    for (XPathComponent other : combinatedComponents) {
      elementFilterList = other.mergeIntoFilter(elementFilterList);
      xPathExpression = other.mergeIntoExpression(xPathExpression);
    }
    return "(" + xPathExpression + ")";
  }