Example #1
0
Doctype* DtdParser::parseStream(FILE* fd)
{
	// Specify the stream to use by the parser.
	dtdFlushBuffer();
	dtdin = fd;

	// Start the parsing of the document.
	Doctype *ddoc = NULL;
	int dtdErr = dtdparse(&ddoc);

	return ddoc;
}
Example #2
0
int main(int argc, char **argv)
{
  int err = -1;
  int errXML, errDTD;

  FILE *fidXML, *fidDTD;

  if(argc != 2){
 	printf("Parse ended with %d error(s)\n", err);
  }

  /* Analyse XML */
  fidXML = fopen(argv[1], "r");
  xmlin  = fidXML;

  errXML = xmlparse();
  fclose(fidXML);
  if (errXML != 0) printf("Parse XML ended with %d error(s)\n", errXML);
  	else  printf("Parse XML ended with sucess\n", errXML);


  /* Analyse DTD */
  fidDTD = fopen(argv[2], "r");
  dtdin  = fidDTD;

  errDTD = dtdparse();
  fclose(fidXML);
  if (errDTD != 0) printf("Parse DTD ended with %d error(s)\n", errDTD);
  	else  printf("Parse DTD ended with sucess\n", errDTD);

	//docXML;
	//docDTD;

  return 0;

}