title: How to convert InputStream to InputSource?
body: <p>ALL,</p>
  
  <p>I wrote a simple SAX XML parser. It works and I was testing it with local XML file. Here is my code:</p>
  
  <pre><code>SAXParserFactory spf = SAXParserFactory.newInstance();
  XMLParser xmlparser = null;
  try
  {
      SAXParser parser = spf.newSAXParser();
      XMLReader reader = parser.getXMLReader();
      xmlparser = new XMLParser();
      reader.setContentHandler( xmlparser );
      reader.parse( new InputSource( getResources().openRawResource( R.raw.categories ) ) );
  </code></pre>
  
  <p>Now I need to read this XML file from the website. The code I'm trying is:</p>
  
  <pre><code>public InputStream getXMLFile()
  {
      URL url = new URL("http://example.com/test.php?param=0");
      InputStream stream = url.openStream();
      Document doc = docBuilder.parse(stream);
  }
  reader.parse( new Communicator().getXMLFile() );
  </code></pre>
  
  <p>I'm getting compiler error</p>
  
  <p>"The method parse(InputSource) is not applicable for the argument (InputStream)".</p>
  
  <p>I need help figuring out what do I need.</p>
  
  <p>Thank you.</p>