VirtualBox

source: vbox/trunk/src/libs/libxml2-2.6.30/include/libxml/relaxng.h@ 20364

最後變更 在這個檔案從20364是 6076,由 vboxsync 提交於 17 年 前

Merged dmik/s2 branch (r25959:26751) to the trunk.

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

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