(Q) <x>
<a/><b/><c/>
</x>
Referring to the sample XML data above, if b is the DOM node for <b/>, how do you use it to remove element <a/>?
org.w3c.dom.Nod e x = b.getParentNode ();
x.removeChild(b .getPreviousSib ling());
b) org.w3c.dom.Nod e rootnode = b.getOwnerDocum ent();
rootnode.remove Child(b.getPrev iousSibling());
c) org.w3c.dom.Nod e x = b.getParentNode ();
x.removeChild(x .getFirstChild( ));
d) org.w3c.dom.Nod e a = b.getPreviousSi bling();
a.removeNode();
org.w3c.dom.Nod e x = b.getParentNode ();
x.removeNode(x. getFirstChild() );
<a/><b/><c/>
</x>
Referring to the sample XML data above, if b is the DOM node for <b/>, how do you use it to remove element <a/>?
org.w3c.dom.Nod e x = b.getParentNode ();
x.removeChild(b .getPreviousSib ling());
b) org.w3c.dom.Nod e rootnode = b.getOwnerDocum ent();
rootnode.remove Child(b.getPrev iousSibling());
c) org.w3c.dom.Nod e x = b.getParentNode ();
x.removeChild(x .getFirstChild( ));
d) org.w3c.dom.Nod e a = b.getPreviousSi bling();
a.removeNode();
org.w3c.dom.Nod e x = b.getParentNode ();
x.removeNode(x. getFirstChild() );
Comment