android - WARN/ExpatReader(222): DTD handlers aren't supported -


I am using SAXParser to parse the XML data received from the server. I have created the abstract class XmlParser with DefaultHandler. Abstract methods character (), startelement (), endelement (). I have encountered this problem (Warne / Exception Reader (718): DTD handlers are not supported.) My code stops in PArsing. I have mentioned some of the suggested tips to follow the code below. My code
  Public abstract class XmlParser DefaultHandler {public XmlParser (last string xmlData) {parseDocument (xmlData); } @ Override public abstract throws zero characters (four [] f, int start, int length) SAXException; @ Override Public Books throws void endElement (string yuri, string locale, string qName) SAXException; Private zero purse document (final string xmlData) {SAXParserFactory spf = SAXParserFactory.newInstance (); Try {SAXParser sp = spf.newSAXParser (); InputStream = New Bytereinputstream (xmlData.getBytes ("UTF-8")); & Lt; ---- I think I have to change the sp.parse here (is, this); } Hold (SAXException east) {ex.printStackTrace (); } Hold (parser configuration expansion pre) {ex.printStackTrace (); } Hold (IOException pre) {ex.printStackTrace (); }} @ Override throws SAXException public best voice start element (string yuri, string localism, string quen, attribute attributes);   

}

Referred answer

XMLReader xmlReader = SAXParserFactory.newInstance (). NewSAXParser () GetXMLReader (); XmlReader.setContentHandler (// extends yourHandler default handler); XmlReader.parse (new input source (// BufferedReader));

There is a problem for me. I have an abstract class which defaulthandler extends. I can not create an object to pass it in the setContentHandler () method, because I should keep this XMLPrint as an abstract I have to override each module for parser, so I suggest a solution to solve this problem

This is one. It was reported as a fixed in the Faroe (2.2).

Comments