public void readWriteElement ( String tagName ) throws WLFormatException { try { while ( xmlEventReader . hasNext ( ) ) { XMLEvent event = xmlEventReader . nextEvent ( ) ; switch ( event . getEventType ( ) ) { case XMLStreamConstants . END_ELEMENT : add ( event ) ; if ( event . asEndElement ( ) . getName ( ) . getLocalPart ( ) . equals ( tagName ) ) { return ; } break ; default : add ( event ) ; break ; } } } catch ( XMLStreamException e ) { throw new WLFormatException ( e . getMessage ( ) , e ) ; } catch ( NoSuchElementException e ) { throw new WLFormatException ( e . getMessage ( ) , e ) ; } }
postcondition read pointer is just after the end of the tag with the local name tagName