我有以下代码
protected static final String TAG_numFound = "numFound"; //
Document street_xmlDoc = GetXMLDocument(street_url);
Element results = street_xmlDoc.getDocumentElement();
//numFound
Node numFoundNode = results.getElementsByTagName(TAG_numFound).item(0);
String numFound = numFoundNode.getNodeValue() + "(" + numFoundNode.getNodeName() + ")";
和以下 XML
<results>
<numFound>1</numFound>
<QTime>66</QTime>
<result>
<distance>0.0</distance>
<name>Agua</name>
</result>
</results>
在 numFound String 变量中,我得到“null(numFound)”,我不明白为什么我没有得到“1(numFound)”。我做错了什么?