Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The SAXParser object can take in an input stream and the handler. So something like:</p> <pre><code>SAXParser saxParser = factory.newSAXParser(); XMLParser parser = new XMLParser(); saxParser.parse(httpEntity.getContent(),parser); </code></pre> <p>The getContent() method returns and input stream from the HttpRequest, and the XMLParser object is just a class I created (supposedly) that contains the definition of how to parse the XML.</p> <p><strong>EDIT*</strong> You really should read the entire API for SAXParser, it has several overloaded methods:</p> <blockquote> <p>void parse(InputSource is, DefaultHandler dh) Parse the content given InputSource as XML using the specified DefaultHandler.</p> <p>void parse(InputSource is, HandlerBase hb) Parse the content given InputSource as XML using the specified HandlerBase.</p> <p>void <strong>parse(InputStream is, DefaultHandler dh)</strong> Parse the content of the given InputStream instance as XML using the specified DefaultHandler.</p> <p>void <strong>parse(InputStream is, DefaultHandler dh, String systemId)</strong> Parse the content of the given InputStream instance as XML using the specified DefaultHandler.</p> <p>void <strong>parse(InputStream is, HandlerBase hb)</strong> Parse the content of the given InputStream instance as XML using the specified HandlerBase.</p> <p>void <strong>parse(InputStream is, HandlerBase hb, String systemId)</strong> Parse the content of the given InputStream instance as XML using the specified HandlerBase.</p> </blockquote> <p>Some of the methods take an InputSource, some take an InputStream, as I stated earlier.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload