Initial revision
[TestXSLT.git] / libxml2 / include / libxml / relaxng.h
1 /*
2  * relaxng.h: header for the implementation of the Relax-NG validation
3  *
4  * See Copyright for the status of this software.
5  *
6  * daniel@veillard.com
7  */
8
9 #ifndef __XML_RELAX_NG__
10 #define __XML_RELAX_NG__
11
12 #include <libxml/hash.h>
13
14 typedef struct _xmlRelaxNG xmlRelaxNG;
15 typedef xmlRelaxNG *xmlRelaxNGPtr;
16
17
18 /**
19  * A schemas validation context
20  */
21 typedef void (*xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...);
22 typedef void (*xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...);
23
24 typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt;
25 typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr;
26
27 typedef struct _xmlRelaxNGValidCtxt xmlRelaxNGValidCtxt;
28 typedef xmlRelaxNGValidCtxt *xmlRelaxNGValidCtxtPtr;
29
30 /*
31  * Interfaces for parsing.
32  */
33 xmlRelaxNGParserCtxtPtr xmlRelaxNGNewParserCtxt (const char *URL);
34 xmlRelaxNGParserCtxtPtr xmlRelaxNGNewMemParserCtxt(const char *buffer,
35                                                  int size);
36 void            xmlRelaxNGFreeParserCtxt        (xmlRelaxNGParserCtxtPtr ctxt);
37 void            xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
38                                          xmlRelaxNGValidityErrorFunc err,
39                                          xmlRelaxNGValidityWarningFunc warn,
40                                          void *ctx);
41 xmlRelaxNGPtr   xmlRelaxNGParse         (xmlRelaxNGParserCtxtPtr ctxt);
42 void            xmlRelaxNGFree          (xmlRelaxNGPtr schema);
43 void            xmlRelaxNGDump          (FILE *output,
44                                          xmlRelaxNGPtr schema);
45 void            xmlRelaxNGDumpTree      (FILE * output,
46                                          xmlRelaxNGPtr schema);
47 /*
48  * Interfaces for validating
49  */
50 void            xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
51                                          xmlRelaxNGValidityErrorFunc err,
52                                          xmlRelaxNGValidityWarningFunc warn,
53                                          void *ctx);
54 xmlRelaxNGValidCtxtPtr  xmlRelaxNGNewValidCtxt  (xmlRelaxNGPtr schema);
55 void                    xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt);
56 int                     xmlRelaxNGValidateDoc   (xmlRelaxNGValidCtxtPtr ctxt,
57                                                  xmlDocPtr instance);
58 int                     xmlRelaxNGValidateStream(xmlRelaxNGValidCtxtPtr ctxt,
59                                                  xmlParserInputBufferPtr input,
60                                                  xmlCharEncoding enc,
61                                                  xmlSAXHandlerPtr sax,
62                                                  void *user_data);
63 void                    xmlRelaxNGCleanupTypes  (void);
64 #endif /* __XML_RELAX_NG__ */