Delete a node

Ok, so like I have a linkedlist that I wrote the code for (instead of using java's linkedList class) and now I am trying to write a method that will delete a node in the list. I can delete the head node, no problem, and, until I started screwing around with it in an attempt to delete the last node, I could delete anything in the middle. Now, I can't delete anything but the head node and, if I put it back the way it was before, I get null pointer errors as it gets to the end for the deletion...
My books suck for this and I am at the end of my rope, can someone please nudge me down the right path?
Here is the main -
import java.io.*;
import java.util.*;
import javax.swing.JOptionPane;
public class neverish2Dictionary
static neverishDictionary nd = new neverishDictionary();
static java.util.Vector vlist = new java.util.Vector();
  public static void main (String args[])
     nd.addList("word", "pos", "def", "date", "org");
     nd.addList("aword", "sfgpos", "sfgdef", "dasfgte", "sfgrg");
     nd.addList("bword", "posd", "ddef", "ddate", "odrg");
     nd.addList("cword", "pwos", "dwef", "dwate", "owrg");
     nd.addList("dword", "poss", "defs", "dates", "orsg");
     System.out.println("List:");
     nd.displayAll();
     nd.deleteIt("dword");
     nd.deleteIt("word");
     System.out.println("List with deletions:");
     nd.displayAll();
}Here is the driver -
import java.util.Vector;
public class neverishDictionary
    private Node head;
    public neverishDictionary()
         head = null;
    //begin inner node class
    private class Node
         private String word, pos, def, date, org;
         private Node next;
         public Node(String word1, String pos1, String def1, String date1, String org1)
         //1st constructor
            word = word1;
            pos = pos1;
            def = def1;
            date = date1;
            org = org1;
            next = null;
        public Node(String word1, String pos1, String def1, String date1, String org1, Node nextNode)
        //2nd constructor
            word = word1;
            pos = pos1;
            def = def1;
            date = date1;
            org = org1;
            next = nextNode;
        public String getWord()
            return word;
        public String getPos()
            return pos;
        public String getDef()
            return def;
        public String getDate()
            return date;
        public String getOrg()
            return org;
        public void setNext(Node nextNode)
            next = nextNode;
        public Node getNext()
            return next;
   }//ends the inner class
   public boolean isEmpty()
        return head == null;
   public void addList(String newWord, String newPos, String newDef, String newDate, String newOrg)
        Node curr;
        Node prev;
        Node newNode = new Node (newWord, newPos, newDef, newDate, newOrg);
        if(isEmpty())
            newNode.setNext(head);
            head=newNode;
        else
            newNode.setNext(head);
            head=newNode;
   public void deleteIt(String temp)
        Node prev = head;
        Node curr = head;
        int x = 0;
        while (curr.getNext() != null)
        if (curr.getWord().equals(temp) && curr == head)
                  String resultWord = curr.getWord();
                  String resultPos = curr.getPos();
                  String resultDef = curr.getDef();
                  String resultDate = curr.getDate();
                  String resultOrg = curr.getOrg();
                  head = curr.getNext();
                  //newNode.setNext(head);
                 //head=newNode;
          else
                prev = prev.getNext();  //advance prev and curr 1 node each
                curr = curr.getNext();
           //check for current word
              if(curr.getWord().equals(temp))
            String resultWord = curr.getWord();
                  String resultPos = curr.getPos();
                  String resultDef = curr.getDef();
                  String resultDate = curr.getDate();
                  String resultOrg = curr.getOrg();
                  prev = curr.getNext();
                  curr.setNext(prev);               
             //     prev = prev.getNext();  //advance prev and curr 1 node each
          //      curr = curr.getNext();
     //       if (curr.getWord().equals(temp) && curr.getNext() == null)//this is the end of the list
           //     prev = prev.getNext();  //advance prev and curr 1 node each
          //     curr = curr.getNext();
          //     prev = curr;
          //     prev.setNext(null);
               //curr.setNext(null);
           //     break;
    //if the node you want to remove is the head, do this
      public void displayAll()
      //radixSort(vlist);
        Node prev = head;
       Node curr = head;
       String temp = " ";
       String nextWord = curr.getWord();
       do
                    temp = nextWord.substring(0,1);    //pulls the first letter of the string
                    String chapterHead = temp.toUpperCase(); //uppercases it
               System.out.println("\nChapter " + chapterHead);
                    while(nextWord.startsWith(temp)) //if the string starts with the substring
                 System.out.println(curr.getWord() + " (" + curr.getPos() + ") ");
                 System.out.println(curr.getDef() + " " + curr.getDate() + " " + curr.getOrg() + ".);
                         //print the string
                         prev = curr;
                         curr = curr.getNext();
                            nextWord =  curr.getWord();
               while (curr.getNext() != null);
  }P.S. This is not part of an assignment, this is me taking an assignment about twenty steps further (and harder) than what it was originally.

