i am able to do xml parsing for valid character but when i pass invalid character from my URL string then there no result found but when i pass that web service url from my browser then result is found.so i think problem in parsing for invalid character for doing sax xml parsing ,so how to overcome from this problem ,means how to deal with invalid character means in url http://www.arteonline.mobi/iphone/output.php?st=&ct=&type=Clínicas%20y%20Talleres&neigh=
for type attribute i pass type=Clínicas where 3rd character is not an English alphabet ,its in Spanish so how to deal with this Spanish
character. my code is below....
@Override
protected Boolean doInBackground(String... args) {
try{
try {
String temp = "http://www.arteonline.mobi/iphone/output.php?st="+filter.stateselected+"&ct="+filter.cityselected+"&type="+filter.typeselected+"&neigh="+filter.neighbourselected+"";
//String temp = "http://www.arteonline.mobi/iphone/output.php?st=&ct=&type=Clínicas%20y%20Talleres&neigh=";
temp = temp.replaceAll(" " ,"%20");
// temp= temp.replaceAll("í" ,"í");
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
Log.i("temp url..",temp.trim().toString());
URL sourceUrl = new URL(temp.trim());
XMLHandlerfiltersearch myXMLHandler = new XMLHandlerfiltersearch();
xr.setContentHandler(myXMLHandler);
xr.parse(new InputSource(sourceUrl.openStream()));
}
catch (Exception e) {
System.out.println("XML Pasing Excpetion = " + e);
}
i replace space in my url if any by using temp = temp.replaceAll(" " ,"%20");
but i could not deal with Spanish character in type attribute in my web service url .pls help.....
also check for type=Galerías when pass from web service url.. in this 6th charaacter is not valid..