2

我从服务器 api 得到一个 xml 响应。而解析 xml .im 得到一个空指针异常。下面是 xml 响应和代码。im 能够获取单个节点列表但得到一个异常“kd.in setHighscore()”

//xml 响应

<int xmlns="http://schemas.microsoft.com/2003/10/Serialization/">700</int>

Document doc = getDomElement(responseXML);
    NodeList nl = doc.getElementsByTagName("int");
    Log.v("node","no of nodes present"+nl.getLength());
     HighestScore kd = new  HighestScore();
      try
        {
      kd.setHighScore( ((Node) nl.item(0)).getNodeValue());  

        }
        catch(Exception e)
        {
             Log.e("MYAPP", "exception", e);
        }
      return kd;
4

0 回答 0