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

examples.Indexing.indexWriter.c 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
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include "../vtdGen.h"
struct exception_context the_exception_context[1];

int main(){

	exception e;
	FILE *fw = NULL;
	char* filename = "oldpo.xml";
	VTDGen *vg = NULL; // This is the VTDGen that parses XML

	// allocate a piece of buffer then reads in the document content
	// assume "c:\soap2.xml" is the name of the file
	fw = fopen("oldpo.vxl","wb");
	//stat(filename,&s);

	//i = (int) s.st_size;	
	//wprintf(L"size of the file is %d \n",i);
	//xml = (UByte *)malloc(sizeof(UByte) *i);
	//i = fread(xml,sizeof(UByte),i,f);
	Try{
		vg = createVTDGen();
		if (parseFile(vg,TRUE,"oldpo.xml")){
			writeIndex(vg,fw);
		}
		freeVTDGen(vg);
		fclose(fw);
	}
	Catch (e) {
		if (e.et == parse_exception)
			wprintf(L"parse exception e ==> %s \n %s\n", e.msg, e.sub_msg);	
		// manual garbage collection here
		freeVTDGen(vg);
	}
  return 0;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy