Пример #1
0
  @Override
  String toXMLString() {
    //    See ECMA 10.2.1
    StringBuffer sb = new StringBuffer();

    for (int i = 0; i < length(); i++) {
      if (getProcessor().isPrettyPrinting() && i != 0) {
        sb.append('\n');
      }
      sb.append(getXmlFromAnnotation(i).toXMLString());
    }
    return sb.toString();
  }
Пример #2
0
  @Override
  public String toString() {
    //    ECMA357 10.1.2
    if (hasSimpleContent()) {
      StringBuffer sb = new StringBuffer();

      for (int i = 0; i < length(); i++) {
        XML next = getXmlFromAnnotation(i);
        if (next.isComment() || next.isProcessingInstruction()) {
          //    do nothing
        } else {
          sb.append(next.toString());
        }
      }

      return sb.toString();
    } else {
      return toXMLString();
    }
  }