I'm trying to use the setTextContent
method in the piece of code below and I'm getting this compilation error in Eclipse:
The method
setTextContent(String)
is undefined for the typeElement
But once I changed the order of buildpath, I was able to compile this code without errors.
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Element element = (Element) list.item(i);
Node node = list.item(i);
if ("Date ".equals(node.getNodeName())) {
element.setTextContent("");
}
Is there any alternate way rather than changing the build path?