documentBuilder.parse下的Andr​​oid 4.0.3失败 [英] documentBuilder.parse fails under android 4.0.3

查看:89
本文介绍了documentBuilder.parse下的Andr​​oid 4.0.3失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序,documentBuilder.parse(InputStream的)引发以下错误
在Android的4.0.3。

I my application, documentBuilder.parse(inputStream) throws the following error in Android 4.0.3.

"SAXException : Unexpected token (position:TEXT ?xml version='1....@1:38 in java.io.InputStreamReader@419ae708)"

同样的code是工作在所有旧版本的Andr​​oid。

The same code is working in all the older versions of android.

以下是我的InputStream的初始部分。

following is the initial parts of my inputstream.

?xml version='1.0' encoding='UTF-8'?> 

任何解决方案?

推荐答案

最初的小于号缺失。显然,旧版本的Andr​​oid允许这种不正确的XML。

The initial less-than sign is missing. Apparently older versions of android allowed this incorrect XML.

这篇关于documentBuilder.parse下的Andr​​oid 4.0.3失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