private void processNode(CAS cas,Node node,StringBuilder documentText){
  if (node.hasChildNodes()) {
    if (docIdTag != null) {
      ensureIdValidity(node);
    }
    NodeList docFields=node.getChildNodes();
    for (int i=0; i < docFields.getLength(); i++) {
      Node field=docFields.item(i);
      int begin=documentText.length();
      String nodeTag=field.getLocalName();
      if (nodeTag != null && isIncluded(nodeTag)) {
        String nodeText=field.getTextContent();
        documentText=documentText.append(nodeText);
        int end=documentText.length();
        documentText=documentText.append("\n");
        if (useSubstitution && substitution.containsKey(nodeTag)) {
          nodeTag=substitution.get(nodeTag);
        }
        createFieldAnnotation(cas,nodeTag,begin,end);
      }
    }
  }
}

private void processNode ( CAS cas , Node node , StringBuilder documentText ) { if ( node . hasChildNodes ( ) ) { if ( docIdTag != null ) { ensureIdValidity ( node ) ; } NodeList docFields = node . getChildNodes ( ) ; for ( int i = 0 ; i < docFields . getLength ( ) ; i ++ ) { Node field = docFields . item ( i ) ; int begin = documentText . length ( ) ; String nodeTag = field . getLocalName ( ) ; if ( nodeTag != null && isIncluded ( nodeTag ) ) { String nodeText = field . getTextContent ( ) ; documentText = documentText . append ( nodeText ) ; int end = documentText . length ( ) ; documentText = documentText . append ( "\n" ) ; if ( useSubstitution && substitution . containsKey ( nodeTag ) ) { nodeTag = substitution . get ( nodeTag ) ; } createFieldAnnotation ( cas , nodeTag , begin , end ) ; } } } }
add the text in current node to document text buffer , create and add to index a field annotation out of the text . this usually processes a document .
