Re: [xml] Patch to enable xmlSchemaSetValidErrors in python



On Tue, Nov 09, 2004 at 10:01:51PM -0600, Brent M Hendricks wrote:
Daniel Veillard wrote:
 autogeneration of bindings only happens if all types in the function
signature are handled by generate.py, in that case I think there is
no wrapper type or class for xmlValidCtxtPtr.

Thanks!  Using this as a starting point, I've put together a patch that 
adds a wrapper for xmlValidCtxtPtr.  It seems to work, and did indeed 
allow a binding for xmlValidateDtd to be autogenerated along with the 
following other functions:

xmlValidateOneElement
xmlValidCtxtNormalizeAttributeValue
xmlValidatePopElement
xmlValidateRoot
xmlValidateElement
xmlValidateDtdFinal
xmlValidateNotationUse
xmlNewValidCtxt
xmlValidatePushElement
xmlValidatePushCData
xmlFreeValidCtxt
xmlValidateOneAttribute
xmlValidateDocument
xmlValidateDocumentFinal
xmlValidateOneNamespace

In order to get it to work, I had to exclude xmlValidBuildContentModel, 
 xmlValidateElementDecl, xmlValidateAttributeDecl in generator.py 
because they depended on PyxmlElement_Get and PyxmlAttribute_Get which 
didn't seem to exist.

I also added a libxml_xmlSetValidErrors() function in libxml.c to allow 
for setting validation error handlers.  I based this off 
libxml_xmlRelaxNGSetValidErrors() so the code roughly parallels that.

I've attached the patch as well as a simple test of the validateDtd 
function.  It would be great if this could get committed and get some 
more exposure.  I will continue to test things here as well.

  This looks fine, I applied the patch and integrated the test to the
regressions. 

  Thanks a lot !

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://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]