Example 2 - XML Application Shell

/* -------------------------------------------------------------------------
 Test_general_parser.c - A simple example of calling re-usable xml-parsing
  library for general-purpose xml-parsing.  Reads xml-file(s) on command-line
  into token-tree, then generates new xml-file from token-tree.
  Always writes output to file called: "test_out.xml".

  cc -g test_general_parser.c -lm -o test_general_parser.exe

#include <stdio.h>
#include "xml_parse_lib.c"

int main( int argc, char **argv )
 int j=1;
 Xml_object *rootobj=0;

 while (j < argc)
   printf("Reading file '%s'\n", argv[j]);
   rootobj = Xml_Read_File( argv[j] );
   printf("Writing file 'test_out.xml'.\n");
   Xml_Write_File( "test_out.xml", rootobj );


 return 0;


SourceForge.net Logo