void (final MultiText mtext, final int offset, final int len) { int ln = len; while (--ln >= 0) { final Content c = get(offset + ln); if (c instanceof Text) { // either Text or CDATA if (!Verifier.isAllXMLWhitespace(c.getValue())) { break; } } else { break; } } if (ln < 0) { // all whitespace. return; } // some non-white, so return all, but merge the sequential Text items. for (int i = 0; i < len; i++) { final Content c = get(offset + i); switch (c.getCType()) { case Text: mtext.appendText(Trim.NONE, c.getValue()); break; case CDATA: mtext.appendCDATA(Trim.NONE, c.getValue()); break; case EntityRef: // treat like any other content. // raw. default: mtext.appendRaw(c); break; } } }