blob: a404dab146f7d42c6068da09d0c22de534a46e8a [file] [log] [blame]
Daniel Veillard2fdbd322003-08-18 12:15:38 +00001<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xmlerror</title><meta name="generator" content="DocBook XSL Stylesheets V1.58.1"><style xmlns="http://www.w3.org/TR/xhtml1/transitional" type="text/css">
Daniel Veillardd4330462003-04-29 12:40:16 +00002 .synopsis, .classsynopsis {
3 background: #eeeeee;
4 border: solid 1px #aaaaaa;
5 padding: 0.5em;
6 }
7 .programlisting {
8 background: #eeeeff;
9 border: solid 1px #aaaaff;
10 padding: 0.5em;
11 }
12 .variablelist {
13 padding: 4px;
14 margin-left: 3em;
15 }
16 .navigation {
17 background: #ffeeee;
18 border: solid 1px #ffaaaa;
19 margin-top: 0.5em;
20 margin-bottom: 0.5em;
21 }
22 .navigation a {
23 color: #770000;
24 }
25 .navigation a:visited {
26 color: #550000;
27 }
28 .navigation .title {
29 font-size: 200%;
30 }
Daniel Veillard2fdbd322003-08-18 12:15:38 +000031 </style><link rel="home" href="index.html" title="Gnome XML Library Reference Manual"><link rel="up" href="libxml-lib.html" title="Libxml Library Reference"><link rel="previous" href="libxml-uri.html" title="uri"><link rel="next" href="libxml-HTMLparser.html" title="HTMLparser"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-uri.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td><td><a accesskey="u" href="libxml-lib.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td><th width="100%" align="center">Gnome XML Library Reference Manual</th><td><a accesskey="n" href="libxml-HTMLparser.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td></tr></table><div class="refentry" lang="en"><a name="libxml-xmlerror"></a><div class="titlepage"></div><div class="refnamediv"><h2>xmlerror</h2><p>xmlerror &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
Daniel Veillard7d6fd212001-05-10 15:34:11 +000032
Daniel Veillardd4330462003-04-29 12:40:16 +000033
34
35enum <a href="libxml-xmlerror.html#xmlParserErrors">xmlParserErrors</a>;
36void (<a href="libxml-xmlerror.html#xmlGenericErrorFunc">*xmlGenericErrorFunc</a>) (void *ctx,
Daniel Veillard7d6fd212001-05-10 15:34:11 +000037 const char *msg,
38 ...);
Daniel Veillardd4330462003-04-29 12:40:16 +000039void <a href="libxml-xmlerror.html#xmlSetGenericErrorFunc">xmlSetGenericErrorFunc</a> (void *ctx,
40 <a href="libxml-xmlerror.html#xmlGenericErrorFunc">xmlGenericErrorFunc</a> handler);
41void <a href="libxml-xmlerror.html#initGenericErrorDefaultFunc">initGenericErrorDefaultFunc</a> (<a href="libxml-xmlerror.html#xmlGenericErrorFunc">xmlGenericErrorFunc</a> *handler);
42void <a href="libxml-xmlerror.html#xmlParserError">xmlParserError</a> (void *ctx,
Daniel Veillard7d6fd212001-05-10 15:34:11 +000043 const char *msg,
44 ...);
Daniel Veillardd4330462003-04-29 12:40:16 +000045void <a href="libxml-xmlerror.html#xmlParserWarning">xmlParserWarning</a> (void *ctx,
Daniel Veillard7d6fd212001-05-10 15:34:11 +000046 const char *msg,
47 ...);
Daniel Veillardd4330462003-04-29 12:40:16 +000048void <a href="libxml-xmlerror.html#xmlParserValidityError">xmlParserValidityError</a> (void *ctx,
Daniel Veillard7d6fd212001-05-10 15:34:11 +000049 const char *msg,
50 ...);
Daniel Veillardd4330462003-04-29 12:40:16 +000051void <a href="libxml-xmlerror.html#xmlParserValidityWarning">xmlParserValidityWarning</a> (void *ctx,
Daniel Veillard7d6fd212001-05-10 15:34:11 +000052 const char *msg,
53 ...);
Daniel Veillardd4330462003-04-29 12:40:16 +000054void <a href="libxml-xmlerror.html#xmlParserPrintFileInfo">xmlParserPrintFileInfo</a> (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input);
55void <a href="libxml-xmlerror.html#xmlParserPrintFileContext">xmlParserPrintFileContext</a> (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input);
56</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
57
58</p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="xmlParserErrors"></a>enum xmlParserErrors</h3><pre class="programlisting">typedef enum {
Daniel Veillard7d6fd212001-05-10 15:34:11 +000059 XML_ERR_OK = 0,
60 XML_ERR_INTERNAL_ERROR,
61 XML_ERR_NO_MEMORY,
62
63 XML_ERR_DOCUMENT_START, /* 3 */
64 XML_ERR_DOCUMENT_EMPTY,
65 XML_ERR_DOCUMENT_END,
66
67 XML_ERR_INVALID_HEX_CHARREF, /* 6 */
68 XML_ERR_INVALID_DEC_CHARREF,
69 XML_ERR_INVALID_CHARREF,
70 XML_ERR_INVALID_CHAR,
71
72 XML_ERR_CHARREF_AT_EOF, /* 10 */
73 XML_ERR_CHARREF_IN_PROLOG,
74 XML_ERR_CHARREF_IN_EPILOG,
75 XML_ERR_CHARREF_IN_DTD,
76 XML_ERR_ENTITYREF_AT_EOF,
77 XML_ERR_ENTITYREF_IN_PROLOG,
78 XML_ERR_ENTITYREF_IN_EPILOG,
79 XML_ERR_ENTITYREF_IN_DTD,
80 XML_ERR_PEREF_AT_EOF,
81 XML_ERR_PEREF_IN_PROLOG,
82 XML_ERR_PEREF_IN_EPILOG,
83 XML_ERR_PEREF_IN_INT_SUBSET,
84
85 XML_ERR_ENTITYREF_NO_NAME, /* 22 */
86 XML_ERR_ENTITYREF_SEMICOL_MISSING,
87
88 XML_ERR_PEREF_NO_NAME, /* 24 */
89 XML_ERR_PEREF_SEMICOL_MISSING,
90
91 XML_ERR_UNDECLARED_ENTITY, /* 26 */
92 XML_WAR_UNDECLARED_ENTITY,
93 XML_ERR_UNPARSED_ENTITY,
94 XML_ERR_ENTITY_IS_EXTERNAL,
95 XML_ERR_ENTITY_IS_PARAMETER,
96
97 XML_ERR_UNKNOWN_ENCODING, /* 31 */
98 XML_ERR_UNSUPPORTED_ENCODING,
99
100 XML_ERR_STRING_NOT_STARTED, /* 33 */
101 XML_ERR_STRING_NOT_CLOSED,
102 XML_ERR_NS_DECL_ERROR,
103
104 XML_ERR_ENTITY_NOT_STARTED, /* 36 */
105 XML_ERR_ENTITY_NOT_FINISHED,
106
107 XML_ERR_LT_IN_ATTRIBUTE, /* 38 */
108 XML_ERR_ATTRIBUTE_NOT_STARTED,
109 XML_ERR_ATTRIBUTE_NOT_FINISHED,
110 XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
111 XML_ERR_ATTRIBUTE_REDEFINED,
112
113 XML_ERR_LITERAL_NOT_STARTED, /* 43 */
114 XML_ERR_LITERAL_NOT_FINISHED,
115
116 XML_ERR_COMMENT_NOT_FINISHED, /* 45 */
117
118 XML_ERR_PI_NOT_STARTED, /* 47 */
119 XML_ERR_PI_NOT_FINISHED,
120
121 XML_ERR_NOTATION_NOT_STARTED, /* 49 */
122 XML_ERR_NOTATION_NOT_FINISHED,
123
124 XML_ERR_ATTLIST_NOT_STARTED, /* 51 */
125 XML_ERR_ATTLIST_NOT_FINISHED,
126
127 XML_ERR_MIXED_NOT_STARTED, /* 53 */
128 XML_ERR_MIXED_NOT_FINISHED,
129
130 XML_ERR_ELEMCONTENT_NOT_STARTED, /* 55 */
131 XML_ERR_ELEMCONTENT_NOT_FINISHED,
132
133 XML_ERR_XMLDECL_NOT_STARTED, /* 57 */
134 XML_ERR_XMLDECL_NOT_FINISHED,
135
136 XML_ERR_CONDSEC_NOT_STARTED, /* 59 */
137 XML_ERR_CONDSEC_NOT_FINISHED,
138
139 XML_ERR_EXT_SUBSET_NOT_FINISHED, /* 61 */
140
141 XML_ERR_DOCTYPE_NOT_FINISHED, /* 62 */
142
143 XML_ERR_MISPLACED_CDATA_END, /* 63 */
144 XML_ERR_CDATA_NOT_FINISHED,
145
146 XML_ERR_RESERVED_XML_NAME, /* 65 */
147
148 XML_ERR_SPACE_REQUIRED, /* 66 */
149 XML_ERR_SEPARATOR_REQUIRED,
150 XML_ERR_NMTOKEN_REQUIRED,
151 XML_ERR_NAME_REQUIRED,
152 XML_ERR_PCDATA_REQUIRED,
153 XML_ERR_URI_REQUIRED,
154 XML_ERR_PUBID_REQUIRED,
155 XML_ERR_LT_REQUIRED,
156 XML_ERR_GT_REQUIRED,
157 XML_ERR_LTSLASH_REQUIRED,
158 XML_ERR_EQUAL_REQUIRED,
159
160 XML_ERR_TAG_NAME_MISMATCH, /* 77 */
Daniel Veillard744683d2002-01-14 17:30:20 +0000161 XML_ERR_TAG_NOT_FINISHED,
Daniel Veillard7d6fd212001-05-10 15:34:11 +0000162
163 XML_ERR_STANDALONE_VALUE, /* 79 */
164
165 XML_ERR_ENCODING_NAME, /* 80 */
166
167 XML_ERR_HYPHEN_IN_COMMENT, /* 81 */
168
169 XML_ERR_INVALID_ENCODING, /* 82 */
170
171 XML_ERR_EXT_ENTITY_STANDALONE, /* 83 */
172
173 XML_ERR_CONDSEC_INVALID, /* 84 */
174
175 XML_ERR_VALUE_REQUIRED, /* 85 */
176
177 XML_ERR_NOT_WELL_BALANCED, /* 86 */
178 XML_ERR_EXTRA_CONTENT, /* 87 */
179 XML_ERR_ENTITY_CHAR_ERROR, /* 88 */
180 XML_ERR_ENTITY_PE_INTERNAL, /* 88 */
181 XML_ERR_ENTITY_LOOP, /* 89 */
182 XML_ERR_ENTITY_BOUNDARY, /* 90 */
183 XML_ERR_INVALID_URI, /* 91 */
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000184 XML_ERR_URI_FRAGMENT, /* 92 */
Daniel Veillard04382ae2001-09-12 18:51:30 +0000185 XML_WAR_CATALOG_PI, /* 93 */
186 XML_ERR_NO_DTD /* 94 */
Daniel Veillardd4330462003-04-29 12:40:16 +0000187}xmlParserErrors;
188</pre><p>
189
190</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlGenericErrorFunc"></a>xmlGenericErrorFunc ()</h3><pre class="programlisting">void (*xmlGenericErrorFunc) (void *ctx,
Daniel Veillard7d6fd212001-05-10 15:34:11 +0000191 const char *msg,
Daniel Veillardd4330462003-04-29 12:40:16 +0000192 ...);</pre><p>
193Signature of the function to use when there is an error and
194no parsing or validity context available .</p><p>
195
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000196</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> a parsing context
197</td></tr><tr><td><span class="term"><i><tt>msg</tt></i> :</span></td><td> the message
198</td></tr><tr><td><span class="term"><i><tt>...</tt></i> :</span></td><td> the extra arguments of the varags to format the message
Daniel Veillardd4330462003-04-29 12:40:16 +0000199</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSetGenericErrorFunc"></a>xmlSetGenericErrorFunc ()</h3><pre class="programlisting">void xmlSetGenericErrorFunc (void *ctx,
200 <a href="libxml-xmlerror.html#xmlGenericErrorFunc">xmlGenericErrorFunc</a> handler);</pre><p>
201Function to reset the handler and the error context for out of
Daniel Veillard7d6fd212001-05-10 15:34:11 +0000202context error messages.
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000203This simply means that <i><tt>handler</tt></i> will be called for subsequent
204error messages while not parsing nor validating. And <i><tt>ctx</tt></i> will
205be passed as first argument to <i><tt>handler</tt></i>
Daniel Veillard7d6fd212001-05-10 15:34:11 +0000206One can simply force messages to be emitted to another FILE * than
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000207stderr by setting <i><tt>ctx</tt></i> to this file handle and <i><tt>handler</tt></i> to NULL.</p><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000208
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000209</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> the new error handling context
210</td></tr><tr><td><span class="term"><i><tt>handler</tt></i> :</span></td><td> the new handler function
Daniel Veillardd4330462003-04-29 12:40:16 +0000211</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="initGenericErrorDefaultFunc"></a>initGenericErrorDefaultFunc ()</h3><pre class="programlisting">void initGenericErrorDefaultFunc (<a href="libxml-xmlerror.html#xmlGenericErrorFunc">xmlGenericErrorFunc</a> *handler);</pre><p>
212Set or reset (if NULL) the default handler for generic errors
213to the builtin error function.</p><p>
214
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000215</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>handler</tt></i> :</span></td><td> the handler
Daniel Veillardd4330462003-04-29 12:40:16 +0000216</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserError"></a>xmlParserError ()</h3><pre class="programlisting">void xmlParserError (void *ctx,
Daniel Veillard7d6fd212001-05-10 15:34:11 +0000217 const char *msg,
Daniel Veillardd4330462003-04-29 12:40:16 +0000218 ...);</pre><p>
219Display and format an error messages, gives file, line, position and
220extra parameters.</p><p>
221
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000222</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an XML parser context
223</td></tr><tr><td><span class="term"><i><tt>msg</tt></i> :</span></td><td> the message to display/transmit
224</td></tr><tr><td><span class="term"><i><tt>...</tt></i> :</span></td><td> extra parameters for the message display
Daniel Veillardd4330462003-04-29 12:40:16 +0000225</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserWarning"></a>xmlParserWarning ()</h3><pre class="programlisting">void xmlParserWarning (void *ctx,
Daniel Veillard7d6fd212001-05-10 15:34:11 +0000226 const char *msg,
Daniel Veillardd4330462003-04-29 12:40:16 +0000227 ...);</pre><p>
228Display and format a warning messages, gives file, line, position and
229extra parameters.</p><p>
230
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000231</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an XML parser context
232</td></tr><tr><td><span class="term"><i><tt>msg</tt></i> :</span></td><td> the message to display/transmit
233</td></tr><tr><td><span class="term"><i><tt>...</tt></i> :</span></td><td> extra parameters for the message display
Daniel Veillardd4330462003-04-29 12:40:16 +0000234</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserValidityError"></a>xmlParserValidityError ()</h3><pre class="programlisting">void xmlParserValidityError (void *ctx,
Daniel Veillard7d6fd212001-05-10 15:34:11 +0000235 const char *msg,
Daniel Veillardd4330462003-04-29 12:40:16 +0000236 ...);</pre><p>
237Display and format an validity error messages, gives file,
238line, position and extra parameters.</p><p>
239
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000240</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an XML parser context
241</td></tr><tr><td><span class="term"><i><tt>msg</tt></i> :</span></td><td> the message to display/transmit
242</td></tr><tr><td><span class="term"><i><tt>...</tt></i> :</span></td><td> extra parameters for the message display
Daniel Veillardd4330462003-04-29 12:40:16 +0000243</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserValidityWarning"></a>xmlParserValidityWarning ()</h3><pre class="programlisting">void xmlParserValidityWarning (void *ctx,
Daniel Veillard7d6fd212001-05-10 15:34:11 +0000244 const char *msg,
Daniel Veillardd4330462003-04-29 12:40:16 +0000245 ...);</pre><p>
246Display and format a validity warning messages, gives file, line,
247position and extra parameters.</p><p>
248
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000249</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an XML parser context
250</td></tr><tr><td><span class="term"><i><tt>msg</tt></i> :</span></td><td> the message to display/transmit
251</td></tr><tr><td><span class="term"><i><tt>...</tt></i> :</span></td><td> extra parameters for the message display
Daniel Veillardd4330462003-04-29 12:40:16 +0000252</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserPrintFileInfo"></a>xmlParserPrintFileInfo ()</h3><pre class="programlisting">void xmlParserPrintFileInfo (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input);</pre><p>
253Displays the associated file and line informations for the current input</p><p>
254
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000255</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>input</tt></i> :</span></td><td> an xmlParserInputPtr input
Daniel Veillardd4330462003-04-29 12:40:16 +0000256</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserPrintFileContext"></a>xmlParserPrintFileContext ()</h3><pre class="programlisting">void xmlParserPrintFileContext (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input);</pre><p>
257Displays current context within the input content for error tracking</p><p>
258
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000259</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>input</tt></i> :</span></td><td> an xmlParserInputPtr input
260</td></tr></tbody></table></div></div></div></div><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libxml-uri.html"><b>&lt;&lt; uri</b></a></td><td align="right"><a accesskey="n" href="libxml-HTMLparser.html"><b>HTMLparser &gt;&gt;</b></a></td></tr></table></body></html>