fffy2366 / android-query

Automatically exported from code.google.com/p/android-query
0 stars 0 forks source link

In android4.0 use XmlDom parse xml error #56

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
i parse xml of 1.xml

but when i use xmlDom.tag("root");exception happen

android version is 4.0.4

please help me, thanks.

exception like this:

06-18 15:49:44.299: W/System.err(7135): org.xml.sax.SAXParseException: 
Unexpected token (position:TEXT E0B8F8680F0EFA5B...@1:2049 in 
java.io.InputStreamReader@416e4b70) 
06-18 15:49:44.299: W/System.err(7135):     at 
org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.jav
a:146)
06-18 15:49:44.299: W/System.err(7135):     at 
javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107)
06-18 15:49:44.299: W/System.err(7135):     at 
com.androidquery.util.XmlDom.<init>(XmlDom.java:113)
06-18 15:49:44.299: W/System.err(7135):     at 
com.androidquery.util.XmlDom.<init>(XmlDom.java:96)
06-18 15:49:44.299: W/System.err(7135):     at 
com.androidquery.util.XmlDom.<init>(XmlDom.java:85)
06-18 15:49:44.299: W/System.err(7135):     at 
com.huawei.basic.android.zone.component.net.http.HttpManager.parserXmlResult(Htt
pManager.java:267)
06-18 15:49:44.299: W/System.err(7135):     at 
com.huawei.basic.android.zone.component.net.http.HttpManager.parserResult(HttpMa
nager.java:220)
06-18 15:49:44.299: W/System.err(7135):     at 
com.huawei.basic.android.zone.component.net.http.HttpManager$1.run(HttpManager.j
ava:93)
06-18 15:49:44.299: W/System.err(7135):     at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-18 15:49:44.299: W/System.err(7135):     at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-18 15:49:44.299: W/System.err(7135):     at 
java.lang.Thread.run(Thread.java:856)

Original issue reported on code.google.com by zhouyuju...@gmail.com on 18 Jun 2012 at 7:50

Attachments:

GoogleCodeExporter commented 8 years ago
        File file = new File(Environment.getExternalStorageDirectory(),
                "1.xml");          

      FileInputStream fileInputStream = new FileInputStream(file);

            XmlDom xmlDome = new XmlDom(fileInputStream);

            xmlDome.tag("root");

like this: xmlDome.tag("root")return null;

Original comment by zhouyuju...@gmail.com on 18 Jun 2012 at 8:04

GoogleCodeExporter commented 8 years ago
but in android 2.2, run right, can parse right

Original comment by zhouyuju...@gmail.com on 18 Jun 2012 at 8:05

GoogleCodeExporter commented 8 years ago

Original comment by tinyeeliu@gmail.com on 13 Jul 2012 at 7:43