All Downloads are FREE. Search and download functionalities are using the official Maven repository.

examples.Overwrite.Overwrite Maven / Gradle / Ivy

Go to download

XimpleWare's VTD-XML is, far and away, the industry's most advanced and powerful XML processing model for SOA and Cloud Computing

There is a newer version: 2.13.4
Show newest version
import src.ximpleware.*;
// This example shows you how to overwrite a token using 
// VTDNav's overwrite method call
// The basic concept is that if the replacement value is
// shorter than the original token, then you can directly
// write the replacement bytes into the XML message and
// the original VTD structure doesn't change at all!!!
class Overwrite{

	public static void main(String s[]) throws Exception{
		VTDGen vg = new VTDGen();
		vg.setDoc("good".getBytes());
		vg.parse(true);
		VTDNav vn = vg.getNav();
		int i=vn.getText();
		//print "good"
		System.out.println("text ---> "+vn.toString(i));
		if (vn.overWrite(i,"bad".getBytes())){
			//overwrite, if successful, returns true
			//print "bad" here 
			System.out.println("text ---> "+vn.toString(i));
		}
	}	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy