android : sax Xml parsing
Team,
I am facing some issue at the time of parsing the XML, but the same works in Java program... When I run the same code through android prgming its failing to parse...
InputStream byteArrayInputStream = new ByteArrayInputStream(
response.toString().getBytes());
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
parser.parse(byteArrayInputStr开发者_运维百科eam, xmlHandler);
Facing the following error
DTD handlers aren't supported
Any help is greatly appreciated.
Thanks, Ramesh
There's a bug for that: http://code.google.com/p/android/issues/detail?id=4286
What works:
XMLReader xmlReader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
xmlReader.setContentHandler(//YourHandler extends DefaultHandler);
xmlReader.parse(new InputSource(//BufferedReader));
精彩评论