0
xmlファイルから情報を取得しようとしていますが、別のリンクを試しましたが、動作しますが、このurl = "http://www.w3schools.com/xml/simple.xml"それはSAXExceptionの ここではxmlを使用して解析する
public class XMLfunctions {
public Document getDomElement(String xml){
Document doc = null;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder db = dbf.newDocumentBuilder();
InputSource is = new InputSource();
is.setCharacterStream(new StringReader(xml));
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;
}
私のコードです。これは、(SAXExceptionのはe)をキャッチ は誰もが私はこの問題を回避することができますどのように助けることができますキャッチ?