VTD-XML in Java - Find index after XMLModifier.insertAfterElement

主宰稳场 提交于 2019-12-03 16:10:02

I think the answer is to plan your modification and subsequent access to new content carefully. If you insert the new content, and try to access the new content immediately afterwards, insertAndParse() is the way to go. But as you can see, it is rather slow because of the reparsing. My suggestion is that you plan as much as insert all at once, then call reparsing just once, it will be a lot more efficient this way.

The spirit is that VTD-XML is not trying to be DOM, it has its own strengths and weaknesses... and this is one of the weakness, but you can work around it ... And when you try to merge multiple xml files, vtd-xml will certainly shine....

Also if you tag this question with vtd-xml, i will be able to find it much easier.

C.Ranga Swamy
modifier.remove():

in the text file stored no.of xpaths, val so for each xpath generate one new output xxx.xml file. when u use xml modifier previous data along with current data it will write in a xxx.xml file so for elimination of previous data and only for current xpath data changes write into the new xxx.xml file so for that use the modifier.remove();

xm2.output( new FileOutputStream("/home/cupola-hadoop-project/TotalEnvironment/document/link/"+j+"101new.xml"));
xm2.remove();

and rotate the loop desired times.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!