parsing_xml_from_the_net_-_using_the_saxparser-t353.html
For this the class and URL that I'm using is defined as it follows:
Using java Syntax Highlighting
- URL url = new URL("http://testing:8082/firma/FirmaServlet?comando=iniciar_proceso&nombre=nombreDelDocumento&proceso=4&url_entrada=http://prestacionesrh50.safp.cl/garest_web/files/102/xml/ge_resolucion200811.xml&url_salida=http://prestacionesrh50.safp.cl/garest_web/generar_resoluciones/recibe_resolucion_firmada.php?idu=102&aaaamm=200811&url_retorno=http://prestacionesrh50.safp.cl/garest_web/generar_resoluciones/resolucion_firmada.php?idu=102");
- SAXParserFactory spf = SAXParserFactory.newInstance();
- SAXParser sp = spf.newSAXParser();
- /* Get the XMLReader of the SAXParser we created. */
- XMLReader xr = sp.getXMLReader();
- /* Create a new ContentHandler and apply it to the XML-Reader*/
- MyHandler Handler = new MyHandler();
- xr.setContentHandler(Handler);
- /* Parse the xml-data from our URL. */
- InputStream stream_url = url.openStream();
- InputSource source_url = new InputSource (stream_url);
- xr.parse(source_url);
- /* Parsing has finished. */
- /* Our ExampleHandler now provides the parsed data to us. */
- MyParsedDataSet parsedDataSet = Handler.getParsedData();
- /* Set the result to be displayed in our GUI. */
- tv.setText(parsedDataSet.toString());
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
I believe that my problem is that when I use url.openStream() it doesn't open it correctly and I don't know how to fix this. A weird thing is that I noticed is that if I open this url in my computer's browser (firefox) it shows me correctly de xml file, but if I open this link in the emulator's browser it shows a message saying that the web page is not available.
When I run my application the error message that it shows is "Host is unresolved". I hope some one could help me.
Regards,
Helios

