Code example for StringReader

Methods: close

	// Get results in the form of a DOM to be parsed 
	public static Document getDOMbody(String response) {
		Document doc = null;
		try { 
			StringReader reader = new StringReader (response);
			InputSource inputSource = new InputSource( reader );
			DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
		    DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
		    doc = dBuilder.parse(inputSource);
		} catch (Exception e) {
			Log.v("PARSE ERROR", e.getMessage());
		return doc;
	// Parse the HTTP response 
	public static String parseHttpResponse(HttpResponse response) {
Stop searching for code, let great code find you!  Add Codota to your java IDE