> else if tail {
do special talk handling for delete
} Oh man, that wine was certainly blurring your living braincells ;-) otherwise you wouldn't have said this.
(did I ever mention medicinal Cognac for alternatives? ;-)
Let Node be something like this -- class Node {
   private Node next; // next element from the list
   public boolean match(Node that) {
      if (that == null) return false;
      // otherwise, check whether or not this matches that.
   // other important stuff here
} Let there be some accessible variable head somewhere, pointing to the head of the list.
The following method, implemented in class Node itself does the job -- public boolean remove() {
   Node p= head;
   if (match(p))
      head= next;
   else
      for (Node p= head; p != null; p= p.next)
         if (match(p.next)) {
            p.next= next;
            break;        
   return p != null;
} kind regards (and did I ever mention that medicinal Cognac before?)
Jos

Similar Messages

  • How to Delete the node from cluster when the machine crashed?

    In an three nodes Rac of 11g r2,How to delete the node from cluster when the machine crashed?
    There is now way to repair the machine and have to add a new one.
    What is step to follow up?

    hi
    IF YOU WANT TO DELETE RAC1 NODE
    check $./olsnodes
    1) delete the instance using dbca from any active nodes
    crs_stat -t
    srvctl stop asm -n rac1
    2) delete listener
    3) delete oracle_home from oracle user
    $ORACLE_HOME/bin/runInstaller -updatenodelist ORACLE_HOME=<db_home> "CLUSTER_NODES={RAC1}
    4)delete asm home
    $ORACLE_HOME/bin/runInstaller -updatenodelist ORACLE_HOME=<asm_home> "CLUSTER_NODES={RAC1}
    5) update cluster node
    $ORACLE_HOME/bin/runInstaller -updatenodelist ORACLE_HOME=<db_home> "CLUSTER_NODES={active nodes like rac2,rac3}
    6) update ASm home
    $ORACLE_HOME/bin/runInstaller -updatenodelist ORACLE_HOME=<asm_home> "CLUSTER_NODES={active nodes like rac2,rac3}
    cd $ORA_CRS_HOME
    cd crs/opmn/conf
    check for
    $cat ons.config
    remoteport=6200
    cd crs_home/bin
    $./racgons remove_config rac1:6200
    $ go to crs home
    and $ORA_CRS_HOME/crs/install/rootdelete.sh
    $ORA_CRS_HOME/crs/install/rootdeletenode.sh
    check for ./olsnodes

  • How would I delete multiple nodes at a time in OSB

    I want to delete multiple nodes in OSB at a time. I have a request and that needs to get rid of the Nodes instead of using multiple delete actions I want to achieve in one shot. Any suggestions

    Hi,
    You should be able to delete all nodes selected by an XPath expression... Have a look at this...
    http://docs.oracle.com/cd/E28280_01/dev.1111/e15866/ui_ref.htm#i1290003
    Cheers,
    Vlad

  • Delete parent node based on its child node value in XML

    I have an xml like this:
    <UPLOAD_REQUEST>
         <CUSTOMER_DETAIL>
         <NAME>Smith</NAME>
         <AGE>20</AGE>
         <GENDER>M</GENDER>
         </CUSTOMER_DETAIL>
         <CUSTOMER_DETAIL>
         <NAME>Nikita</NAME>
         <AGE>35</AGE>
         <GENDER>F</GENDER>
         </CUSTOMER_DETAIL>
    </UPLOAD_REQUEST>
    I want to delete CUSTOMER_DETAIL node where name = 'nikita' from xml. Also note that there is no identification number for CUSTOMER_DETAIL node.
    I was trying to do it like this:
    UPDATE request_xml
    SET request= deleteXML(request, '/UPLOAD_REQUEST/CUSTOMER_DETAIL')
    WHERE extractvalue(request, '/UPLOAD_REQUEST/CUSTOMER_DETAIL/NAME') = 'Nikita';
    It gives error "*EXTRACTVALUE returns value of only one node*"
    Final output should be
    <UPLOAD_REQUEST>
         <CUSTOMER_DETAIL>
         <NAME>Smith</NAME>
         <AGE>20</AGE>
         <GENDER>M</GENDER>
         </CUSTOMER_DETAIL>
    </UPLOAD_REQUEST>
    Can anyone please help me how to do this?
    Edited by: user10446917 on May 6, 2011 3:38 AM

    Add a predicate in the XPath expression :
    UPDATE request_xml
    SET request = deleteXML(request, '/UPLOAD_REQUEST/CUSTOMER_DETAIL[NAME="Nikita"]')
    ;

  • How to delete a node based on some attribute value

    Hi,
    I want to delete one node from xml file.
    My XML file is given below::::
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <config>
    <employeeDetails>
    <employee id = "1" name = "aa" salary = "1000" />
    <employee id = "2" name = "bb" salary = "2000" />
    <employee id = "3" name = "cc" salary = "3000" />
    <employee id = "4" name = "dd" salary = "4000" />
    </employeeDetails>
    </config>
    Lets say i want to delete the row whose id = "2" means whole employee node of id 2, but i don't know how to delete?
    Please somebody help me its very very urgent.

    madforjava wrote:
    Please somebody help me its very very urgent.Is someone going to die if you don't get answered within a couple of minutes?

  • Delete tree nodes from Table

    I have created a tree table
    create table subforums (
    id          NUMBER(5) primary key,
    parent_id     references subforums,
    name          varchar2(100)
    And now i dont know how to delete a tree with a specified id and all of his children.
    I tried to find out but i couldnt

    Hi,
    When you delete a node and all of its children, what do you want to do with the grandchildren? If you want to set their parent_id to NULL, do that in a separate UPDATE statement first, then DELETE the original node and all its remaining descendants, as show below.
    If, when you say "children", you mean "descendants" (including
    children,
    children of children,
    children of children of children,
    and so on, to any level,
    ) then do a CONNECT BY query to find their primary keys, and DELETE everything in that list, like this:
    DELETE  subforms
    WHERE   id  IN
            SELECT  id
            FROM    subforms
            START WITH        id = :specified_id
            CONNECT BY  PRIOR id = parent_id
            );

  • Delete context node

    Hi all,
    how can I delete a dynamically created context node by runtime?
    I want to delete the node completly not just invalidate its elements list. Moreover I want to delete a certain node so the method reset() for the context is not useful here.
    Thanks in advance for all answers,
    Regards,
    Torben

    Hi Val,
    Thanks for the update.
    Regarding the reset method: I am trying to use the reset() method before I am recreating my dynamic context but I when I recreate my dynamic context I receive an error: "Cannot add element with duplicate ID "addText0" as if it still exists. Any idea why it's not being destryoed?
    Message was edited by:
            Roy Cohen

  • Deletion of node in Tree

    I have to delete all selected node in JTree. any idea.

    ..if root is also selected with child and only child should get deleted..For each delete-candidate node x you could check if there is a delete-candidate node y
    (other than x) that has node x in its PathToRoot-array ( DefaultTreeModel#getPathToRoot(y) ).
    If yes, simply set the path of x to null, so you can skip the nulls later on.
    Message was edited by:
    Andre_Uhres
    Message was edited by:
    Andre_Uhres

  • How to delete SMTP node in scot

    Dear friends,
    In my Prd system when i ma trying to create SMTP thne message come as Node SMTP is already exist. How can i create new node by name of SMTP. or how can i delete SMTP node is any background job for same?
    But when i am trying by using another name as smtps then it is proceed but i am not undersand how can i do it.
    and also is scot is client dependent or independent.
    Thanks,
    Regards,
    Sachin Jadhav

    Hi Sachin,
    The SMTP node which you see in SCOT comes with SAPconnect only.
    You can not delete it. Nor you can add any more.
    Refer below link.
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/b0/f8ef3aabdfb20de10000000a11402f/frameset.htm">SMTP node</a>
    But I don't understand why do you want to delete it.
    --Shamish
    Message was edited by:
            Shamish Lele

  • Accidentally deleted smtp node in scot

    i accidentally deleted stmp node in scot and having no idea how to put it back? i tried creating a new node but the node is already exist. is there anyway to put back the node?

    HI,
    There is always one SMTP node in each client. This node is created by the SAP system and cannot be deleted. Try to view in T-code: SCON /  SCOT> View> system status ( Press F5)  or Node  (Press F7).
    For info check http://help.sap.com/saphelp_470/helpdata/en/af/73563c1e734f0fe10000000a114084/content.htm
    Regards,
    Phani

  • Delete a node containing a child node with specific value

    Hello,
    I wanted to know how to delete a node which contains specific value in one of its child node.
    Here is the xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <rows>
         <ROW>
              <part_num_ref ID="100124">1</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">2</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">3</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">4</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">5</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">6</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">7</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">8</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">9</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">10</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">11</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">12</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">13</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">14</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">15</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">16</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">17</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
    </rows>
    I would like to delete one of the node <ROW> which contains the value 1 for the child node <part_num_ref >
    Is it possible?
    Thanks in advance for your answers.
    Regards,
    Stessy Delcroix

    The following is a possibility on database version 10.2.x (what database version are you using?):
    Example from XMLDB Developers Guide 10.2
    Example 4-26 Deleting LineItem Element Number 222
    SELECT extract(OBJECT_VALUE,
                   '/PurchaseOrder/LineItems/LineItem[@ItemNumber="222"]')
      FROM purchaseorder
      WHERE existsNode(OBJECT_VALUE,
                       '/PurchaseOrder[Reference="AMCEWEN-20021009123336171PDT"]')
            = 1;
    EXTRACT(OBJECT_VALUE,'/PURCHASEORDER/LINEITEMS/LINEITEM[@ITEMNUMBER="222"]')
    <LineItem ItemNumber="222">
      <Description>The Harder They Come</Description>
      <Part Id="953562951413" UnitPrice="22.95" Quantity="1"/>
    </LineItem>
    1 row selected.
    UPDATE purchaseorder
      SET OBJECT_VALUE =
          deleteXML(OBJECT_VALUE,
                    '/PurchaseOrder/LineItems/LineItem[@ItemNumber="222"]')
      WHERE existsNode(OBJECT_VALUE,
                       '/PurchaseOrder[Reference="AMCEWEN-20021009123336171PDT"]')
            = 1;
    SELECT extract(OBJECT_VALUE,
                   '/PurchaseOrder/LineItems/LineItem[@ItemNumber="222"]')
      FROM purchaseorder
      WHERE existsNode(OBJECT_VALUE,
                       '/PurchaseOrder[Reference="AMCEWEN-20021009123336171PDT"]')
            = 1;
    EXTRACT(OBJECT_VALUE,'/PURCHASEORDER/LINEITEMS/LINEITEM[@ITEMNUMBER="222"]')
    1 row selected.

  • How to delete a node from a node network

    How do I delete a node from a node network?
    <P>
    <OL>
    <LI>Follow the instructions on page 30 of the Calendar Server (CS) 3.x Admin Guide,
    and page 62 of the CS 4.0 Admin Guide "Deleting (excluding) a Node from the
    Network".
    <LI>Shut down the Directory Server.
    <LI>Backup the LDAP directory to an LDIF file.
    <LI>Edit this LDIF file and delete references to the
    6 calendar reserved users for the node to be deleted.
    <LI>Restore the LDAP directory with this changed LDIF file.
    <LI>Run unidbfix -export -n all
    <LI>Edit the resulting remotenodes.ini
    files and delete all
    references to the node to be deleted.
    <LI>Run unidbfix -import -n all
    <LI>Start the Directory Server.
    <LI>Start the Calendar Server.
    <P>
    Note: This next step is for Calendar Server 3.x * ONLY *
    <P>
    <LI>Run unireqdump -delete
    to delete all requests to the node
    to be deleted.
    </OL>

    Divya wrote:
    Hi,
    I'm using forms6i.
    I want to delete unselected nodes from a tree
    How can it be done??
    ThanksIf you mean empty branches as unselected nodes,
    set Allow Empty Branches property to 'No' in the Trees property.

  • Delete a node from JTree using removeSelectionPath question

    hi guys,
    how do i delete a node using removeSelectionPath?
    jtree.removeSelectionPath(treePath);
    it dont seem to work
    cheers

    Each of that type of learning interactions has a minimum and a maximum number of buttons (nodes). For the circle matrix I found a minimum of 5 (central + one ring). When you select one of the buttons you should see a minus sign that allows to delete a button.

  • Looping and Deleting XML Nodes

    A bit perplexed about what is likely a simple problem.
    Say I have the following XML (myXML):
    <stories>
    <story id="1"/>
    <story id="2"/>
    <story id="3"/>
    <otherNode id="15"/>
    <otherNode id="15"/>
    </stories>
    I want to delete nodes with id's of one and two.
    So I currently have:
    for (var nodeIndex in myXML.story) {
    var nodeValue = myXML.story[nodeIndex];
    if (nodeValue != undefined) {
    if (nodeValue.@id == "1" || nodeValue.@id == "2") {
    delete myXML.story[nodeIndex];
    The problem: After deleting the node with id="1" the very next iteration is the node with id="3" - the node with id="2" is never read.
    While it totally makes sense to me, my only dummified solution was to switch to a numeric loop and use nodeIndex-- when I delete a node. But that seems rather unelegant.

    Hi,
    elegant:
    delete myXML.story.(@id = '1')[0];
    delete myXML.story.(@id = '2')[0];
    But you should know that you have only one element with this id.

  • Delete xml node

    i am looking delete a node by referencing the id attribute.
    this sounds easy enough, but unless i am missing something, i am
    stumped...
    or maybe there is a better way to accomplish my goal. to
    simplify things, i would like to take xml bind it to a data grid
    and select a row from the datagrid and remove the row from the
    datagrid and the xml. the reason why i need it removed from the xml
    is for local file storage via zinc...
    thanks in advance
    var x1:XML = <x1>
    <a id = "1">AAA</a>
    <a id = "2">BBB</a>
    <a id = "3">CCC</a>
    <a id = "4">DDD</a>
    </x1>;
    delete x1.a.@id['1'];
    keith

    thanks for the reply. i think my question may have been a bit
    misleading. what i am trying to do is remove a node from the xml i
    wish to save.
    var x1:XML = <x1>
    <a id = "1">AAA</a>
    <a id = "2">BBB</a>
    <a id = "3">CCC</a>
    <a id = "4">DDD</a>
    </x1>;
    delete x1.a.@id['1'];
    trace(x1);
    preferred output:
    <x1>
    <a id = "2">BBB</a>
    <a id = "3">CCC</a>
    <a id = "4">DDD</a>
    </x1>;

Maybe you are looking for

  • Unable to assign all security roles to a user with a new custom security role

    Dear All, Happy New Year.! I have a query regarding the assignment of Security Roles to new users in CRM. Normally we assign the security roles to new users via an Admin user who has 'System Administrator' security role assigned to him/her. This work

  • Using scripts with different versions of AppleScript

    Hi, I have a script that works perfectly in my Apple Script Editor v2.4.3 and Language AppleScript 2.2.1   I've given that script to a friend of mine with AppleScript Editor 2.7 and Apple Script Language 2.4 The script does not work properly in their

  • While creating the networks under WBS it's giving error

    Hi experts, i am not able to create the network under WBS element. while creating the Networks it's asking Scheduling type under scheluling tab. I tryed giving with backwards and forwards options, after press the enter it's says"The factory calendar 

  • Official Nokia C7 PR1.1 Release Schedule

    As with N8, we now have the C7 Release Schedule available for you. This list will be updated regularly with release timings for different countries and variants. So, if you're not sure about the availability for your phone, just take a look at the li

  • Problems with Aperture DVD serial number

    I have Aperture 2 and 3 serial numbers on my files and the Aperture 3 box that I bought from Apple shows only stickers for two equal serial numbers labeled Aperture Upgrade V3.0. The installation rejects those as being for an upgrade and requests the