|
root / base / usr / src / contrib / libxml2 / doc / devhelp / libxml2-schematron.html
libxml2-schematron.html HTML 383 lines 16.2 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>schematron: XML Schematron implementation</title>
<meta name="generator" content="Libxml2 devhelp stylesheet">
<link rel="start" href="index.html" title="libxml2 Reference Manual">
<link rel="up" href="general.html" title="API">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="general.html" title="API">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="libxml2-schemasInternals.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<td><a accesskey="n" href="libxml2-threads.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
<th width="100%" align="center">libxml2 Reference Manual</th>
</tr></table>
<h2><span class="refentrytitle">schematron</span></h2>
<p>schematron - XML Schematron implementation</p>
<p>interface to the XML Schematron validity checking. </p>
<p>Author(s): Daniel Veillard </p>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">typedef struct _xmlSchematron <a href="#xmlSchematron">xmlSchematron</a>;
typedef struct _xmlSchematronParserCtxt <a href="#xmlSchematronParserCtxt">xmlSchematronParserCtxt</a>;
typedef <a href="libxml2-schematron.html#xmlSchematronParserCtxt">xmlSchematronParserCtxt</a> * <a href="#xmlSchematronParserCtxtPtr">xmlSchematronParserCtxtPtr</a>;
typedef <a href="libxml2-schematron.html#xmlSchematron">xmlSchematron</a> * <a href="#xmlSchematronPtr">xmlSchematronPtr</a>;
typedef struct _xmlSchematronValidCtxt <a href="#xmlSchematronValidCtxt">xmlSchematronValidCtxt</a>;
typedef <a href="libxml2-schematron.html#xmlSchematronValidCtxt">xmlSchematronValidCtxt</a> * <a href="#xmlSchematronValidCtxtPtr">xmlSchematronValidCtxtPtr</a>;
typedef enum <a href="#xmlSchematronValidOptions">xmlSchematronValidOptions</a>;
void	<a href="#xmlSchematronFree">xmlSchematronFree</a>		(<a href="libxml2-schematron.html#xmlSchematronPtr">xmlSchematronPtr</a> schema);
void	<a href="#xmlSchematronFreeParserCtxt">xmlSchematronFreeParserCtxt</a>	(<a href="libxml2-schematron.html#xmlSchematronParserCtxtPtr">xmlSchematronParserCtxtPtr</a> ctxt);
void	<a href="#xmlSchematronFreeValidCtxt">xmlSchematronFreeValidCtxt</a>	(<a href="libxml2-schematron.html#xmlSchematronValidCtxtPtr">xmlSchematronValidCtxtPtr</a> ctxt);
<a href="libxml2-schematron.html#xmlSchematronParserCtxtPtr">xmlSchematronParserCtxtPtr</a>	<a href="#xmlSchematronNewDocParserCtxt">xmlSchematronNewDocParserCtxt</a>	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
<a href="libxml2-schematron.html#xmlSchematronParserCtxtPtr">xmlSchematronParserCtxtPtr</a>	<a href="#xmlSchematronNewMemParserCtxt">xmlSchematronNewMemParserCtxt</a>	(const char * buffer, <br>							 int size);
<a href="libxml2-schematron.html#xmlSchematronParserCtxtPtr">xmlSchematronParserCtxtPtr</a>	<a href="#xmlSchematronNewParserCtxt">xmlSchematronNewParserCtxt</a>	(const char * URL);
<a href="libxml2-schematron.html#xmlSchematronValidCtxtPtr">xmlSchematronValidCtxtPtr</a>	<a href="#xmlSchematronNewValidCtxt">xmlSchematronNewValidCtxt</a>	(<a href="libxml2-schematron.html#xmlSchematronPtr">xmlSchematronPtr</a> schema, <br>							 int options);
<a href="libxml2-schematron.html#xmlSchematronPtr">xmlSchematronPtr</a>	<a href="#xmlSchematronParse">xmlSchematronParse</a>	(<a href="libxml2-schematron.html#xmlSchematronParserCtxtPtr">xmlSchematronParserCtxtPtr</a> ctxt);
void	<a href="#xmlSchematronSetValidStructuredErrors">xmlSchematronSetValidStructuredErrors</a>	(<a href="libxml2-schematron.html#xmlSchematronValidCtxtPtr">xmlSchematronValidCtxtPtr</a> ctxt, <br>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br>						 void * ctx);
int	<a href="#xmlSchematronValidateDoc">xmlSchematronValidateDoc</a>	(<a href="libxml2-schematron.html#xmlSchematronValidCtxtPtr">xmlSchematronValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> instance);
typedef void <a href="#xmlSchematronValidityErrorFunc">xmlSchematronValidityErrorFunc</a>	(void * ctx, <br>					 const char * msg, <br>					 ... ...);
typedef void <a href="#xmlSchematronValidityWarningFunc">xmlSchematronValidityWarningFunc</a>	(void * ctx, <br>						 const char * msg, <br>						 ... ...);
</pre>
</div>
<div class="refsect1" lang="en"><h2>Description</h2></div>
<div class="refsect1" lang="en">
<h2>Details</h2>
<div class="refsect2" lang="en">
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematron">Structure </a>xmlSchematron</h3>
<pre class="programlisting">struct _xmlSchematron {
The content of this structure is not made public by the API.
} xmlSchematron;
</pre>
<p></p>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronParserCtxt">Structure </a>xmlSchematronParserCtxt</h3>
<pre class="programlisting">struct _xmlSchematronParserCtxt {
The content of this structure is not made public by the API.
} xmlSchematronParserCtxt;
</pre>
<p></p>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronParserCtxtPtr">Typedef </a>xmlSchematronParserCtxtPtr</h3>
<pre class="programlisting"><a href="libxml2-schematron.html#xmlSchematronParserCtxt">xmlSchematronParserCtxt</a> * xmlSchematronParserCtxtPtr;
</pre>
<p></p>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronPtr">Typedef </a>xmlSchematronPtr</h3>
<pre class="programlisting"><a href="libxml2-schematron.html#xmlSchematron">xmlSchematron</a> * xmlSchematronPtr;
</pre>
<p></p>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronValidCtxt">Structure </a>xmlSchematronValidCtxt</h3>
<pre class="programlisting">struct _xmlSchematronValidCtxt {
The content of this structure is not made public by the API.
} xmlSchematronValidCtxt;
</pre>
<p></p>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronValidCtxtPtr">Typedef </a>xmlSchematronValidCtxtPtr</h3>
<pre class="programlisting"><a href="libxml2-schematron.html#xmlSchematronValidCtxt">xmlSchematronValidCtxt</a> * xmlSchematronValidCtxtPtr;
</pre>
<p></p>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronValidOptions">Enum </a>xmlSchematronValidOptions</h3>
<pre class="programlisting">enum <a href="#xmlSchematronValidOptions">xmlSchematronValidOptions</a> {
    <a name="XML_SCHEMATRON_OUT_QUIET">XML_SCHEMATRON_OUT_QUIET</a> = 1 /* quiet no report */
    <a name="XML_SCHEMATRON_OUT_TEXT">XML_SCHEMATRON_OUT_TEXT</a> = 2 /* build a textual report */
    <a name="XML_SCHEMATRON_OUT_XML">XML_SCHEMATRON_OUT_XML</a> = 4 /* output SVRL */
    <a name="XML_SCHEMATRON_OUT_ERROR">XML_SCHEMATRON_OUT_ERROR</a> = 8 /* output via xmlStructuredErrorFunc */
    <a name="XML_SCHEMATRON_OUT_FILE">XML_SCHEMATRON_OUT_FILE</a> = 256 /* output to a file descriptor */
    <a name="XML_SCHEMATRON_OUT_BUFFER">XML_SCHEMATRON_OUT_BUFFER</a> = 512 /* output to a buffer */
    <a name="XML_SCHEMATRON_OUT_IO">XML_SCHEMATRON_OUT_IO</a> = 1024 /*  output to I/O mechanism */
};
</pre>
<p></p>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronValidityErrorFunc"></a>Function type xmlSchematronValidityErrorFunc</h3>
<pre class="programlisting">void	xmlSchematronValidityErrorFunc	(void * ctx, <br>					 const char * msg, <br>					 ... ...)<br>
</pre>
<p>Signature of an error callback from a Schematron validation</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
<tr>
<td><span class="term"><i><tt>ctx</tt></i>:</span></td>
<td>the validation context</td>
</tr>
<tr>
<td><span class="term"><i><tt>msg</tt></i>:</span></td>
<td>the message</td>
</tr>
<tr>
<td><span class="term"><i><tt>...</tt></i>:</span></td>
<td>extra arguments</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronValidityWarningFunc"></a>Function type xmlSchematronValidityWarningFunc</h3>
<pre class="programlisting">void	xmlSchematronValidityWarningFunc	(void * ctx, <br>						 const char * msg, <br>						 ... ...)<br>
</pre>
<p>Signature of a warning callback from a Schematron validation</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
<tr>
<td><span class="term"><i><tt>ctx</tt></i>:</span></td>
<td>the validation context</td>
</tr>
<tr>
<td><span class="term"><i><tt>msg</tt></i>:</span></td>
<td>the message</td>
</tr>
<tr>
<td><span class="term"><i><tt>...</tt></i>:</span></td>
<td>extra arguments</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronFree"></a>xmlSchematronFree ()</h3>
<pre class="programlisting">void	xmlSchematronFree		(<a href="libxml2-schematron.html#xmlSchematronPtr">xmlSchematronPtr</a> schema)<br>
</pre>
<p>Deallocate a Schematron structure.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
<td><span class="term"><i><tt>schema</tt></i>:</span></td>
<td>a schema structure</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronFreeParserCtxt"></a>xmlSchematronFreeParserCtxt ()</h3>
<pre class="programlisting">void	xmlSchematronFreeParserCtxt	(<a href="libxml2-schematron.html#xmlSchematronParserCtxtPtr">xmlSchematronParserCtxtPtr</a> ctxt)<br>
</pre>
<p>Free the resources associated to the schema parser context</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
<td>the schema parser context</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronFreeValidCtxt"></a>xmlSchematronFreeValidCtxt ()</h3>
<pre class="programlisting">void	xmlSchematronFreeValidCtxt	(<a href="libxml2-schematron.html#xmlSchematronValidCtxtPtr">xmlSchematronValidCtxtPtr</a> ctxt)<br>
</pre>
<p>Free the resources associated to the schema validation context</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
<td>the schema validation context</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronNewDocParserCtxt"></a>xmlSchematronNewDocParserCtxt ()</h3>
<pre class="programlisting"><a href="libxml2-schematron.html#xmlSchematronParserCtxtPtr">xmlSchematronParserCtxtPtr</a>	xmlSchematronNewDocParserCtxt	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br>
</pre>
<p>Create an XML Schematrons parse context for that document. NB. The document may be modified during the parsing process.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
<tr>
<td><span class="term"><i><tt>doc</tt></i>:</span></td>
<td>a preparsed document tree</td>
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
<td>the parser context or NULL in case of error</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronNewMemParserCtxt"></a>xmlSchematronNewMemParserCtxt ()</h3>
<pre class="programlisting"><a href="libxml2-schematron.html#xmlSchematronParserCtxtPtr">xmlSchematronParserCtxtPtr</a>	xmlSchematronNewMemParserCtxt	(const char * buffer, <br>							 int size)<br>
</pre>
<p>Create an XML Schematrons parse context for that memory buffer expected to contain an XML Schematrons file.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
<tr>
<td><span class="term"><i><tt>buffer</tt></i>:</span></td>
<td>a pointer to a char array containing the schemas</td>
</tr>
<tr>
<td><span class="term"><i><tt>size</tt></i>:</span></td>
<td>the size of the array</td>
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
<td>the parser context or NULL in case of error</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronNewParserCtxt"></a>xmlSchematronNewParserCtxt ()</h3>
<pre class="programlisting"><a href="libxml2-schematron.html#xmlSchematronParserCtxtPtr">xmlSchematronParserCtxtPtr</a>	xmlSchematronNewParserCtxt	(const char * URL)<br>
</pre>
<p>Create an XML Schematrons parse context for that file/resource expected to contain an XML Schematrons file.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
<tr>
<td><span class="term"><i><tt>URL</tt></i>:</span></td>
<td>the location of the schema</td>
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
<td>the parser context or NULL in case of error</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronNewValidCtxt"></a>xmlSchematronNewValidCtxt ()</h3>
<pre class="programlisting"><a href="libxml2-schematron.html#xmlSchematronValidCtxtPtr">xmlSchematronValidCtxtPtr</a>	xmlSchematronNewValidCtxt	(<a href="libxml2-schematron.html#xmlSchematronPtr">xmlSchematronPtr</a> schema, <br>							 int options)<br>
</pre>
<p>Create an XML Schematrons validation context based on the given schema.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
<tr>
<td><span class="term"><i><tt>schema</tt></i>:</span></td>
<td>a precompiled XML Schematrons</td>
</tr>
<tr>
<td><span class="term"><i><tt>options</tt></i>:</span></td>
<td>a set of <a href="libxml2-schematron.html#xmlSchematronValidOptions">xmlSchematronValidOptions</a>
</td>
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
<td>the validation context or NULL in case of error</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronParse"></a>xmlSchematronParse ()</h3>
<pre class="programlisting"><a href="libxml2-schematron.html#xmlSchematronPtr">xmlSchematronPtr</a>	xmlSchematronParse	(<a href="libxml2-schematron.html#xmlSchematronParserCtxtPtr">xmlSchematronParserCtxtPtr</a> ctxt)<br>
</pre>
<p>parse a schema definition resource and build an internal XML Schema structure which can be used to validate instances.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
<tr>
<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
<td>a schema validation context</td>
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
<td>the internal XML Schematron structure built from the resource or NULL in case of error</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronSetValidStructuredErrors"></a>xmlSchematronSetValidStructuredErrors ()</h3>
<pre class="programlisting">void	xmlSchematronSetValidStructuredErrors	(<a href="libxml2-schematron.html#xmlSchematronValidCtxtPtr">xmlSchematronValidCtxtPtr</a> ctxt, <br>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br>						 void * ctx)<br>
</pre>
<p>Set the structured error callback</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
<tr>
<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
<td>a Schematron validation context</td>
</tr>
<tr>
<td><span class="term"><i><tt>serror</tt></i>:</span></td>
<td>the structured error function</td>
</tr>
<tr>
<td><span class="term"><i><tt>ctx</tt></i>:</span></td>
<td>the functions context</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchematronValidateDoc"></a>xmlSchematronValidateDoc ()</h3>
<pre class="programlisting">int	xmlSchematronValidateDoc	(<a href="libxml2-schematron.html#xmlSchematronValidCtxtPtr">xmlSchematronValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> instance)<br>
</pre>
<p>Validate a tree instance against the schematron</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
<tr>
<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
<td>the schema validation context</td>
</tr>
<tr>
<td><span class="term"><i><tt>instance</tt></i>:</span></td>
<td>the document instance tree</td>
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
<td>0 in case of success, -1 in case of internal error and an error count otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
</div>
</div>
</body>
</html>