/** Note: calling this method will move stream to the next non-textual event. */ protected String collectAllText(XMLStreamReader sr) throws XMLStreamException { StringBuilder sb = new StringBuilder(100); while (true) { int type = sr.getEventType(); if (type == CHARACTERS || type == SPACE || type == CDATA) { sb.append(sr.getText()); sr.next(); } else { break; } } return sb.toString(); }
/** @see IBailsStream#getCharSequence() */ @Override public CharSequence getCharSequence() { // This should contain the tags char sequence along with any surrounding whitespace. return currentEventString.toString(); }