Code example for XMLReader

Methods: parsesetContentHandler

0
 
        try { 
	        SAXParserFactory spf = SAXParserFactory.newInstance();
	        SAXParser sp = spf.newSAXParser();
	        XMLReader xr = sp.getXMLReader();
	        xr.setContentHandler(this);
	        xr.parse(inputSource);
	    } catch (IOException e) {
	        Log.e(TAG, e.toString());
	    } catch (SAXException e) {
	        Log.e(TAG, e.toString());
	    } catch (ParserConfigurationException e) {
	        Log.e(TAG, e.toString());
	    } 
 
		return getContent(); 
	} 
	 
    public void characters(char ch[], int start, int length) {
    	stringBuilder.append(ch, start, length);
Stop searching for code, let great code find you!  Add Codota to your java IDE