sauravtom / 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 #49

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1.Use method xmlDom.tag("result","resultCode",null)

What is the expected output? What do you see instead?

NullPointException

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

GoogleCodeExporter commented 8 years ago
Please provide the xml content or url to that xml file.

Original comment by tinyeeliu@gmail.com on 16 May 2012 at 4:50

GoogleCodeExporter commented 8 years ago
I want to get resultCode attribute, but in android 4.0 platform parse error, 
attach

is xml file.

Original comment by zhouyuju...@gmail.com on 16 May 2012 at 1:18

Attachments:

GoogleCodeExporter commented 8 years ago
this is xml file:

<?xml version="1.0" encoding="UTF-8"?>
<result resultCode="0">
<usr>
<userIDaccount>98761245</userIDaccount>
<userName>xxx</userName>
<mobile>8613892435686</mobile>
<email>xiaowei@126.com</email>
<usrDesc></usrDesc>
<gender>1</gender>
<birthday></birthday>
<signature></signature>
</usr>
</result>

Original comment by zhouyuju...@gmail.com on 16 May 2012 at 1:20

GoogleCodeExporter commented 8 years ago
"result" is already the root, so you don't need to do .tag() to get the node. 
Just call .attr for the value.

I tried this with the xml and it works:

String code1 = xml.attr("resultCode");

Original comment by tinyeeliu@gmail.com on 16 May 2012 at 1:39

GoogleCodeExporter commented 8 years ago

Original comment by tinyeeliu@gmail.com on 29 Jul 2012 at 4:37