xml query..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dattathreya
    New Member
    • Sep 2008
    • 6

    xml query..

    (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() );
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you really should read a tutorial.....

    Comment

    Working...