private void parseResponse ( InputStream inputStream ) { try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder dBuilder = dbFactory . newDocumentBuilder ( ) ; Document doc = dBuilder . parse ( inputStream ) ; doc . getDocumentElement ( ) . normalize ( ) ; NodeList nodes = doc . getElementsByTagName ( "place" ) ; for ( int i = 0 ; i < nodes . getLength ( ) ; i ++ ) { Node node = nodes . item ( i ) ; if ( node . getNodeType ( ) == Node . ELEMENT_NODE ) { Element element = ( Element ) node ; _woeid = getValue ( "woeid" , element ) ; } } } catch ( Exception ex ) { ex . printStackTrace ( ) ; } }
Extract WOEID after XML loads