[xml] DTD validation question?



I am including an internal DTD in my XML file for validation purpose.
However, I am not sure how to do it with libxml2? Is there any API that does
DTD validation while parsing xml data?

I tried to use xmlParseDocument and set the validate field in
xmlParserCtxtPtr to true. It seemed that did not do it. 

ctxt = xmlCreateDocParserCtxt(buffer);
...
ctxt->validate = (validate > 0);
xmlParseDocument(ctxt);

The document is very brief about the validate field, and other structure
seemed to also have a "validate" field in them. What's the difference among
them?

Thanks for any help. 

Gang Wang 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]