Hi,
I am tring to delete complete node based on value of child node, I am able to delete first node but the code throwing exception while removing next node.
ap.declareXPathNameSpace("ns","http://ddd.dddddd.ec/CD333A");
//ap.selectXPath("/ns:CD303A/IMPOPE200/*");
ap.selectXPath("/ns:CD333A/IMPOPE200/ENSRisIMP902");
int result = -1;
int count = 0;
XMLModifier xm = new XMLModifier(vn);;
ArrayList <Long> ls = new ArrayList<Long>();
while((result = ap.evalXPath())!=-1){
System.out.print(""+result+" ");
String key = vn.toString(result);
System.out.print("Element name ==> "+key);
int t = vn.getText(); // get the index of the text (char data or CDATA)
NodeRecorder nr = new NodeRecorder(vn);
if(t!=-1){Stringval=vn.toNormalizedString(t);System.out.println("Text==>"+val);if(key!=null&&key.equals("ENSRisIMP902")&&val!=null&&!val.equals(null)&&Integer.parseInt(val)==0){VTDNavvn1=(VTDNav)vn.duplicateNav();vn1.toElement(VTDNav.P);//gettoAnodelongl=vn1.getElementFragment();//.getElementFragment();//.getContentFragment();xm.remove(l);//xm.bind(vn);ls.add(l);}}System.out.println("\n ============================== ");count++;}/*for (int i=0;i<ls.size();i++){ long l = ls.get(i); xm.remove(l); }*/xm.output("C:\\WORKSPACE\\AlertMonitor\\output.xml");System.out.println("Total # of element "+count);
I am getting below error; appreciate your help on to further progress
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am tring to delete complete node based on value of child node, I am able to delete first node but the code throwing exception while removing next node.
ap.declareXPathNameSpace("ns","http://ddd.dddddd.ec/CD333A");
//ap.selectXPath("/ns:CD303A/IMPOPE200/*");
ap.selectXPath("/ns:CD333A/IMPOPE200/ENSRisIMP902");
int result = -1;
int count = 0;
XMLModifier xm = new XMLModifier(vn);;
ArrayList <Long> ls = new ArrayList<Long>();
while((result = ap.evalXPath())!=-1){
System.out.print(""+result+" ");
String key = vn.toString(result);
System.out.print("Element name ==> "+key);
int t = vn.getText(); // get the index of the text (char data or CDATA)
NodeRecorder nr = new NodeRecorder(vn);
I am getting below error; appreciate your help on to further progress
I believe this is a bug that may have been reported and fixed, can you download version 2.12 from cvs and do a compile and give another try?