title: how to get off with the libxml2 error messages
body: <p>I want to use the libxml2 lib to parse my xml files.
  Now, when I have some bad xml file the lib itself is printing large error messages.</p>
  
  <p>below is some sample code</p>
  
  <pre><code>reader = xmlReaderForFile(filename, NULL, 0);
  if (reader != NULL) {
     ret = xmlTextReaderRead(reader);
     while (ret == 1) {
         printf("_________________________________\n");
         processNode(reader);
         ret = xmlTextReaderRead(reader);
         printf("_________________________________\n");
     }
     xmlFreeTextReader(reader);
     if (ret != 0) {
         fprintf(stderr, "%s : failed to parse\n", filename);
     }
  }
  </code></pre>
  
  <p>In above example, if I have bad xml file, I get error like this</p>
  
  <pre><code>my.xml:4: parser error : attributes construct error
   include type="text"this is text. this might be excluded in the next occurrence 
  
  my.xml:4: parser error : Couldn't find end of Start Tag include
   include type="text"this is text. this might be excluded in the next occurrence 
  
  my.xml : failed to parse
  </code></pre>
  
  <p>Instead, I just want to return some error no. and get off with this ugly lib messages.</p>
  
  <p>what do I do ?</p>