I am facing a problem in SAX parsing when I am trying to parse & char, All the other special chars are parsed automatically in SAX parser,but I am facing problem in & character.. anyone pls suggest me something??
Firstly I am saving my XML coming from webservices into a string and checking it side by side as
if(ques_xml.contains("&"))
{
ques_xml=ques_xml.replaceAll("&", "&");
}
//And the following method I am using to parse my saved XML. public void XmlParsing(String questions_xml) { try {
/** Handling XML */
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
/** Create handler to handle XML Tags ( extends DefaultHandler ) */
MyXmlHandler myXMLHandler = new MyXmlHandler();
xr.setContentHandler(myXMLHandler);
xr.parse( new InputSource(new StringReader(questions_xml)));
} catch (Exception e) {
String err = (e.getMessage()==null)?"XMLParsing exception":e.getMessage();
Log.e("XMLParsing Exception",err);
}
}