Hi,

The following code generates the SAXParseException exception  
"InputSource needs either stream or reader".

try
{
    DocumentBuilderFactory factory =  
DocumentBuilderFactory.newInstance();

    DocumentBuilder parser = factory.newDocumentBuilder();
    Document document = parser.parse(fileName);
}
catch(IOException e)
{}
catch(SAXException e)
{
    System.err.printf(e.toString());
}
catch(ParserConfigurationException e)
{}

The exception is thrown when "Document document =  
parser.parse(fileName)" is invoked. The same code executes  
successfully on my Windows XP machine.

I believe the exception is thrown because the parser can't find the  
file... However, "filename" points to an xml file located in  
<app_data>/files/. I have also tried to put the file directly in the / 
sdcard/ folder but I get the same exception.

Is there a specific folder to be used by the XML parsers? How to  
direct the parser to <app_data>/files?

Thanks,
Jean


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to