用android自帶的sax解析xml: //SAX解析的helper類 public class NotifyParser extends DefaultHandler { } InputStream is = MainActivity.this.getAssets().open(“exam.xml”); NotifyParser parser = new NotifyParser(is); 時拋了異常,原因是 xml文件中的<?xml version="1.0" encoding="utf-8"?>不是位于頂行。因為手賤,在<?xml version="1.0" encoding="utf-8"?>前打多了一個空行,導(dǎo)致了異常
刪了多余的那一行空行,異常解決!! 注意,我在http://m.survivalescaperooms.com.cn/xml/xml_validator.asp上檢查不了錯誤: 
在http://tool.oschina.net/codeformat/xml/上可以檢查多了一個空行!!
新聞熱點
疑難解答
圖片精選