Path: blob/master/venv/Lib/site-packages/lxml/includes/libxml/schematron.h
811 views
/*1* Summary: XML Schemastron implementation2* Description: interface to the XML Schematron validity checking.3*4* Copy: See Copyright for the status of this software.5*6* Author: Daniel Veillard7*/8910#ifndef __XML_SCHEMATRON_H__11#define __XML_SCHEMATRON_H__1213#include <libxml/xmlversion.h>1415#ifdef LIBXML_SCHEMATRON_ENABLED1617#include <libxml/tree.h>1819#ifdef __cplusplus20extern "C" {21#endif2223typedef enum {24XML_SCHEMATRON_OUT_QUIET = 1 << 0, /* quiet no report */25XML_SCHEMATRON_OUT_TEXT = 1 << 1, /* build a textual report */26XML_SCHEMATRON_OUT_XML = 1 << 2, /* output SVRL */27XML_SCHEMATRON_OUT_ERROR = 1 << 3, /* output via xmlStructuredErrorFunc */28XML_SCHEMATRON_OUT_FILE = 1 << 8, /* output to a file descriptor */29XML_SCHEMATRON_OUT_BUFFER = 1 << 9, /* output to a buffer */30XML_SCHEMATRON_OUT_IO = 1 << 10 /* output to I/O mechanism */31} xmlSchematronValidOptions;3233/**34* The schemas related types are kept internal35*/36typedef struct _xmlSchematron xmlSchematron;37typedef xmlSchematron *xmlSchematronPtr;3839/**40* xmlSchematronValidityErrorFunc:41* @ctx: the validation context42* @msg: the message43* @...: extra arguments44*45* Signature of an error callback from a Schematron validation46*/47typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...);4849/**50* xmlSchematronValidityWarningFunc:51* @ctx: the validation context52* @msg: the message53* @...: extra arguments54*55* Signature of a warning callback from a Schematron validation56*/57typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...);5859/**60* A schemas validation context61*/62typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt;63typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr;6465typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt;66typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr;6768/*69* Interfaces for parsing.70*/71XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL72xmlSchematronNewParserCtxt (const char *URL);73XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL74xmlSchematronNewMemParserCtxt(const char *buffer,75int size);76XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL77xmlSchematronNewDocParserCtxt(xmlDocPtr doc);78XMLPUBFUN void XMLCALL79xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt);80/*****81XMLPUBFUN void XMLCALL82xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt,83xmlSchematronValidityErrorFunc err,84xmlSchematronValidityWarningFunc warn,85void *ctx);86XMLPUBFUN int XMLCALL87xmlSchematronGetParserErrors(xmlSchematronParserCtxtPtr ctxt,88xmlSchematronValidityErrorFunc * err,89xmlSchematronValidityWarningFunc * warn,90void **ctx);91XMLPUBFUN int XMLCALL92xmlSchematronIsValid (xmlSchematronValidCtxtPtr ctxt);93*****/94XMLPUBFUN xmlSchematronPtr XMLCALL95xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt);96XMLPUBFUN void XMLCALL97xmlSchematronFree (xmlSchematronPtr schema);98/*99* Interfaces for validating100*/101XMLPUBFUN void XMLCALL102xmlSchematronSetValidStructuredErrors(103xmlSchematronValidCtxtPtr ctxt,104xmlStructuredErrorFunc serror,105void *ctx);106/******107XMLPUBFUN void XMLCALL108xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt,109xmlSchematronValidityErrorFunc err,110xmlSchematronValidityWarningFunc warn,111void *ctx);112XMLPUBFUN int XMLCALL113xmlSchematronGetValidErrors (xmlSchematronValidCtxtPtr ctxt,114xmlSchematronValidityErrorFunc *err,115xmlSchematronValidityWarningFunc *warn,116void **ctx);117XMLPUBFUN int XMLCALL118xmlSchematronSetValidOptions(xmlSchematronValidCtxtPtr ctxt,119int options);120XMLPUBFUN int XMLCALL121xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxtPtr ctxt);122XMLPUBFUN int XMLCALL123xmlSchematronValidateOneElement (xmlSchematronValidCtxtPtr ctxt,124xmlNodePtr elem);125*******/126127XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL128xmlSchematronNewValidCtxt (xmlSchematronPtr schema,129int options);130XMLPUBFUN void XMLCALL131xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt);132XMLPUBFUN int XMLCALL133xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt,134xmlDocPtr instance);135136#ifdef __cplusplus137}138#endif139140#endif /* LIBXML_SCHEMATRON_ENABLED */141#endif /* __XML_SCHEMATRON_H__ */142143144