xref: /aosp_15_r20/external/libxml2/doc/devhelp/libxml2-xmlschemas.html (revision 7c5688314b92172186c154356a6374bf7684c3ca)
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>xmlschemas: incomplete XML Schemas structure implementation</title>
5<meta name="generator" content="Libxml2 devhelp stylesheet">
6<link rel="start" href="index.html" title="libxml2 Reference Manual">
7<link rel="up" href="general.html" title="API">
8<link rel="stylesheet" href="style.css" type="text/css">
9<link rel="chapter" href="general.html" title="API">
10</head>
11<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
12<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
13<td><a accesskey="p" href="libxml2-xmlsave.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
14<td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
15<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
16<td><a accesskey="n" href="libxml2-xmlschemastypes.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
17<th width="100%" align="center">libxml2 Reference Manual</th>
18</tr></table>
19<h2><span class="refentrytitle">xmlschemas</span></h2>
20<p>xmlschemas - incomplete XML Schemas structure implementation</p>
21<p>interface to the XML Schemas handling and schema validity checking, it is incomplete right now. </p>
22<p>Author(s): Daniel Veillard </p>
23<div class="refsynopsisdiv">
24<h2>Synopsis</h2>
25<pre class="synopsis">typedef struct _xmlSchema <a href="#xmlSchema">xmlSchema</a>;
26typedef struct _xmlSchemaParserCtxt <a href="#xmlSchemaParserCtxt">xmlSchemaParserCtxt</a>;
27typedef <a href="libxml2-xmlschemas.html#xmlSchemaParserCtxt">xmlSchemaParserCtxt</a> * <a href="#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a>;
28typedef <a href="libxml2-xmlschemas.html#xmlSchema">xmlSchema</a> * <a href="#xmlSchemaPtr">xmlSchemaPtr</a>;
29typedef <a href="libxml2-xmlschemas.html#xmlSchemaSAXPlugStruct">xmlSchemaSAXPlugStruct</a> * <a href="#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a>;
30typedef struct _xmlSchemaSAXPlug <a href="#xmlSchemaSAXPlugStruct">xmlSchemaSAXPlugStruct</a>;
31typedef struct _xmlSchemaValidCtxt <a href="#xmlSchemaValidCtxt">xmlSchemaValidCtxt</a>;
32typedef <a href="libxml2-xmlschemas.html#xmlSchemaValidCtxt">xmlSchemaValidCtxt</a> * <a href="#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a>;
33typedef enum <a href="#xmlSchemaValidError">xmlSchemaValidError</a>;
34typedef enum <a href="#xmlSchemaValidOption">xmlSchemaValidOption</a>;
35void	<a href="#xmlSchemaDump">xmlSchemaDump</a>			(FILE * output, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema);
36void	<a href="#xmlSchemaFree">xmlSchemaFree</a>			(<a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema);
37void	<a href="#xmlSchemaFreeParserCtxt">xmlSchemaFreeParserCtxt</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt);
38void	<a href="#xmlSchemaFreeValidCtxt">xmlSchemaFreeValidCtxt</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt);
39int	<a href="#xmlSchemaGetParserErrors">xmlSchemaGetParserErrors</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br>					 void ** ctx);
40int	<a href="#xmlSchemaGetValidErrors">xmlSchemaGetValidErrors</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br>					 void ** ctx);
41int	<a href="#xmlSchemaIsValid">xmlSchemaIsValid</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt);
42<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a>	<a href="#xmlSchemaNewDocParserCtxt">xmlSchemaNewDocParserCtxt</a>	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
43<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a>	<a href="#xmlSchemaNewMemParserCtxt">xmlSchemaNewMemParserCtxt</a>	(const char * buffer, <br>							 int size);
44<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a>	<a href="#xmlSchemaNewParserCtxt">xmlSchemaNewParserCtxt</a>	(const char * URL);
45<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a>	<a href="#xmlSchemaNewValidCtxt">xmlSchemaNewValidCtxt</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema);
46<a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a>	<a href="#xmlSchemaParse">xmlSchemaParse</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt);
47<a href="libxml2-xmlschemas.html#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a>	<a href="#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>						 <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> * sax, <br>						 void ** user_data);
48int	<a href="#xmlSchemaSAXUnplug">xmlSchemaSAXUnplug</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a> plug);
49void	<a href="#xmlSchemaSetParserErrors">xmlSchemaSetParserErrors</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br>					 void * ctx);
50void	<a href="#xmlSchemaSetParserStructuredErrors">xmlSchemaSetParserStructuredErrors</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br>						 void * ctx);
51void	<a href="#xmlSchemaSetValidErrors">xmlSchemaSetValidErrors</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br>					 void * ctx);
52int	<a href="#xmlSchemaSetValidOptions">xmlSchemaSetValidOptions</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 int options);
53void	<a href="#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br>						 void * ctx);
54int	<a href="#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt);
55<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	<a href="#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt);
56int	<a href="#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
57int	<a href="#xmlSchemaValidateFile">xmlSchemaValidateFile</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 const char * filename, <br>					 int options);
58int	<a href="#xmlSchemaValidateOneElement">xmlSchemaValidateOneElement</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem);
59void	<a href="#xmlSchemaValidateSetFilename">xmlSchemaValidateSetFilename</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> vctxt, <br>					 const char * filename);
60void	<a href="#xmlSchemaValidateSetLocator">xmlSchemaValidateSetLocator</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> vctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityLocatorFunc">xmlSchemaValidityLocatorFunc</a> f, <br>					 void * ctxt);
61int	<a href="#xmlSchemaValidateStream">xmlSchemaValidateStream</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br>					 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br>					 <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>					 void * user_data);
62typedef void <a href="#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a>	(void * ctx, <br>					 const char * msg, <br>					 ... ...);
63typedef int <a href="#xmlSchemaValidityLocatorFunc">xmlSchemaValidityLocatorFunc</a>	(void * ctx, <br>					 const char ** file, <br>					 unsigned long * line);
64typedef void <a href="#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a>	(void * ctx, <br>					 const char * msg, <br>					 ... ...);
65</pre>
66</div>
67<div class="refsect1" lang="en"><h2>Description</h2></div>
68<div class="refsect1" lang="en">
69<h2>Details</h2>
70<div class="refsect2" lang="en">
71<div class="refsect2" lang="en">
72<h3>
73<a name="xmlSchema">Structure </a>xmlSchema</h3>
74<pre class="programlisting">struct _xmlSchema {
75    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: schema name
76    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	targetNamespace	: the target namespace
77    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	version
78    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id	: Obsolete
79    <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	doc
80    <a href="libxml2-schemasInternals.html#xmlSchemaAnnotPtr">xmlSchemaAnnotPtr</a>	annot
81    int	flags
82    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	typeDecl
83    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	attrDecl
84    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	attrgrpDecl
85    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	elemDecl
86    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	notaDecl
87    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	schemasImports
88    void *	_private	: unused by the library for users or bindings
89    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	groupDecl
90    <a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a>	dict
91    void *	includes	: the includes, this is opaque for now
92    int	preserve	: whether to free the document
93    int	counter	: used to give anonymous components unique names
94    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	idcDef	: All identity-constraint defs.
95    void *	volatiles	: Obsolete
96} xmlSchema;
97</pre>
98<p></p>
99</div>
100<hr>
101<div class="refsect2" lang="en">
102<h3>
103<a name="xmlSchemaParserCtxt">Structure </a>xmlSchemaParserCtxt</h3>
104<pre class="programlisting">struct _xmlSchemaParserCtxt {
105The content of this structure is not made public by the API.
106} xmlSchemaParserCtxt;
107</pre>
108<p></p>
109</div>
110<hr>
111<div class="refsect2" lang="en">
112<h3>
113<a name="xmlSchemaParserCtxtPtr">Typedef </a>xmlSchemaParserCtxtPtr</h3>
114<pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaParserCtxt">xmlSchemaParserCtxt</a> * xmlSchemaParserCtxtPtr;
115</pre>
116<p></p>
117</div>
118<hr>
119<div class="refsect2" lang="en">
120<h3>
121<a name="xmlSchemaPtr">Typedef </a>xmlSchemaPtr</h3>
122<pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchema">xmlSchema</a> * xmlSchemaPtr;
123</pre>
124<p></p>
125</div>
126<hr>
127<div class="refsect2" lang="en">
128<h3>
129<a name="xmlSchemaSAXPlugPtr">Typedef </a>xmlSchemaSAXPlugPtr</h3>
130<pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaSAXPlugStruct">xmlSchemaSAXPlugStruct</a> * xmlSchemaSAXPlugPtr;
131</pre>
132<p></p>
133</div>
134<hr>
135<div class="refsect2" lang="en">
136<h3>
137<a name="xmlSchemaSAXPlugStruct">Structure </a>xmlSchemaSAXPlugStruct</h3>
138<pre class="programlisting">struct _xmlSchemaSAXPlug {
139The content of this structure is not made public by the API.
140} xmlSchemaSAXPlugStruct;
141</pre>
142<p></p>
143</div>
144<hr>
145<div class="refsect2" lang="en">
146<h3>
147<a name="xmlSchemaValidCtxt">Structure </a>xmlSchemaValidCtxt</h3>
148<pre class="programlisting">struct _xmlSchemaValidCtxt {
149The content of this structure is not made public by the API.
150} xmlSchemaValidCtxt;
151</pre>
152<p></p>
153</div>
154<hr>
155<div class="refsect2" lang="en">
156<h3>
157<a name="xmlSchemaValidCtxtPtr">Typedef </a>xmlSchemaValidCtxtPtr</h3>
158<pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaValidCtxt">xmlSchemaValidCtxt</a> * xmlSchemaValidCtxtPtr;
159</pre>
160<p></p>
161</div>
162<hr>
163<div class="refsect2" lang="en">
164<h3>
165<a name="xmlSchemaValidError">Enum </a>xmlSchemaValidError</h3>
166<pre class="programlisting">enum <a href="#xmlSchemaValidError">xmlSchemaValidError</a> {
167    <a name="XML_SCHEMAS_ERR_OK">XML_SCHEMAS_ERR_OK</a> = 0
168    <a name="XML_SCHEMAS_ERR_NOROOT">XML_SCHEMAS_ERR_NOROOT</a> = 1
169    <a name="XML_SCHEMAS_ERR_UNDECLAREDELEM">XML_SCHEMAS_ERR_UNDECLAREDELEM</a> = 2
170    <a name="XML_SCHEMAS_ERR_NOTTOPLEVEL">XML_SCHEMAS_ERR_NOTTOPLEVEL</a> = 3
171    <a name="XML_SCHEMAS_ERR_MISSING">XML_SCHEMAS_ERR_MISSING</a> = 4
172    <a name="XML_SCHEMAS_ERR_WRONGELEM">XML_SCHEMAS_ERR_WRONGELEM</a> = 5
173    <a name="XML_SCHEMAS_ERR_NOTYPE">XML_SCHEMAS_ERR_NOTYPE</a> = 6
174    <a name="XML_SCHEMAS_ERR_NOROLLBACK">XML_SCHEMAS_ERR_NOROLLBACK</a> = 7
175    <a name="XML_SCHEMAS_ERR_ISABSTRACT">XML_SCHEMAS_ERR_ISABSTRACT</a> = 8
176    <a name="XML_SCHEMAS_ERR_NOTEMPTY">XML_SCHEMAS_ERR_NOTEMPTY</a> = 9
177    <a name="XML_SCHEMAS_ERR_ELEMCONT">XML_SCHEMAS_ERR_ELEMCONT</a> = 10
178    <a name="XML_SCHEMAS_ERR_HAVEDEFAULT">XML_SCHEMAS_ERR_HAVEDEFAULT</a> = 11
179    <a name="XML_SCHEMAS_ERR_NOTNILLABLE">XML_SCHEMAS_ERR_NOTNILLABLE</a> = 12
180    <a name="XML_SCHEMAS_ERR_EXTRACONTENT">XML_SCHEMAS_ERR_EXTRACONTENT</a> = 13
181    <a name="XML_SCHEMAS_ERR_INVALIDATTR">XML_SCHEMAS_ERR_INVALIDATTR</a> = 14
182    <a name="XML_SCHEMAS_ERR_INVALIDELEM">XML_SCHEMAS_ERR_INVALIDELEM</a> = 15
183    <a name="XML_SCHEMAS_ERR_NOTDETERMINIST">XML_SCHEMAS_ERR_NOTDETERMINIST</a> = 16
184    <a name="XML_SCHEMAS_ERR_CONSTRUCT">XML_SCHEMAS_ERR_CONSTRUCT</a> = 17
185    <a name="XML_SCHEMAS_ERR_INTERNAL">XML_SCHEMAS_ERR_INTERNAL</a> = 18
186    <a name="XML_SCHEMAS_ERR_NOTSIMPLE">XML_SCHEMAS_ERR_NOTSIMPLE</a> = 19
187    <a name="XML_SCHEMAS_ERR_ATTRUNKNOWN">XML_SCHEMAS_ERR_ATTRUNKNOWN</a> = 20
188    <a name="XML_SCHEMAS_ERR_ATTRINVALID">XML_SCHEMAS_ERR_ATTRINVALID</a> = 21
189    <a name="XML_SCHEMAS_ERR_VALUE">XML_SCHEMAS_ERR_VALUE</a> = 22
190    <a name="XML_SCHEMAS_ERR_FACET">XML_SCHEMAS_ERR_FACET</a> = 23
191    <a name="XML_SCHEMAS_ERR_">XML_SCHEMAS_ERR_</a> = 24
192    <a name="XML_SCHEMAS_ERR_XXX">XML_SCHEMAS_ERR_XXX</a> = 25
193};
194</pre>
195<p></p>
196</div>
197<hr>
198<div class="refsect2" lang="en">
199<h3>
200<a name="xmlSchemaValidOption">Enum </a>xmlSchemaValidOption</h3>
201<pre class="programlisting">enum <a href="#xmlSchemaValidOption">xmlSchemaValidOption</a> {
202    <a name="XML_SCHEMA_VAL_VC_I_CREATE">XML_SCHEMA_VAL_VC_I_CREATE</a> = 1 /*  Default/fixed: create an attribute node * or an element's text node on the instance. * */
203};
204</pre>
205<p></p>
206</div>
207<hr>
208<div class="refsect2" lang="en">
209<h3>
210<a name="xmlSchemaValidityErrorFunc"></a>Function type xmlSchemaValidityErrorFunc</h3>
211<pre class="programlisting">void	xmlSchemaValidityErrorFunc	(void * ctx, <br>					 const char * msg, <br>					 ... ...)<br>
212</pre>
213<p>Signature of an error callback from an XSD validation</p>
214<div class="variablelist"><table border="0">
215<col align="left">
216<tbody>
217<tr>
218<td><span class="term"><i><tt>ctx</tt></i>:</span></td>
219<td>the validation context</td>
220</tr>
221<tr>
222<td><span class="term"><i><tt>msg</tt></i>:</span></td>
223<td>the message</td>
224</tr>
225<tr>
226<td><span class="term"><i><tt>...</tt></i>:</span></td>
227<td>extra arguments</td>
228</tr>
229</tbody>
230</table></div>
231</div>
232<hr>
233<div class="refsect2" lang="en">
234<h3>
235<a name="xmlSchemaValidityLocatorFunc"></a>Function type xmlSchemaValidityLocatorFunc</h3>
236<pre class="programlisting">int	xmlSchemaValidityLocatorFunc	(void * ctx, <br>					 const char ** file, <br>					 unsigned long * line)<br>
237</pre>
238<p>A schemas validation locator, a callback called by the validator. This is used when file or node information are not available to find out what file and line number are affected</p>
239<div class="variablelist"><table border="0">
240<col align="left">
241<tbody>
242<tr>
243<td><span class="term"><i><tt>ctx</tt></i>:</span></td>
244<td>user provided context</td>
245</tr>
246<tr>
247<td><span class="term"><i><tt>file</tt></i>:</span></td>
248<td>returned file information</td>
249</tr>
250<tr>
251<td><span class="term"><i><tt>line</tt></i>:</span></td>
252<td>returned line information</td>
253</tr>
254<tr>
255<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
256<td>0 in case of success and -1 in case of error</td>
257</tr>
258</tbody>
259</table></div>
260</div>
261<hr>
262<div class="refsect2" lang="en">
263<h3>
264<a name="xmlSchemaValidityWarningFunc"></a>Function type xmlSchemaValidityWarningFunc</h3>
265<pre class="programlisting">void	xmlSchemaValidityWarningFunc	(void * ctx, <br>					 const char * msg, <br>					 ... ...)<br>
266</pre>
267<p>Signature of a warning callback from an XSD validation</p>
268<div class="variablelist"><table border="0">
269<col align="left">
270<tbody>
271<tr>
272<td><span class="term"><i><tt>ctx</tt></i>:</span></td>
273<td>the validation context</td>
274</tr>
275<tr>
276<td><span class="term"><i><tt>msg</tt></i>:</span></td>
277<td>the message</td>
278</tr>
279<tr>
280<td><span class="term"><i><tt>...</tt></i>:</span></td>
281<td>extra arguments</td>
282</tr>
283</tbody>
284</table></div>
285</div>
286<hr>
287<div class="refsect2" lang="en">
288<h3>
289<a name="xmlSchemaDump"></a>xmlSchemaDump ()</h3>
290<pre class="programlisting">void	xmlSchemaDump			(FILE * output, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema)<br>
291</pre>
292<p>Dump a Schema structure.</p>
293<div class="variablelist"><table border="0">
294<col align="left">
295<tbody>
296<tr>
297<td><span class="term"><i><tt>output</tt></i>:</span></td>
298<td>the file output</td>
299</tr>
300<tr>
301<td><span class="term"><i><tt>schema</tt></i>:</span></td>
302<td>a schema structure</td>
303</tr>
304</tbody>
305</table></div>
306</div>
307<hr>
308<div class="refsect2" lang="en">
309<h3>
310<a name="xmlSchemaFree"></a>xmlSchemaFree ()</h3>
311<pre class="programlisting">void	xmlSchemaFree			(<a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema)<br>
312</pre>
313<p>Deallocate a Schema structure.</p>
314<div class="variablelist"><table border="0">
315<col align="left">
316<tbody><tr>
317<td><span class="term"><i><tt>schema</tt></i>:</span></td>
318<td>a schema structure</td>
319</tr></tbody>
320</table></div>
321</div>
322<hr>
323<div class="refsect2" lang="en">
324<h3>
325<a name="xmlSchemaFreeParserCtxt"></a>xmlSchemaFreeParserCtxt ()</h3>
326<pre class="programlisting">void	xmlSchemaFreeParserCtxt		(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt)<br>
327</pre>
328<p>Free the resources associated to the schema parser context</p>
329<div class="variablelist"><table border="0">
330<col align="left">
331<tbody><tr>
332<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
333<td>the schema parser context</td>
334</tr></tbody>
335</table></div>
336</div>
337<hr>
338<div class="refsect2" lang="en">
339<h3>
340<a name="xmlSchemaFreeValidCtxt"></a>xmlSchemaFreeValidCtxt ()</h3>
341<pre class="programlisting">void	xmlSchemaFreeValidCtxt		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br>
342</pre>
343<p>Free the resources associated to the schema validation context</p>
344<div class="variablelist"><table border="0">
345<col align="left">
346<tbody><tr>
347<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
348<td>the schema validation context</td>
349</tr></tbody>
350</table></div>
351</div>
352<hr>
353<div class="refsect2" lang="en">
354<h3>
355<a name="xmlSchemaGetParserErrors"></a>xmlSchemaGetParserErrors ()</h3>
356<pre class="programlisting">int	xmlSchemaGetParserErrors	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br>					 void ** ctx)<br>
357</pre>
358<p>Get the callback information used to handle errors for a parser context</p>
359<div class="variablelist"><table border="0">
360<col align="left">
361<tbody>
362<tr>
363<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
364<td>a XMl-Schema parser context</td>
365</tr>
366<tr>
367<td><span class="term"><i><tt>err</tt></i>:</span></td>
368<td>the error callback result</td>
369</tr>
370<tr>
371<td><span class="term"><i><tt>warn</tt></i>:</span></td>
372<td>the warning callback result</td>
373</tr>
374<tr>
375<td><span class="term"><i><tt>ctx</tt></i>:</span></td>
376<td>contextual data for the callbacks result</td>
377</tr>
378<tr>
379<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
380<td>-1 in case of failure, 0 otherwise</td>
381</tr>
382</tbody>
383</table></div>
384</div>
385<hr>
386<div class="refsect2" lang="en">
387<h3>
388<a name="xmlSchemaGetValidErrors"></a>xmlSchemaGetValidErrors ()</h3>
389<pre class="programlisting">int	xmlSchemaGetValidErrors		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br>					 void ** ctx)<br>
390</pre>
391<p>Get the error and warning callback information</p>
392<div class="variablelist"><table border="0">
393<col align="left">
394<tbody>
395<tr>
396<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
397<td>a XML-Schema validation context</td>
398</tr>
399<tr>
400<td><span class="term"><i><tt>err</tt></i>:</span></td>
401<td>the error function result</td>
402</tr>
403<tr>
404<td><span class="term"><i><tt>warn</tt></i>:</span></td>
405<td>the warning function result</td>
406</tr>
407<tr>
408<td><span class="term"><i><tt>ctx</tt></i>:</span></td>
409<td>the functions context result</td>
410</tr>
411<tr>
412<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
413<td>-1 in case of error and 0 otherwise</td>
414</tr>
415</tbody>
416</table></div>
417</div>
418<hr>
419<div class="refsect2" lang="en">
420<h3>
421<a name="xmlSchemaIsValid"></a>xmlSchemaIsValid ()</h3>
422<pre class="programlisting">int	xmlSchemaIsValid		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br>
423</pre>
424<p>Check if any error was detected during validation.</p>
425<div class="variablelist"><table border="0">
426<col align="left">
427<tbody>
428<tr>
429<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
430<td>the schema validation context</td>
431</tr>
432<tr>
433<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
434<td>1 if valid so far, 0 if errors were detected, and -1 in case of internal error.</td>
435</tr>
436</tbody>
437</table></div>
438</div>
439<hr>
440<div class="refsect2" lang="en">
441<h3>
442<a name="xmlSchemaNewDocParserCtxt"></a>xmlSchemaNewDocParserCtxt ()</h3>
443<pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a>	xmlSchemaNewDocParserCtxt	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br>
444</pre>
445<p>Create an XML Schemas parse context for that document. NB. The document may be modified during the parsing process.</p>
446<div class="variablelist"><table border="0">
447<col align="left">
448<tbody>
449<tr>
450<td><span class="term"><i><tt>doc</tt></i>:</span></td>
451<td>a preparsed document tree</td>
452</tr>
453<tr>
454<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
455<td>the parser context or NULL in case of error</td>
456</tr>
457</tbody>
458</table></div>
459</div>
460<hr>
461<div class="refsect2" lang="en">
462<h3>
463<a name="xmlSchemaNewMemParserCtxt"></a>xmlSchemaNewMemParserCtxt ()</h3>
464<pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a>	xmlSchemaNewMemParserCtxt	(const char * buffer, <br>							 int size)<br>
465</pre>
466<p>Create an XML Schemas parse context for that memory buffer expected to contain an XML Schemas file.</p>
467<div class="variablelist"><table border="0">
468<col align="left">
469<tbody>
470<tr>
471<td><span class="term"><i><tt>buffer</tt></i>:</span></td>
472<td>a pointer to a char array containing the schemas</td>
473</tr>
474<tr>
475<td><span class="term"><i><tt>size</tt></i>:</span></td>
476<td>the size of the array</td>
477</tr>
478<tr>
479<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
480<td>the parser context or NULL in case of error</td>
481</tr>
482</tbody>
483</table></div>
484</div>
485<hr>
486<div class="refsect2" lang="en">
487<h3>
488<a name="xmlSchemaNewParserCtxt"></a>xmlSchemaNewParserCtxt ()</h3>
489<pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a>	xmlSchemaNewParserCtxt	(const char * URL)<br>
490</pre>
491<p>Create an XML Schemas parse context for that file/resource expected to contain an XML Schemas file.</p>
492<div class="variablelist"><table border="0">
493<col align="left">
494<tbody>
495<tr>
496<td><span class="term"><i><tt>URL</tt></i>:</span></td>
497<td>the location of the schema</td>
498</tr>
499<tr>
500<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
501<td>the parser context or NULL in case of error</td>
502</tr>
503</tbody>
504</table></div>
505</div>
506<hr>
507<div class="refsect2" lang="en">
508<h3>
509<a name="xmlSchemaNewValidCtxt"></a>xmlSchemaNewValidCtxt ()</h3>
510<pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a>	xmlSchemaNewValidCtxt	(<a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema)<br>
511</pre>
512<p>Create an XML Schemas validation context based on the given schema.</p>
513<div class="variablelist"><table border="0">
514<col align="left">
515<tbody>
516<tr>
517<td><span class="term"><i><tt>schema</tt></i>:</span></td>
518<td>a precompiled XML Schemas</td>
519</tr>
520<tr>
521<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
522<td>the validation context or NULL in case of error</td>
523</tr>
524</tbody>
525</table></div>
526</div>
527<hr>
528<div class="refsect2" lang="en">
529<h3>
530<a name="xmlSchemaParse"></a>xmlSchemaParse ()</h3>
531<pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a>	xmlSchemaParse		(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt)<br>
532</pre>
533<p>parse a schema definition resource and build an internal XML Schema structure which can be used to validate instances.</p>
534<div class="variablelist"><table border="0">
535<col align="left">
536<tbody>
537<tr>
538<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
539<td>a schema validation context</td>
540</tr>
541<tr>
542<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
543<td>the internal XML Schema structure built from the resource or NULL in case of error</td>
544</tr>
545</tbody>
546</table></div>
547</div>
548<hr>
549<div class="refsect2" lang="en">
550<h3>
551<a name="xmlSchemaSAXPlug"></a>xmlSchemaSAXPlug ()</h3>
552<pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a>	xmlSchemaSAXPlug	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>						 <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> * sax, <br>						 void ** user_data)<br>
553</pre>
554<p>Plug a SAX based validation layer in a SAX parsing event flow. The original @saxptr and @dataptr data are replaced by new pointers but the calls to the original will be maintained.</p>
555<div class="variablelist"><table border="0">
556<col align="left">
557<tbody>
558<tr>
559<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
560<td>a schema validation context</td>
561</tr>
562<tr>
563<td><span class="term"><i><tt>sax</tt></i>:</span></td>
564<td>a pointer to the original <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a>
565</td>
566</tr>
567<tr>
568<td><span class="term"><i><tt>user_data</tt></i>:</span></td>
569<td>a pointer to the original SAX user data pointer</td>
570</tr>
571<tr>
572<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
573<td>a pointer to a data structure needed to unplug the validation layer or NULL in case of errors.</td>
574</tr>
575</tbody>
576</table></div>
577</div>
578<hr>
579<div class="refsect2" lang="en">
580<h3>
581<a name="xmlSchemaSAXUnplug"></a>xmlSchemaSAXUnplug ()</h3>
582<pre class="programlisting">int	xmlSchemaSAXUnplug		(<a href="libxml2-xmlschemas.html#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a> plug)<br>
583</pre>
584<p>Unplug a SAX based validation layer in a SAX parsing event flow. The original pointers used in the call are restored.</p>
585<div class="variablelist"><table border="0">
586<col align="left">
587<tbody>
588<tr>
589<td><span class="term"><i><tt>plug</tt></i>:</span></td>
590<td>a data structure returned by <a href="libxml2-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a>
591</td>
592</tr>
593<tr>
594<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
595<td>0 in case of success and -1 in case of failure.</td>
596</tr>
597</tbody>
598</table></div>
599</div>
600<hr>
601<div class="refsect2" lang="en">
602<h3>
603<a name="xmlSchemaSetParserErrors"></a>xmlSchemaSetParserErrors ()</h3>
604<pre class="programlisting">void	xmlSchemaSetParserErrors	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br>					 void * ctx)<br>
605</pre>
606<p>DEPRECATED: Use <a href="libxml2-xmlschemas.html#xmlSchemaSetParserStructuredErrors">xmlSchemaSetParserStructuredErrors</a>. Set the callback functions used to handle errors for a validation context</p>
607<div class="variablelist"><table border="0">
608<col align="left">
609<tbody>
610<tr>
611<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
612<td>a schema validation context</td>
613</tr>
614<tr>
615<td><span class="term"><i><tt>err</tt></i>:</span></td>
616<td>the error callback</td>
617</tr>
618<tr>
619<td><span class="term"><i><tt>warn</tt></i>:</span></td>
620<td>the warning callback</td>
621</tr>
622<tr>
623<td><span class="term"><i><tt>ctx</tt></i>:</span></td>
624<td>contextual data for the callbacks</td>
625</tr>
626</tbody>
627</table></div>
628</div>
629<hr>
630<div class="refsect2" lang="en">
631<h3>
632<a name="xmlSchemaSetParserStructuredErrors"></a>xmlSchemaSetParserStructuredErrors ()</h3>
633<pre class="programlisting">void	xmlSchemaSetParserStructuredErrors	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br>						 void * ctx)<br>
634</pre>
635<p>Set the structured error callback</p>
636<div class="variablelist"><table border="0">
637<col align="left">
638<tbody>
639<tr>
640<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
641<td>a schema parser context</td>
642</tr>
643<tr>
644<td><span class="term"><i><tt>serror</tt></i>:</span></td>
645<td>the structured error function</td>
646</tr>
647<tr>
648<td><span class="term"><i><tt>ctx</tt></i>:</span></td>
649<td>the functions context</td>
650</tr>
651</tbody>
652</table></div>
653</div>
654<hr>
655<div class="refsect2" lang="en">
656<h3>
657<a name="xmlSchemaSetValidErrors"></a>xmlSchemaSetValidErrors ()</h3>
658<pre class="programlisting">void	xmlSchemaSetValidErrors		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br>					 void * ctx)<br>
659</pre>
660<p>DEPRECATED: Use <a href="libxml2-xmlschemas.html#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a>. Set the error and warning callback information</p>
661<div class="variablelist"><table border="0">
662<col align="left">
663<tbody>
664<tr>
665<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
666<td>a schema validation context</td>
667</tr>
668<tr>
669<td><span class="term"><i><tt>err</tt></i>:</span></td>
670<td>the error function</td>
671</tr>
672<tr>
673<td><span class="term"><i><tt>warn</tt></i>:</span></td>
674<td>the warning function</td>
675</tr>
676<tr>
677<td><span class="term"><i><tt>ctx</tt></i>:</span></td>
678<td>the functions context</td>
679</tr>
680</tbody>
681</table></div>
682</div>
683<hr>
684<div class="refsect2" lang="en">
685<h3>
686<a name="xmlSchemaSetValidOptions"></a>xmlSchemaSetValidOptions ()</h3>
687<pre class="programlisting">int	xmlSchemaSetValidOptions	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 int options)<br>
688</pre>
689<p>Sets the options to be used during the validation.</p>
690<div class="variablelist"><table border="0">
691<col align="left">
692<tbody>
693<tr>
694<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
695<td>a schema validation context</td>
696</tr>
697<tr>
698<td><span class="term"><i><tt>options</tt></i>:</span></td>
699<td>a combination of <a href="libxml2-xmlschemas.html#xmlSchemaValidOption">xmlSchemaValidOption</a>
700</td>
701</tr>
702<tr>
703<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
704<td>0 in case of success, -1 in case of an API error.</td>
705</tr>
706</tbody>
707</table></div>
708</div>
709<hr>
710<div class="refsect2" lang="en">
711<h3>
712<a name="xmlSchemaSetValidStructuredErrors"></a>xmlSchemaSetValidStructuredErrors ()</h3>
713<pre class="programlisting">void	xmlSchemaSetValidStructuredErrors	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br>						 void * ctx)<br>
714</pre>
715<p>Set the structured error callback</p>
716<div class="variablelist"><table border="0">
717<col align="left">
718<tbody>
719<tr>
720<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
721<td>a schema validation context</td>
722</tr>
723<tr>
724<td><span class="term"><i><tt>serror</tt></i>:</span></td>
725<td>the structured error function</td>
726</tr>
727<tr>
728<td><span class="term"><i><tt>ctx</tt></i>:</span></td>
729<td>the functions context</td>
730</tr>
731</tbody>
732</table></div>
733</div>
734<hr>
735<div class="refsect2" lang="en">
736<h3>
737<a name="xmlSchemaValidCtxtGetOptions"></a>xmlSchemaValidCtxtGetOptions ()</h3>
738<pre class="programlisting">int	xmlSchemaValidCtxtGetOptions	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br>
739</pre>
740<p>Get the validation context options.</p>
741<div class="variablelist"><table border="0">
742<col align="left">
743<tbody>
744<tr>
745<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
746<td>a schema validation context</td>
747</tr>
748<tr>
749<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
750<td>the option combination or -1 on error.</td>
751</tr>
752</tbody>
753</table></div>
754</div>
755<hr>
756<div class="refsect2" lang="en">
757<h3>
758<a name="xmlSchemaValidCtxtGetParserCtxt"></a>xmlSchemaValidCtxtGetParserCtxt ()</h3>
759<pre class="programlisting"><a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	xmlSchemaValidCtxtGetParserCtxt	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br>
760</pre>
761<p>allow access to the parser context of the schema validation context</p>
762<div class="variablelist"><table border="0">
763<col align="left">
764<tbody>
765<tr>
766<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
767<td>a schema validation context</td>
768</tr>
769<tr>
770<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
771<td>the parser context of the schema validation context or NULL in case of error.</td>
772</tr>
773</tbody>
774</table></div>
775</div>
776<hr>
777<div class="refsect2" lang="en">
778<h3>
779<a name="xmlSchemaValidateDoc"></a>xmlSchemaValidateDoc ()</h3>
780<pre class="programlisting">int	xmlSchemaValidateDoc		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br>
781</pre>
782<p>Validate a document tree in memory.</p>
783<div class="variablelist"><table border="0">
784<col align="left">
785<tbody>
786<tr>
787<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
788<td>a schema validation context</td>
789</tr>
790<tr>
791<td><span class="term"><i><tt>doc</tt></i>:</span></td>
792<td>a parsed document tree</td>
793</tr>
794<tr>
795<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
796<td>0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.</td>
797</tr>
798</tbody>
799</table></div>
800</div>
801<hr>
802<div class="refsect2" lang="en">
803<h3>
804<a name="xmlSchemaValidateFile"></a>xmlSchemaValidateFile ()</h3>
805<pre class="programlisting">int	xmlSchemaValidateFile		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 const char * filename, <br>					 int options)<br>
806</pre>
807<p>Do a schemas validation of the given resource, it will use the SAX streamable validation internally.</p>
808<div class="variablelist"><table border="0">
809<col align="left">
810<tbody>
811<tr>
812<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
813<td>a schema validation context</td>
814</tr>
815<tr>
816<td><span class="term"><i><tt>filename</tt></i>:</span></td>
817<td>the URI of the instance</td>
818</tr>
819<tr>
820<td><span class="term"><i><tt>options</tt></i>:</span></td>
821<td>a future set of options, currently unused</td>
822</tr>
823<tr>
824<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
825<td>0 if the document is valid, a positive error code number otherwise and -1 in case of an internal or API error.</td>
826</tr>
827</tbody>
828</table></div>
829</div>
830<hr>
831<div class="refsect2" lang="en">
832<h3>
833<a name="xmlSchemaValidateOneElement"></a>xmlSchemaValidateOneElement ()</h3>
834<pre class="programlisting">int	xmlSchemaValidateOneElement	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem)<br>
835</pre>
836<p>Validate a branch of a tree, starting with the given @elem.</p>
837<div class="variablelist"><table border="0">
838<col align="left">
839<tbody>
840<tr>
841<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
842<td>a schema validation context</td>
843</tr>
844<tr>
845<td><span class="term"><i><tt>elem</tt></i>:</span></td>
846<td>an element node</td>
847</tr>
848<tr>
849<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
850<td>0 if the element and its subtree is valid, a positive error code number otherwise and -1 in case of an internal or API error.</td>
851</tr>
852</tbody>
853</table></div>
854</div>
855<hr>
856<div class="refsect2" lang="en">
857<h3>
858<a name="xmlSchemaValidateSetFilename"></a>xmlSchemaValidateSetFilename ()</h3>
859<pre class="programlisting">void	xmlSchemaValidateSetFilename	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> vctxt, <br>					 const char * filename)<br>
860</pre>
861<p>Workaround to provide file error reporting information when this is not provided by current APIs</p>
862<div class="variablelist"><table border="0">
863<col align="left">
864<tbody>
865<tr>
866<td><span class="term"><i><tt>vctxt</tt></i>:</span></td>
867<td>the schema validation context</td>
868</tr>
869<tr>
870<td><span class="term"><i><tt>filename</tt></i>:</span></td>
871<td>the file name</td>
872</tr>
873</tbody>
874</table></div>
875</div>
876<hr>
877<div class="refsect2" lang="en">
878<h3>
879<a name="xmlSchemaValidateSetLocator"></a>xmlSchemaValidateSetLocator ()</h3>
880<pre class="programlisting">void	xmlSchemaValidateSetLocator	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> vctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityLocatorFunc">xmlSchemaValidityLocatorFunc</a> f, <br>					 void * ctxt)<br>
881</pre>
882<p>Allows to set a locator function to the validation context, which will be used to provide file and line information since those are not provided as part of the SAX validation flow Setting @f to NULL disable the locator.</p>
883<div class="variablelist"><table border="0">
884<col align="left">
885<tbody>
886<tr>
887<td><span class="term"><i><tt>vctxt</tt></i>:</span></td>
888<td>a schema validation context</td>
889</tr>
890<tr>
891<td><span class="term"><i><tt>f</tt></i>:</span></td>
892<td>the locator function pointer</td>
893</tr>
894<tr>
895<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
896<td>the locator context</td>
897</tr>
898</tbody>
899</table></div>
900</div>
901<hr>
902<div class="refsect2" lang="en">
903<h3>
904<a name="xmlSchemaValidateStream"></a>xmlSchemaValidateStream ()</h3>
905<pre class="programlisting">int	xmlSchemaValidateStream		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br>					 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br>					 <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>					 void * user_data)<br>
906</pre>
907<p>Validate an input based on a flow of SAX event from the parser and forward the events to the @sax handler with the provided @user_data the user provided @sax handler must be a SAX2 one.</p>
908<div class="variablelist"><table border="0">
909<col align="left">
910<tbody>
911<tr>
912<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
913<td>a schema validation context</td>
914</tr>
915<tr>
916<td><span class="term"><i><tt>input</tt></i>:</span></td>
917<td>the input to use for reading the data</td>
918</tr>
919<tr>
920<td><span class="term"><i><tt>enc</tt></i>:</span></td>
921<td>an optional encoding information</td>
922</tr>
923<tr>
924<td><span class="term"><i><tt>sax</tt></i>:</span></td>
925<td>a SAX handler for the resulting events</td>
926</tr>
927<tr>
928<td><span class="term"><i><tt>user_data</tt></i>:</span></td>
929<td>the context to provide to the SAX handler.</td>
930</tr>
931<tr>
932<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
933<td>0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.</td>
934</tr>
935</tbody>
936</table></div>
937</div>
938<hr>
939</div>
940</div>
941</body>
942</html>
943