Code example for InputSource

Methods: setCharacterStream, setEncoding

0
        /* Create a new ContentHandler and apply it to the XML-Reader*/  
        TaskXMLHandler mTaskXMLHandler = new TaskXMLHandler(mContext, storyId);
        xr.setContentHandler(mTaskXMLHandler);
         
        /* Parse the xml-data from our URL. */ 
        InputSource inputSource = new InputSource();
        inputSource.setEncoding("UTF-8");
        inputSource.setCharacterStream(new StringReader(taskXmlResponce));
         
        /* Parse the xml-data from our URL. */ 
        xr.parse(inputSource);
        /* Parsing has finished. */ 
	} 
}