简体   繁体   English

Android 2.3和4.0之间通过PULL解码XML文件有什么区别吗?

[英]Is there any different between Android 2.3 and 4.0 for decode XML file by PULL?

I just found a bug for my APP, which is run normally in Android 4.0 , but will crash in Android 2.3 , I trace it and found the problem is decode XML files 我刚刚发现了我的APP的错误,该错误在Android 4.0中正常运行,但在Android 2.3中崩溃,我对其进行了跟踪,发现问题是解码XML文件

the XML files format is XML文件格式为

<a>
 <b></b>
</a>
<a>
 <b></b>
</a>

it is fine when I use PULL in Android 4.0 ,but in Android 2.3 , I found out that the format has to be : 当我在Android 4.0中使用PULL时很好,但是在Android 2.3中,我发现格式必须为:

*<AAA>
 <a>
   <b></b>
 </a>
 <a>
   <b></b>
 </a>
</AAA>*

it means that the XML must be a tree in Android 2.3 then we could use PULL , otherwise it will crash ? 这意味着XML在Android 2.3中必须是一棵树,那么我们可以使用PULL,否则它将崩溃?

So is there any document from Google to prove that ? 那么Google是否有任何文件可以证明这一点? I'm looking for that . 我在找那个。

Thanks a lot ! 非常感谢 !

I am pretty sure that all properly formed XML documents require a root element ( AAA in your case). 我很确定所有正确形成的XML文档都需要一个根元素(在您的情况下为AAA )。 Obviously, some parsers may have the ability to suppress this error and just read as per normal, such as the parser present in Android 4.0. 显然,某些解析器可能具有抑制此错误的能力,并且只能按常规读取,例如Android 4.0中存在的解析器。 Please see this Wikipedia page with regards to XML root elements. 关于XML根元素,请参阅此Wikipedia页面

EDIT: Google Document 编辑:谷歌文件

Please find the Google document that links directly to an XML specifications sheet (It's the "See Also" document/link). 请找到直接链接到XML规格表的Google文档 (这是“另请参阅”文档/链接)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM