【发布时间】:2012-05-19 08:04:14
【问题描述】:
我得到了 http 请求的 xml 响应。我将其存储为字符串变量
String str = in.readLine();
而str的内容是:
<response>
<lastUpdate>2012-04-26 21:29:18</lastUpdate>
<state>tx</state>
<population>
<li>
<timeWindow>DAYS7</timeWindow>
<confidenceInterval>
<high>15</high>
<low>0</low>
</confidenceInterval>
<size>0</size>
</li>
</population>
</response>
我想将tx、DAYS7 分配给变量。我该怎么做?
谢谢
【问题讨论】:
-
如果您还告诉我们您正在使用哪种编程语言,我们会更容易为您提供帮助。
-
您好,对不起,我使用的是 java
-
Xpath 是一种完成它的方法