Android XML Parse parseResponse(HttpResponse response)

Here you can find the source of parseResponse(HttpResponse response)

Description

parse Response

License

Open Source License

Declaration

public static Document parseResponse(HttpResponse response)
            throws IOException, ParserConfigurationException, SAXException 

Method Source Code

//package com.java2s;
//License from project: MIT License 

import java.io.IOException;
import java.io.InputStream;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.http.HttpResponse;

import org.w3c.dom.Document;

import org.xml.sax.SAXException;

public class Main {
    public static Document parseResponse(HttpResponse response)
            throws IOException, ParserConfigurationException, SAXException {
        InputStream responseStream = response.getEntity().getContent();
        DocumentBuilder xmlBuilder = DocumentBuilderFactory.newInstance()
                .newDocumentBuilder();//  w  w w.  j  a  v  a  2s  .  co m
        return xmlBuilder.parse(responseStream);
    }
}

Related

  1. parse(File source)
  2. parse(String source)
  3. parse(String xml)
  4. parse(String xmlstr, Class clazz, List fields, List elements, String itemElement)
  5. parseTagValue(String xml, String tag, String endTag)
  6. ReadCityCode(Context context, String cityname)
  7. XMLfromString(String xml)