Example #1
0
 /**
  * This will flush any characters from SAX character calls we've been buffering.
  *
  * @throws SAXException when things go wrong
  */
 protected void flushCharacters() throws SAXException {
   if (ignoringBoundaryWhite) {
     if (!textBuffer.isAllWhitespace()) {
       flushCharacters(textBuffer.toString());
     }
   } else {
     flushCharacters(textBuffer.toString());
   }
   textBuffer.clear();
 }
Example #2
0
  /**
   * This will report character data (within an element).
   *
   * @param ch <code>char[]</code> character array with character data
   * @param start <code>int</code> index in array where data starts.
   * @param length <code>int</code> length of data.
   * @throws SAXException
   */
  public void characters(char[] ch, int start, int length) throws SAXException {

    if (suppress || (length == 0)) return;

    if (previousCDATA != inCDATA) {
      flushCharacters();
    }

    textBuffer.append(ch, start, length);
  }