You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.6 KiB

4 years ago
  1. from lxml.includes cimport xmlerror
  2. from lxml.includes.tree cimport xmlDoc
  3. cdef extern from "libxml/schematron.h":
  4. ctypedef struct xmlSchematron
  5. ctypedef struct xmlSchematronParserCtxt
  6. ctypedef struct xmlSchematronValidCtxt
  7. ctypedef enum xmlSchematronValidOptions:
  8. XML_SCHEMATRON_OUT_QUIET = 1 # quiet no report
  9. XML_SCHEMATRON_OUT_TEXT = 2 # build a textual report
  10. XML_SCHEMATRON_OUT_XML = 4 # output SVRL
  11. XML_SCHEMATRON_OUT_ERROR = 8 # output via xmlStructuredErrorFunc
  12. XML_SCHEMATRON_OUT_FILE = 256 # output to a file descriptor
  13. XML_SCHEMATRON_OUT_BUFFER = 512 # output to a buffer
  14. XML_SCHEMATRON_OUT_IO = 1024 # output to I/O mechanism
  15. cdef xmlSchematronParserCtxt* xmlSchematronNewDocParserCtxt(
  16. xmlDoc* doc) nogil
  17. cdef xmlSchematronParserCtxt* xmlSchematronNewParserCtxt(
  18. char* filename) nogil
  19. cdef xmlSchematronValidCtxt* xmlSchematronNewValidCtxt(
  20. xmlSchematron* schema, int options) nogil
  21. cdef xmlSchematron* xmlSchematronParse(xmlSchematronParserCtxt* ctxt) nogil
  22. cdef int xmlSchematronValidateDoc(xmlSchematronValidCtxt* ctxt,
  23. xmlDoc* instance) nogil
  24. cdef void xmlSchematronFreeParserCtxt(xmlSchematronParserCtxt* ctxt) nogil
  25. cdef void xmlSchematronFreeValidCtxt(xmlSchematronValidCtxt* ctxt) nogil
  26. cdef void xmlSchematronFree(xmlSchematron* schema) nogil
  27. cdef void xmlSchematronSetValidStructuredErrors(
  28. xmlSchematronValidCtxt* ctxt,
  29. xmlerror.xmlStructuredErrorFunc error_func, void *data)