|
#include "everything.h"
struct exception_context the_exception_context[1];
int main(){
exception e;
VTDGen *vg = NULL;
VTDNav *vn = NULL;
AutoPilot *ap = NULL;
XMLModifier *xm = NULL;
FILE *f = NULL;
UCSChar *string = NULL;
int i;
f = fopen("d:/ximpleware_2.2_c/vtd-xml/codeGuru/6/input.vxl","rb");
if (f==NULL)
return 0;
Try{
xm = createXMLModifier();
ap = createAutoPilot2();
selectXPath(ap,L"/a/b");
vg = createVTDGen();
vn = loadIndex (vg,f);
bind(ap,vn);
bind4XMLModifier(xm,vn);
while((i=evalXPath(ap))!=-1){
insertAttribute(xm,L" attr1='val'");
}
output2(xm,"d:/ximpleware_2.2_c/vtd-xml/codeGuru/6/new.xml");
free(vn->XMLDoc);
}Catch(e){// handle various types of exceptions here
}
fclose(f);
freeAutoPilot(ap);
freeXMLModifier(xm);
freeVTDGen(vg);
freeVTDNav(vn);
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Jimmy Zhang is a cofounder of XimpleWare, a provider of high performance XML processing solutions. He has working experience in the fields of electronic design automation and Voice over IP for a number of Silicon Valley high-tech companies. He holds both a BS and MS from the department of EECS from U.C. Berkeley.