String chars = new String( ch, start, length ).trim(); if( chars.length() == 0 )
boolean lastIsWS = currentText == null || currentText.text.endsWith(" "); StringBuffer sb = new StringBuffer(); for( int i=start;i<start+length;i++) { if( Character.isWhitespace(ch[i]) ){ if( lastIsWS ) continue; sb.append(" "); lastIsWS = true; } else { sb.append(ch[i]); lastIsWS = false; } } String chars = sb.toString();  if( chars.trim().length() == 0 )
     public void characters (char ch[], int start, int length)     {        String chars = new String( ch, start, length ).trim();        if( chars.length() == 0 )          return;        if( currentText != null )          currentText.text += chars;        else {          currentText = new TextNode( chars );          currentNode.addChild( currentText );        }/*         System.out.print("Characters:    \"");         for (int i = start; i < start + length; i++) {             switch (ch[i]) {             case '\\':                 System.out.print("\\\\");                 break;             case '"':                 System.out.print("\\\"");                 break;             case '\n':                 System.out.print("\\n");                 break;             case '\r':                 System.out.print("\\r");                 break;             case '\t':                 System.out.print("\\t");                 break;             default:                 System.out.print(ch[i]);                 break;             }         }         System.out.print("\"\n"); */     }