遍历XML数的问题

有如下XML数据:

1<root>
2<data>
3<result></result>
4<result>   
5hhh   
6</result>
7</data>
8</root>

请问使用JDOM怎么能取到第二个Result的值???
---------------------------------------------------------------

try something like

Element root = doc.getRootElement();
java.util.List l = root.getChild("data").getChildren("result");
Element e = (Element)l.get(1);
e.getText();

Published At
Categories with Web编程
Tagged with
comments powered by Disqus