Esempio n. 1
0
 /** 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();
 }
Esempio n. 2
0
 protected void assertTokenType(int expType, XMLStreamReader sr) throws XMLStreamException {
   assertTokenType(expType, sr.getEventType());
 }