2 * Summary: XML Schemastron implementation
3 * Description: interface to the XML Schematron validity checking.
5 * Copy: See Copyright for the status of this software.
7 * Author: Daniel Veillard
11 #ifndef __XML_SCHEMATRON_H__
12 #define __XML_SCHEMATRON_H__
14 #include <libxml/xmlversion.h>
16 #ifdef LIBXML_SCHEMATRON_ENABLED
18 #include <libxml/tree.h>
25 XML_SCHEMATRON_OUT_QUIET = 1 << 0, /* quiet no report */
26 XML_SCHEMATRON_OUT_TEXT = 1 << 1, /* build a textual report */
27 XML_SCHEMATRON_OUT_XML = 1 << 2, /* output SVRL */
28 XML_SCHEMATRON_OUT_FILE = 1 << 8, /* output to a file descriptor */
29 XML_SCHEMATRON_OUT_BUFFER = 1 << 9, /* output to a buffer */
30 XML_SCHEMATRON_OUT_IO = 1 << 10 /* output to I/O mechanism */
31 } xmlSchematronValidOptions;
34 * The schemas related types are kept internal
36 typedef struct _xmlSchematron xmlSchematron;
37 typedef xmlSchematron *xmlSchematronPtr;
40 * A schemas validation context
42 typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...);
43 typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...);
45 typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt;
46 typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr;
48 typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt;
49 typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr;
52 * Interfaces for parsing.
54 XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
55 xmlSchematronNewParserCtxt (const char *URL);
56 XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
57 xmlSchematronNewMemParserCtxt(const char *buffer,
59 XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
60 xmlSchematronNewDocParserCtxt(xmlDocPtr doc);
61 XMLPUBFUN void XMLCALL
62 xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt);
64 XMLPUBFUN void XMLCALL
65 xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt,
66 xmlSchematronValidityErrorFunc err,
67 xmlSchematronValidityWarningFunc warn,
70 xmlSchematronGetParserErrors(xmlSchematronParserCtxtPtr ctxt,
71 xmlSchematronValidityErrorFunc * err,
72 xmlSchematronValidityWarningFunc * warn,
75 xmlSchematronIsValid (xmlSchematronValidCtxtPtr ctxt);
77 XMLPUBFUN xmlSchematronPtr XMLCALL
78 xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt);
79 XMLPUBFUN void XMLCALL
80 xmlSchematronFree (xmlSchematronPtr schema);
82 * Interfaces for validating
85 XMLPUBFUN void XMLCALL
86 xmlSchematronSetValidStructuredErrors(
87 xmlSchematronValidCtxtPtr ctxt,
88 xmlStructuredErrorFunc serror,
90 XMLPUBFUN void XMLCALL
91 xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt,
92 xmlSchematronValidityErrorFunc err,
93 xmlSchematronValidityWarningFunc warn,
96 xmlSchematronGetValidErrors (xmlSchematronValidCtxtPtr ctxt,
97 xmlSchematronValidityErrorFunc *err,
98 xmlSchematronValidityWarningFunc *warn,
100 XMLPUBFUN int XMLCALL
101 xmlSchematronSetValidOptions(xmlSchematronValidCtxtPtr ctxt,
103 XMLPUBFUN int XMLCALL
104 xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxtPtr ctxt);
105 XMLPUBFUN int XMLCALL
106 xmlSchematronValidateOneElement (xmlSchematronValidCtxtPtr ctxt,
110 XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL
111 xmlSchematronNewValidCtxt (xmlSchematronPtr schema,
113 XMLPUBFUN void XMLCALL
114 xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt);
115 XMLPUBFUN int XMLCALL
116 xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt,
123 #endif /* LIBXML_SCHEMATRON_ENABLED */
124 #endif /* __XML_SCHEMATRON_H__ */