Android 如何解析OPML字符串

Android 如何解析OPML字符串,android,parsing,opml,Android,Parsing,Opml,当我通过HttpPost发布url时,得到了以下字符串作为响应。我的问题是如何解析这个字符串 <?xml version="1.0" encoding="UTF-8"?> <opml version="1"> <head> <status>200</status> </head> <body> <outline type="object" text="acco

当我通过HttpPost发布url时,得到了以下字符串作为响应。我的问题是如何解析这个字符串

<?xml version="1.0" encoding="UTF-8"?>

<opml version="1">

    <head>
    <status>200</status>
        </head>

    <body>

<outline type="object" text="account">

<account>

  <guide_id>u36710162</guide_id>

  <username>xyz</username>

  <session_id>9d28d854-bd31-4bba-9a5f-4e5cd88edaac</session_id>

  <first_name />

  <last_name />

  <email>xyz@gmail.com</email>

</account>

</outline>

    </body>

</opml>

200
u36710162
xyz
9d28d854-bd31-4bba-9a5f-4e5cd88edaac
xyz@gmail.com
如何从该字符串获取状态、指南id、用户名、会话id、名字、姓氏和电子邮件


提前感谢

这是一个XML格式的响应。您可以通过解析它

关于
status
,您可以从HTTP本身获取它

HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(httpRequest);
response.getStatusLine().getStatusCode()

注:考虑<代码> <代码>作为您的父标签。< /p>您可以给出任何示例代码吗?!!!!我想被解析的状态也一样,bcz通过这个我会得到的想法是正确的或不正确的反应。。。!!!谢谢。现在我已经做到了。但是你发布的代码我已经完成了。但是给定的链接非常有用。