다음과 같이 시도하십시오.
NodeList list = yourNodeList.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
Node node = list.item(i);
if ("result".equals(node.getNodeName()))
{
node.setTextContent("your_value");
}
}
또한 여기를 살펴 보십시오 . 구글은 예제로 가득 차있다. )
-------------------아래 예는 result
태그 에 값을 입력하는 데 도움이됩니다 .
//xmlDoc is Document
result = xmlDoc.createElement("result");
result.appendChild(xmlDoc.createTextNode("<your value here...>"));
command.appendChild(result);
출처
https://stackoverflow.com/questions/22009861