VirtualBox

source: vbox/trunk/src/libs/libxml2-2.12.6/include/libxml/relaxng.h@ 105635

最後變更 在這個檔案從105635是 104106,由 vboxsync 提交於 10 月 前

libxml2-2.9.14: Applied and adjusted our libxml2 changes to 2.9.14. bugref:10640

  • 屬性 svn:eol-style 設為 native
檔案大小: 5.7 KB
 
1/*
2 * Summary: implementation of the Relax-NG validation
3 * Description: implementation of the Relax-NG validation
4 *
5 * Copy: See Copyright for the status of this software.
6 *
7 * Author: Daniel Veillard
8 */
9
10#ifndef __XML_RELAX_NG__
11#define __XML_RELAX_NG__
12
13#include <libxml/xmlversion.h>
14#include <libxml/xmlerror.h>
15#include <libxml/xmlstring.h>
16#include <libxml/tree.h>
17
18#ifdef LIBXML_SCHEMAS_ENABLED
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24typedef struct _xmlRelaxNG xmlRelaxNG;
25typedef xmlRelaxNG *xmlRelaxNGPtr;
26
27
28/**
29 * xmlRelaxNGValidityErrorFunc:
30 * @ctx: the validation context
31 * @msg: the message
32 * @...: extra arguments
33 *
34 * Signature of an error callback from a Relax-NG validation
35 */
36typedef void (*xmlRelaxNGValidityErrorFunc) (void *ctx,
37 const char *msg,
38 ...) LIBXML_ATTR_FORMAT(2,3);
39
40/**
41 * xmlRelaxNGValidityWarningFunc:
42 * @ctx: the validation context
43 * @msg: the message
44 * @...: extra arguments
45 *
46 * Signature of a warning callback from a Relax-NG validation
47 */
48typedef void (*xmlRelaxNGValidityWarningFunc) (void *ctx,
49 const char *msg,
50 ...) LIBXML_ATTR_FORMAT(2,3);
51
52/**
53 * A schemas validation context
54 */
55typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt;
56typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr;
57
58typedef struct _xmlRelaxNGValidCtxt xmlRelaxNGValidCtxt;
59typedef xmlRelaxNGValidCtxt *xmlRelaxNGValidCtxtPtr;
60
61/*
62 * xmlRelaxNGValidErr:
63 *
64 * List of possible Relax NG validation errors
65 */
66typedef enum {
67 XML_RELAXNG_OK = 0,
68 XML_RELAXNG_ERR_MEMORY,
69 XML_RELAXNG_ERR_TYPE,
70 XML_RELAXNG_ERR_TYPEVAL,
71 XML_RELAXNG_ERR_DUPID,
72 XML_RELAXNG_ERR_TYPECMP,
73 XML_RELAXNG_ERR_NOSTATE,
74 XML_RELAXNG_ERR_NODEFINE,
75 XML_RELAXNG_ERR_LISTEXTRA,
76 XML_RELAXNG_ERR_LISTEMPTY,
77 XML_RELAXNG_ERR_INTERNODATA,
78 XML_RELAXNG_ERR_INTERSEQ,
79 XML_RELAXNG_ERR_INTEREXTRA,
80 XML_RELAXNG_ERR_ELEMNAME,
81 XML_RELAXNG_ERR_ATTRNAME,
82 XML_RELAXNG_ERR_ELEMNONS,
83 XML_RELAXNG_ERR_ATTRNONS,
84 XML_RELAXNG_ERR_ELEMWRONGNS,
85 XML_RELAXNG_ERR_ATTRWRONGNS,
86 XML_RELAXNG_ERR_ELEMEXTRANS,
87 XML_RELAXNG_ERR_ATTREXTRANS,
88 XML_RELAXNG_ERR_ELEMNOTEMPTY,
89 XML_RELAXNG_ERR_NOELEM,
90 XML_RELAXNG_ERR_NOTELEM,
91 XML_RELAXNG_ERR_ATTRVALID,
92 XML_RELAXNG_ERR_CONTENTVALID,
93 XML_RELAXNG_ERR_EXTRACONTENT,
94 XML_RELAXNG_ERR_INVALIDATTR,
95 XML_RELAXNG_ERR_DATAELEM,
96 XML_RELAXNG_ERR_VALELEM,
97 XML_RELAXNG_ERR_LISTELEM,
98 XML_RELAXNG_ERR_DATATYPE,
99 XML_RELAXNG_ERR_VALUE,
100 XML_RELAXNG_ERR_LIST,
101 XML_RELAXNG_ERR_NOGRAMMAR,
102 XML_RELAXNG_ERR_EXTRADATA,
103 XML_RELAXNG_ERR_LACKDATA,
104 XML_RELAXNG_ERR_INTERNAL,
105 XML_RELAXNG_ERR_ELEMWRONG,
106 XML_RELAXNG_ERR_TEXTWRONG
107} xmlRelaxNGValidErr;
108
109/*
110 * xmlRelaxNGParserFlags:
111 *
112 * List of possible Relax NG Parser flags
113 */
114typedef enum {
115 XML_RELAXNGP_NONE = 0,
116 XML_RELAXNGP_FREE_DOC = 1,
117 XML_RELAXNGP_CRNG = 2
118} xmlRelaxNGParserFlag;
119
120XMLPUBFUN int
121 xmlRelaxNGInitTypes (void);
122XML_DEPRECATED
123XMLPUBFUN void
124 xmlRelaxNGCleanupTypes (void);
125
126/*
127 * Interfaces for parsing.
128 */
129XMLPUBFUN xmlRelaxNGParserCtxtPtr
130 xmlRelaxNGNewParserCtxt (const char *URL);
131XMLPUBFUN xmlRelaxNGParserCtxtPtr
132 xmlRelaxNGNewMemParserCtxt (const char *buffer,
133 int size);
134XMLPUBFUN xmlRelaxNGParserCtxtPtr
135 xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc);
136
137XMLPUBFUN int
138 xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt,
139 int flag);
140
141XMLPUBFUN void
142 xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt);
143XMLPUBFUN void
144 xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
145 xmlRelaxNGValidityErrorFunc err,
146 xmlRelaxNGValidityWarningFunc warn,
147 void *ctx);
148XMLPUBFUN int
149 xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
150 xmlRelaxNGValidityErrorFunc *err,
151 xmlRelaxNGValidityWarningFunc *warn,
152 void **ctx);
153XMLPUBFUN void
154 xmlRelaxNGSetParserStructuredErrors(
155 xmlRelaxNGParserCtxtPtr ctxt,
156 xmlStructuredErrorFunc serror,
157 void *ctx);
158XMLPUBFUN xmlRelaxNGPtr
159 xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
160XMLPUBFUN void
161 xmlRelaxNGFree (xmlRelaxNGPtr schema);
162#ifdef LIBXML_OUTPUT_ENABLED
163XMLPUBFUN void
164 xmlRelaxNGDump (FILE *output,
165 xmlRelaxNGPtr schema);
166XMLPUBFUN void
167 xmlRelaxNGDumpTree (FILE * output,
168 xmlRelaxNGPtr schema);
169#endif /* LIBXML_OUTPUT_ENABLED */
170/*
171 * Interfaces for validating
172 */
173XMLPUBFUN void
174 xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
175 xmlRelaxNGValidityErrorFunc err,
176 xmlRelaxNGValidityWarningFunc warn,
177 void *ctx);
178XMLPUBFUN int
179 xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
180 xmlRelaxNGValidityErrorFunc *err,
181 xmlRelaxNGValidityWarningFunc *warn,
182 void **ctx);
183XMLPUBFUN void
184 xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt,
185 xmlStructuredErrorFunc serror, void *ctx);
186XMLPUBFUN xmlRelaxNGValidCtxtPtr
187 xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema);
188XMLPUBFUN void
189 xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt);
190XMLPUBFUN int
191 xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt,
192 xmlDocPtr doc);
193/*
194 * Interfaces for progressive validation when possible
195 */
196XMLPUBFUN int
197 xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt,
198 xmlDocPtr doc,
199 xmlNodePtr elem);
200XMLPUBFUN int
201 xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt,
202 const xmlChar *data,
203 int len);
204XMLPUBFUN int
205 xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt,
206 xmlDocPtr doc,
207 xmlNodePtr elem);
208XMLPUBFUN int
209 xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt,
210 xmlDocPtr doc,
211 xmlNodePtr elem);
212
213#ifdef __cplusplus
214}
215#endif
216
217#endif /* LIBXML_SCHEMAS_ENABLED */
218
219#endif /* __XML_RELAX_NG__ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette