schematron.h

Go to the documentation of this file.
00001 /*
00002  * Summary: XML Schemastron implementation
00003  * Description: interface to the XML Schematron validity checking.
00004  *
00005  * Copy: See Copyright for the status of this software.
00006  *
00007  * Author: Daniel Veillard
00008  */
00009 
00010 
00011 #ifndef __XML_SCHEMATRON_H__
00012 #define __XML_SCHEMATRON_H__
00013 
00014 #include <libxml/xmlversion.h>
00015 
00016 #ifdef LIBXML_SCHEMATRON_ENABLED
00017 
00018 #include <libxml/tree.h>
00019 
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023 
00024 typedef enum {
00025     XML_SCHEMATRON_OUT_QUIET = 1 << 0,  /* quiet no report */
00026     XML_SCHEMATRON_OUT_TEXT = 1 << 1,   /* build a textual report */
00027     XML_SCHEMATRON_OUT_XML = 1 << 2,    /* output SVRL */
00028     XML_SCHEMATRON_OUT_FILE = 1 << 8,   /* output to a file descriptor */
00029     XML_SCHEMATRON_OUT_BUFFER = 1 << 9, /* output to a buffer */
00030     XML_SCHEMATRON_OUT_IO = 1 << 10 /* output to I/O mechanism */
00031 } xmlSchematronValidOptions;
00032 
00036 typedef struct _xmlSchematron xmlSchematron;
00037 typedef xmlSchematron *xmlSchematronPtr;
00038 
00042 typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...);
00043 typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...);
00044 
00045 typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt;
00046 typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr;
00047 
00048 typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt;
00049 typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr;
00050 
00051 /*
00052  * Interfaces for parsing.
00053  */
00054 XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL 
00055         xmlSchematronNewParserCtxt  (const char *URL);
00056 XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL 
00057         xmlSchematronNewMemParserCtxt(const char *buffer,
00058                      int size);
00059 XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
00060         xmlSchematronNewDocParserCtxt(xmlDocPtr doc);
00061 XMLPUBFUN void XMLCALL      
00062         xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt);
00063 /*****
00064 XMLPUBFUN void XMLCALL      
00065         xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt,
00066                      xmlSchematronValidityErrorFunc err,
00067                      xmlSchematronValidityWarningFunc warn,
00068                      void *ctx);
00069 XMLPUBFUN int XMLCALL
00070         xmlSchematronGetParserErrors(xmlSchematronParserCtxtPtr ctxt,
00071                     xmlSchematronValidityErrorFunc * err,
00072                     xmlSchematronValidityWarningFunc * warn,
00073                     void **ctx);
00074 XMLPUBFUN int XMLCALL
00075         xmlSchematronIsValid    (xmlSchematronValidCtxtPtr ctxt);
00076  *****/
00077 XMLPUBFUN xmlSchematronPtr XMLCALL  
00078         xmlSchematronParse      (xmlSchematronParserCtxtPtr ctxt);
00079 XMLPUBFUN void XMLCALL      
00080         xmlSchematronFree       (xmlSchematronPtr schema);
00081 /*
00082  * Interfaces for validating
00083  */
00084 /******
00085 XMLPUBFUN void XMLCALL
00086         xmlSchematronSetValidStructuredErrors(
00087                                       xmlSchematronValidCtxtPtr ctxt,
00088                       xmlStructuredErrorFunc serror,
00089                       void *ctx);
00090 XMLPUBFUN void XMLCALL      
00091         xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt,
00092                      xmlSchematronValidityErrorFunc err,
00093                      xmlSchematronValidityWarningFunc warn,
00094                      void *ctx);
00095 XMLPUBFUN int XMLCALL
00096         xmlSchematronGetValidErrors (xmlSchematronValidCtxtPtr ctxt,
00097                      xmlSchematronValidityErrorFunc *err,
00098                      xmlSchematronValidityWarningFunc *warn,
00099                      void **ctx);
00100 XMLPUBFUN int XMLCALL
00101         xmlSchematronSetValidOptions(xmlSchematronValidCtxtPtr ctxt,
00102                      int options);
00103 XMLPUBFUN int XMLCALL
00104         xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxtPtr ctxt);
00105 XMLPUBFUN int XMLCALL
00106             xmlSchematronValidateOneElement (xmlSchematronValidCtxtPtr ctxt,
00107                              xmlNodePtr elem);
00108  *******/
00109 
00110 XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL 
00111         xmlSchematronNewValidCtxt   (xmlSchematronPtr schema,
00112                          int options);
00113 XMLPUBFUN void XMLCALL          
00114         xmlSchematronFreeValidCtxt  (xmlSchematronValidCtxtPtr ctxt);
00115 XMLPUBFUN int XMLCALL           
00116         xmlSchematronValidateDoc    (xmlSchematronValidCtxtPtr ctxt,
00117                      xmlDocPtr instance);
00118 
00119 #ifdef __cplusplus
00120 }
00121 #endif
00122 
00123 #endif /* LIBXML_SCHEMATRON_ENABLED */
00124 #endif /* __XML_SCHEMATRON_H__ */
footer
 SourceForge.net Logo