content-parser/impl-html/src/main/java/net/sf/mmm/content/parser/impl/html/ContentParserHtml.java
/**
   * This method recursively collects the text from the given
   * <code>element</code> and appends it to the given <code>buffer</code>.
   * 
   * @param element is the element for which the text is requested.
   * @param buffer is the buffer where the text will be appended to.
   */
This method recursively collects the text from the given
element and appends it to the given buffer.

@param element is the element for which the text is requested.
@param buffer is the buffer where the text will be appended to.
This method recursively collects the text from the given element and appends it to the given buffer . @param element is the element for which the text is requested . @param buffer is the buffer where the text will be appended to .
private void collectTextContent(Element element, StringBuffer buffer) {
    NodeList nodeList = element.getChildNodes();
    for (int nodeIndex = 0; nodeIndex < nodeList.getLength(); nodeIndex++) {
      Node childNode = nodeList.item(nodeIndex);
      short nodeType = childNode.getNodeType();
      if (nodeType == Node.ELEMENT_NODE) {
        collectTextContent((Element) childNode, buffer);
      } else if ((nodeType == Node.TEXT_NODE) || (nodeType == Node.CDATA_SECTION_NODE)) {
        buffer.append(childNode.getNodeValue());
      }
    }
  }
private void collectTextContent ( Element element , StringBuffer buffer ) { NodeList nodeList = element . getChildNodes ( ) ; for ( int nodeIndex = 0 ; nodeIndex < nodeList . getLength ( ) ; nodeIndex ++ ) { Node childNode = nodeList . item ( nodeIndex ) ; short nodeType = childNode . getNodeType ( ) ; if ( nodeType == Node . ELEMENT_NODE ) { collectTextContent ( ( Element ) childNode , buffer ) ; } else if ( ( nodeType == Node . TEXT_NODE ) || ( nodeType == Node . CDATA_SECTION_NODE ) ) { buffer . append ( childNode . getNodeValue ( ) ) ; } } }
This method recursively collects the text from the given
 <code>element</code> and appends it to the given <code>buffer</code>.
This method recursively collects the text from the given <code > element< / code > and appends it to the given <code > buffer< / code > .
// buffer.append(' ');