examples.updateElementName.changeElementName Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vtd-xml Show documentation
Show all versions of vtd-xml Show documentation
XimpleWare's VTD-XML is, far and away, the industry's most advanced and powerful XML processing model for SOA and Cloud Computing
/*
* Change all elements to lalalala
*/
import src.ximpleware.*;
public class changeElementName {
public static void main(String[] args) throws Exception{
String xml = " ";
VTDGen vg = new VTDGen();
vg.setDoc(xml.getBytes());
vg.parse(false);
VTDNav vn = vg.getNav();
AutoPilot ap = new AutoPilot(vn);
ap.selectXPath("//*");
XMLModifier xm = new XMLModifier(vn);
int i;
while(ap.evalXPath()!=-1){
xm.updateElementName("lalalala");
}
xm.output("lala.xml");
}
}