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_ERROR = 1 << 3, /* output via xmlStructuredErrorFunc */
29
XML_SCHEMATRON_OUT_FILE = 1 << 8, /* output to a file descriptor */
30
XML_SCHEMATRON_OUT_BUFFER = 1 << 9, /* output to a buffer */
31
XML_SCHEMATRON_OUT_IO = 1 << 10 /* output to I/O mechanism */
32
} xmlSchematronValidOptions;
35
* The schemas related types are kept internal
37
typedef struct _xmlSchematron xmlSchematron;
38
typedef xmlSchematron *xmlSchematronPtr;
41
* xmlSchematronValidityErrorFunc:
42
* @ctx: the validation context
44
* @...: extra arguments
46
* Signature of an error callback from a Schematron validation
48
typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...);
51
* xmlSchematronValidityWarningFunc:
52
* @ctx: the validation context
54
* @...: extra arguments
56
* Signature of a warning callback from a Schematron validation
58
typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...);
61
* A schemas validation context
63
typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt;
64
typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr;
66
typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt;
67
typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr;
70
* Interfaces for parsing.
72
XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
73
xmlSchematronNewParserCtxt (const char *URL);
74
XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
75
xmlSchematronNewMemParserCtxt(const char *buffer,
77
XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL
78
xmlSchematronNewDocParserCtxt(xmlDocPtr doc);
79
XMLPUBFUN void XMLCALL
80
xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt);
82
XMLPUBFUN void XMLCALL
83
xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt,
84
xmlSchematronValidityErrorFunc err,
85
xmlSchematronValidityWarningFunc warn,
88
xmlSchematronGetParserErrors(xmlSchematronParserCtxtPtr ctxt,
89
xmlSchematronValidityErrorFunc * err,
90
xmlSchematronValidityWarningFunc * warn,
93
xmlSchematronIsValid (xmlSchematronValidCtxtPtr ctxt);
95
XMLPUBFUN xmlSchematronPtr XMLCALL
96
xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt);
97
XMLPUBFUN void XMLCALL
98
xmlSchematronFree (xmlSchematronPtr schema);
100
* Interfaces for validating
102
XMLPUBFUN void XMLCALL
103
xmlSchematronSetValidStructuredErrors(
104
xmlSchematronValidCtxtPtr ctxt,
105
xmlStructuredErrorFunc serror,
108
XMLPUBFUN void XMLCALL
109
xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt,
110
xmlSchematronValidityErrorFunc err,
111
xmlSchematronValidityWarningFunc warn,
113
XMLPUBFUN int XMLCALL
114
xmlSchematronGetValidErrors (xmlSchematronValidCtxtPtr ctxt,
115
xmlSchematronValidityErrorFunc *err,
116
xmlSchematronValidityWarningFunc *warn,
118
XMLPUBFUN int XMLCALL
119
xmlSchematronSetValidOptions(xmlSchematronValidCtxtPtr ctxt,
121
XMLPUBFUN int XMLCALL
122
xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxtPtr ctxt);
123
XMLPUBFUN int XMLCALL
124
xmlSchematronValidateOneElement (xmlSchematronValidCtxtPtr ctxt,
128
XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL
129
xmlSchematronNewValidCtxt (xmlSchematronPtr schema,
131
XMLPUBFUN void XMLCALL
132
xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt);
133
XMLPUBFUN int XMLCALL
134
xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt,
141
#endif /* LIBXML_SCHEMATRON_ENABLED */
142
#endif /* __XML_SCHEMATRON_H__ */