Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/libxml2/libxml/schematron.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /**
0002  * @file
0003  * 
0004  * @brief XML Schematron implementation
0005  * 
0006  * interface to the XML Schematron validity checking.
0007  *
0008  * @copyright See Copyright for the status of this software.
0009  *
0010  * @author Daniel Veillard
0011  */
0012 
0013 
0014 #ifndef __XML_SCHEMATRON_H__
0015 #define __XML_SCHEMATRON_H__
0016 
0017 #include <libxml/xmlversion.h>
0018 
0019 #ifdef LIBXML_SCHEMATRON_ENABLED
0020 
0021 #include <libxml/xmlerror.h>
0022 #include <libxml/tree.h>
0023 
0024 #ifdef __cplusplus
0025 extern "C" {
0026 #endif
0027 
0028 /**
0029  * Schematron validation options
0030  */
0031 typedef enum {
0032     /** quiet no report */
0033     XML_SCHEMATRON_OUT_QUIET = 1 << 0,
0034     /** build a textual report */
0035     XML_SCHEMATRON_OUT_TEXT = 1 << 1,
0036     /** output SVRL */
0037     XML_SCHEMATRON_OUT_XML = 1 << 2,
0038     /** output via xmlStructuredErrorFunc */
0039     XML_SCHEMATRON_OUT_ERROR = 1 << 3,
0040     /** output to a file descriptor */
0041     XML_SCHEMATRON_OUT_FILE = 1 << 8,
0042     /** output to a buffer */
0043     XML_SCHEMATRON_OUT_BUFFER = 1 << 9,
0044     /** output to I/O mechanism */
0045     XML_SCHEMATRON_OUT_IO = 1 << 10
0046 } xmlSchematronValidOptions;
0047 
0048 /** Schematron schema */
0049 typedef struct _xmlSchematron xmlSchematron;
0050 typedef xmlSchematron *xmlSchematronPtr;
0051 
0052 /**
0053  * Signature of an error callback from a Schematron validation
0054  *
0055  * @param ctx  the validation context
0056  * @param msg  the message
0057  * @param ... extra arguments
0058  */
0059 typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...);
0060 
0061 /**
0062  * Signature of a warning callback from a Schematron validation
0063  *
0064  * @param ctx  the validation context
0065  * @param msg  the message
0066  * @param ... extra arguments
0067  */
0068 typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...);
0069 
0070 /** Schematron parser context */
0071 typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt;
0072 typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr;
0073 
0074 /** Schematron validation context */
0075 typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt;
0076 typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr;
0077 
0078 /*
0079  * Interfaces for parsing.
0080  */
0081 XMLPUBFUN xmlSchematronParserCtxt *
0082         xmlSchematronNewParserCtxt  (const char *URL);
0083 XMLPUBFUN xmlSchematronParserCtxt *
0084         xmlSchematronNewMemParserCtxt(const char *buffer,
0085                      int size);
0086 XMLPUBFUN xmlSchematronParserCtxt *
0087         xmlSchematronNewDocParserCtxt(xmlDoc *doc);
0088 XMLPUBFUN void
0089         xmlSchematronFreeParserCtxt (xmlSchematronParserCtxt *ctxt);
0090 /*****
0091 XMLPUBFUN void
0092         xmlSchematronSetParserErrors(xmlSchematronParserCtxt *ctxt,
0093                      xmlSchematronValidityErrorFunc err,
0094                      xmlSchematronValidityWarningFunc warn,
0095                      void *ctx);
0096 XMLPUBFUN int
0097         xmlSchematronGetParserErrors(xmlSchematronParserCtxt *ctxt,
0098                     xmlSchematronValidityErrorFunc * err,
0099                     xmlSchematronValidityWarningFunc * warn,
0100                     void **ctx);
0101 XMLPUBFUN int
0102         xmlSchematronIsValid    (xmlSchematronValidCtxt *ctxt);
0103  *****/
0104 XMLPUBFUN xmlSchematron *
0105         xmlSchematronParse      (xmlSchematronParserCtxt *ctxt);
0106 XMLPUBFUN void
0107         xmlSchematronFree       (xmlSchematron *schema);
0108 /*
0109  * Interfaces for validating
0110  */
0111 XMLPUBFUN void
0112         xmlSchematronSetValidStructuredErrors(
0113                                       xmlSchematronValidCtxt *ctxt,
0114                       xmlStructuredErrorFunc serror,
0115                       void *ctx);
0116 /******
0117 XMLPUBFUN void
0118         xmlSchematronSetValidErrors (xmlSchematronValidCtxt *ctxt,
0119                      xmlSchematronValidityErrorFunc err,
0120                      xmlSchematronValidityWarningFunc warn,
0121                      void *ctx);
0122 XMLPUBFUN int
0123         xmlSchematronGetValidErrors (xmlSchematronValidCtxt *ctxt,
0124                      xmlSchematronValidityErrorFunc *err,
0125                      xmlSchematronValidityWarningFunc *warn,
0126                      void **ctx);
0127 XMLPUBFUN int
0128         xmlSchematronSetValidOptions(xmlSchematronValidCtxt *ctxt,
0129                      int options);
0130 XMLPUBFUN int
0131         xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxt *ctxt);
0132 XMLPUBFUN int
0133             xmlSchematronValidateOneElement (xmlSchematronValidCtxt *ctxt,
0134                              xmlNode *elem);
0135  *******/
0136 
0137 XMLPUBFUN xmlSchematronValidCtxt *
0138         xmlSchematronNewValidCtxt   (xmlSchematron *schema,
0139                      int options);
0140 XMLPUBFUN void
0141         xmlSchematronFreeValidCtxt  (xmlSchematronValidCtxt *ctxt);
0142 XMLPUBFUN int
0143         xmlSchematronValidateDoc    (xmlSchematronValidCtxt *ctxt,
0144                      xmlDoc *instance);
0145 
0146 #ifdef __cplusplus
0147 }
0148 #endif
0149 
0150 #endif /* LIBXML_SCHEMATRON_ENABLED */
0151 #endif /* __XML_SCHEMATRON_H__ */