Re: [xml] Validating xml with xmlValidateDtd



On Thu, Nov 29, 2001 at 11:03:04AM +0100, Gert Marginet wrote:
Thanks, your previous answer helped me a lot.

But I still have a question.

I use this code, like you told me

cvp.userData = (void *) stderr;
cvp.error = (xmlValidityErrorFunc) fprintf;
cvp.warning  = (xmlValidityWarningFunc) fprintf;

RetVal = xmlValidateDtd(&cvp, doc, dtd);


Now I receive a 0 or a 1 in the RetVal, if it is a 0 the reason is printed to the screen.  How can I get 
all the errors and warnings if it is not valid in a char*?

  Simply make your own error routine doing it and replace cvp.error
and cvp.warning values with it. Use cvp.userData to pass a parameters if
needed.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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