J
john smith
1.) System.out.println("Add this node" + node.getNodeName());
// prints DisplayElement
2.) Node theParentNode = node.getParentNode();
3.) System.out.println(theParentNode);
// prints [Trim: null]
4.) System.out.println("the parent node is " +
theParentNode.getNodeValue()); // prints null
I am having trouble understanding why when the last line prints which I am
thinking should be the parent node is always NULL.
The parent should be "Trim"
Can anyone shed some light on this. This seems pretty straight forward, but
I am confused.
All I am doing is getting the parent node of the DisplayElement node, and it
is always null.
Thanks in advance for any help.
// prints DisplayElement
2.) Node theParentNode = node.getParentNode();
3.) System.out.println(theParentNode);
// prints [Trim: null]
4.) System.out.println("the parent node is " +
theParentNode.getNodeValue()); // prints null
I am having trouble understanding why when the last line prints which I am
thinking should be the parent node is always NULL.
The parent should be "Trim"
Can anyone shed some light on this. This seems pretty straight forward, but
I am confused.
All I am doing is getting the parent node of the DisplayElement node, and it
is always null.
Thanks in advance for any help.