Re: [xml] Issue with DTD validation



On Thu, 2004-01-29 at 15:16, Senthil S wrote:
Hi All,
                I am senthil here, memeber of xml forum.
                I face an issue with DTD validation using function
xmlParseDTD.
                If any validity error occurs it gets printed in
console. 
                Is there any chance of capturing this error message in
char format?
                Please help me out to resolve the issue.

Look at the API documentation at http://xmlsoft.org/. In particular, in
the xml-tree documentation, you will see that an xmlParserCtxt structure
has a member called 'sax', which is a pointer to an xmlSAXHandler.

Then look at http://xmlsoft.org/html/libxml-tree.html#xmlSAXHandler and
you can see that there are two function pointers where you can insert
your own error and warning handler functions.

So, in your mock code, after creating a new context, insert your error
and warning handlers as appropriate and then parse the document.

Cheers,
Malcolm




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