Error in forming DOM Element

maya_zoom

New Member
I am trying to get the DOM element from a UTF-8 Encoded XML parsed file containing arabic characters. the below method take the parsed xml string and is supposed to return the Document.here is a link to the xml\[code\]http://212.12.165.44:7201/UniNews121.xml public Document getDomElement(String xml){ Document doc = null; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { DocumentBuilder db = dbf.newDocumentBuilder(); InputSource is = new InputSource(); StringReader xmlstring=new StringReader(xml); is.setCharacterStream(xmlstring); is.setEncoding("UTF-8"); //APP CRASHES HERE doc = db.parse(is); } catch (ParserConfigurationException e) { Log.e("Error: ", e.getMessage()); return null; } catch (SAXException e) { Log.e("Error: ", e.getMessage()); return null; } catch (IOException e) { Log.e("Error: ", e.getMessage()); return null; } // return DOM return doc;}\[/code\]
 
Back
Top