title: How to validate an XML using inline DTD using libxml2 (SAX parser)?
body: <p>I am writing an XML parser in C++ using libxml library which requires me to validate the XML against a DTD which is specified inline. I don't want to use system() in my program. Otherwise I could have used the xmllint command. </p>
  
  <p>I came across the <em>xmlValidateDtd(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd)</em> function specified in the <a href="http://xmlsoft.org/" rel="nofollow">http://xmlsoft.org/</a> API page. But I feel it is DOM based function since in SAX parsing there is no xmlDocPtr. </p>
  
  <p>Are there are any other methods to validate the XML document against the inline DTD? </p>