が、私はコードの次の簡単な部分を持って動作しません:getElementsByTagNameのは
String test = "<?xml version="1.0" encoding="UTF-8"?><TT_NET_Result><GUID>9145b1d3-4aa3-4797-b65f-9f5e00be1a30</GUID></TT_NET_Result>"
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
Document doc = dbf.newDocumentBuilder().parse(new InputSource(new StringReader(test)));
NodeList nl = doc.getDocumentElement().getElementsByTagName("TT_NET_Result");
問題は、私はどんな結果を得ることはありませんということです - ノードリストの変数を「NL」は空です。 何が間違っている可能性がありますか?
ただ問題を解決しました! – kaps
ありがとうございます。私はtotaly見落とされたドキュメント要素。 – torosg
これは私を助けた。ありがとう。 – Alessandro