public static String getAttribute ( XMLStreamReader reader , String localName ) { int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { String name = reader . getAttributeLocalName ( i ) ; if ( localName . equals ( name ) ) { return reader . getAttributeValue ( i ) ; } } return null ; }
Get the element attribute value