public static boolean advanceReaderToNext ( XMLStreamReader xsr , String tag ) throws javax . xml . stream . XMLStreamException { if ( tag == null ) { throw new IllegalArgumentException ( "Tag name can't be null" ) ; } if ( xsr == null ) { throw new IllegalArgumentException ( "Stream Reader can't be null" ) ; } do { if ( xsr . next ( ) == javax . xml . stream . XMLStreamConstants . END_DOCUMENT ) { return false ; } } while ( ! ( xsr . isStartElement ( ) && xsr . getLocalName ( ) . equals ( tag ) ) ) ; return true ; }
Advances the Stream Reader to the next occurrence of a user - specified tag .