blob: e5180fc3d5d33f18657966b876561de2ca8d340b [file] [log] [blame]
William M. Brackc6e07552003-08-16 12:44:47 +00001<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>parser</title><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><meta xmlns="http://www.w3.org/TR/xhtml1/transitional" name="generator" content="GTK-Doc V1.0 (XML mode)"></meta><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 }
William M. Brackc6e07552003-08-16 12:44:47 +000031 </style><link rel="home" href="index.html" title="[Insert name here] Reference Manual"><link rel="up" href="ch01.html" title="[Insert title here]"><link rel="previous" href="libxml-threads.html" title="threads"><link rel="next" href="libxml-c14n.html" title="c14n"></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-threads.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td><td><a accesskey="u" href="ch01.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">[Insert name here] Reference Manual</th><td><a accesskey="n" href="libxml-c14n.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-parser"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">parser</span></h2><p>parser &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
Daniel Veillard35925471999-02-25 08:46:07 +000032
Daniel Veillardd4330462003-04-29 12:40:16 +000033
34
35#define <a href="libxml-parser.html#XML-DEFAULT-VERSION-CAPS">XML_DEFAULT_VERSION</a>
36void (<a href="libxml-parser.html#xmlParserInputDeallocate">*xmlParserInputDeallocate</a>) (<a href="libxml-tree.html#xmlChar">xmlChar</a> *str);
37struct <a href="libxml-parser.html#xmlParserInput">xmlParserInput</a>;
38struct <a href="libxml-parser.html#xmlParserNodeInfo">xmlParserNodeInfo</a>;
39typedef <a href="libxml-parser.html#xmlParserNodeInfoPtr">xmlParserNodeInfoPtr</a>;
40struct <a href="libxml-parser.html#xmlParserNodeInfoSeq">xmlParserNodeInfoSeq</a>;
41typedef <a href="libxml-parser.html#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a>;
42enum <a href="libxml-parser.html#xmlParserInputState">xmlParserInputState</a>;
43#define <a href="libxml-parser.html#XML-DETECT-IDS-CAPS">XML_DETECT_IDS</a>
44#define <a href="libxml-parser.html#XML-COMPLETE-ATTRS-CAPS">XML_COMPLETE_ATTRS</a>
45#define <a href="libxml-parser.html#XML-SKIP-IDS-CAPS">XML_SKIP_IDS</a>
46struct <a href="libxml-parser.html#xmlParserCtxt">xmlParserCtxt</a>;
47struct <a href="libxml-parser.html#xmlSAXLocator">xmlSAXLocator</a>;
48<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> (<a href="libxml-parser.html#resolveEntitySAXFunc">*resolveEntitySAXFunc</a>) (void *ctx,
49 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId,
50 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId);
51void (<a href="libxml-parser.html#internalSubsetSAXFunc">*internalSubsetSAXFunc</a>) (void *ctx,
52 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
53 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID,
54 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);
55void (<a href="libxml-parser.html#externalSubsetSAXFunc">*externalSubsetSAXFunc</a>) (void *ctx,
56 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
57 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID,
58 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);
59<a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> (<a href="libxml-parser.html#getEntitySAXFunc">*getEntitySAXFunc</a>) (void *ctx,
60 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);
61<a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> (<a href="libxml-parser.html#getParameterEntitySAXFunc">*getParameterEntitySAXFunc</a>) (void *ctx,
62 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);
63void (<a href="libxml-parser.html#entityDeclSAXFunc">*entityDeclSAXFunc</a>) (void *ctx,
64 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
Daniel Veillard5099ae81999-04-21 20:12:07 +000065 int type,
Daniel Veillardd4330462003-04-29 12:40:16 +000066 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId,
67 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId,
68 <a href="libxml-tree.html#xmlChar">xmlChar</a> *content);
69void (<a href="libxml-parser.html#notationDeclSAXFunc">*notationDeclSAXFunc</a>) (void *ctx,
70 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
71 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId,
72 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId);
73void (<a href="libxml-parser.html#attributeDeclSAXFunc">*attributeDeclSAXFunc</a>) (void *ctx,
74 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *elem,
75 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *fullname,
Daniel Veillard5099ae81999-04-21 20:12:07 +000076 int type,
77 int def,
Daniel Veillardd4330462003-04-29 12:40:16 +000078 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *defaultValue,
79 <a href="libxml-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree);
80void (<a href="libxml-parser.html#elementDeclSAXFunc">*elementDeclSAXFunc</a>) (void *ctx,
81 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
Daniel Veillard5099ae81999-04-21 20:12:07 +000082 int type,
Daniel Veillardd4330462003-04-29 12:40:16 +000083 <a href="libxml-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> content);
84void (<a href="libxml-parser.html#unparsedEntityDeclSAXFunc">*unparsedEntityDeclSAXFunc</a>) (void *ctx,
85 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
86 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId,
87 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId,
88 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *notationName);
89void (<a href="libxml-parser.html#setDocumentLocatorSAXFunc">*setDocumentLocatorSAXFunc</a>) (void *ctx,
90 <a href="libxml-tree.html#xmlSAXLocatorPtr">xmlSAXLocatorPtr</a> loc);
91void (<a href="libxml-parser.html#startDocumentSAXFunc">*startDocumentSAXFunc</a>) (void *ctx);
92void (<a href="libxml-parser.html#endDocumentSAXFunc">*endDocumentSAXFunc</a>) (void *ctx);
93void (<a href="libxml-parser.html#startElementSAXFunc">*startElementSAXFunc</a>) (void *ctx,
94 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
95 const <a href="libxml-tree.html#xmlChar">xmlChar</a> **atts);
96void (<a href="libxml-parser.html#endElementSAXFunc">*endElementSAXFunc</a>) (void *ctx,
97 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);
98void (<a href="libxml-parser.html#attributeSAXFunc">*attributeSAXFunc</a>) (void *ctx,
99 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
100 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value);
101void (<a href="libxml-parser.html#referenceSAXFunc">*referenceSAXFunc</a>) (void *ctx,
102 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);
103void (<a href="libxml-parser.html#charactersSAXFunc">*charactersSAXFunc</a>) (void *ctx,
104 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch,
Daniel Veillard35925471999-02-25 08:46:07 +0000105 int len);
Daniel Veillardd4330462003-04-29 12:40:16 +0000106void (<a href="libxml-parser.html#ignorableWhitespaceSAXFunc">*ignorableWhitespaceSAXFunc</a>) (void *ctx,
107 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch,
Daniel Veillard35925471999-02-25 08:46:07 +0000108 int len);
Daniel Veillardd4330462003-04-29 12:40:16 +0000109void (<a href="libxml-parser.html#processingInstructionSAXFunc">*processingInstructionSAXFunc</a>) (void *ctx,
110 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *target,
111 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *data);
112void (<a href="libxml-parser.html#commentSAXFunc">*commentSAXFunc</a>) (void *ctx,
113 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value);
114void (<a href="libxml-parser.html#cdataBlockSAXFunc">*cdataBlockSAXFunc</a>) (void *ctx,
115 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value,
Daniel Veillardb05deb71999-08-10 19:04:08 +0000116 int len);
Daniel Veillardd4330462003-04-29 12:40:16 +0000117void (<a href="libxml-parser.html#warningSAXFunc">*warningSAXFunc</a>) (void *ctx,
Daniel Veillard35925471999-02-25 08:46:07 +0000118 const char *msg,
119 ...);
Daniel Veillardd4330462003-04-29 12:40:16 +0000120void (<a href="libxml-parser.html#errorSAXFunc">*errorSAXFunc</a>) (void *ctx,
Daniel Veillard35925471999-02-25 08:46:07 +0000121 const char *msg,
122 ...);
Daniel Veillardd4330462003-04-29 12:40:16 +0000123void (<a href="libxml-parser.html#fatalErrorSAXFunc">*fatalErrorSAXFunc</a>) (void *ctx,
Daniel Veillard35925471999-02-25 08:46:07 +0000124 const char *msg,
125 ...);
Daniel Veillardd4330462003-04-29 12:40:16 +0000126int (<a href="libxml-parser.html#isStandaloneSAXFunc">*isStandaloneSAXFunc</a>) (void *ctx);
127int (<a href="libxml-parser.html#hasInternalSubsetSAXFunc">*hasInternalSubsetSAXFunc</a>) (void *ctx);
128int (<a href="libxml-parser.html#hasExternalSubsetSAXFunc">*hasExternalSubsetSAXFunc</a>) (void *ctx);
129struct <a href="libxml-parser.html#xmlSAXHandler">xmlSAXHandler</a>;
130<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> (<a href="libxml-parser.html#xmlExternalEntityLoader">*xmlExternalEntityLoader</a>)
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000131 (const char *URL,
132 const char *ID,
Daniel Veillardd4330462003-04-29 12:40:16 +0000133 <a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> context);
134void <a href="libxml-parser.html#xmlInitParser">xmlInitParser</a> (void);
135void <a href="libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> (void);
136int <a href="libxml-parser.html#xmlParserInputRead">xmlParserInputRead</a> (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> in,
Daniel Veillarde2d034d1999-07-27 19:52:06 +0000137 int len);
Daniel Veillardd4330462003-04-29 12:40:16 +0000138int <a href="libxml-parser.html#xmlParserInputGrow">xmlParserInputGrow</a> (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> in,
Daniel Veillarde2d034d1999-07-27 19:52:06 +0000139 int len);
Daniel Veillardd4330462003-04-29 12:40:16 +0000140<a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-parser.html#xmlStrdup">xmlStrdup</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *cur);
141<a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-parser.html#xmlStrndup">xmlStrndup</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *cur,
Daniel Veillard35925471999-02-25 08:46:07 +0000142 int len);
Daniel Veillardd4330462003-04-29 12:40:16 +0000143<a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-parser.html#xmlCharStrndup">xmlCharStrndup</a> (const char *cur,
Daniel Veillarda41123c2001-04-22 19:31:20 +0000144 int len);
Daniel Veillardd4330462003-04-29 12:40:16 +0000145<a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-parser.html#xmlCharStrdup">xmlCharStrdup</a> (const char *cur);
146<a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-parser.html#xmlStrsub">xmlStrsub</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str,
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000147 int start,
148 int len);
Daniel Veillardd4330462003-04-29 12:40:16 +0000149const <a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-parser.html#xmlStrchr">xmlStrchr</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str,
150 <a href="libxml-tree.html#xmlChar">xmlChar</a> val);
151const <a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-parser.html#xmlStrstr">xmlStrstr</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str,
152 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *val);
153const <a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-parser.html#xmlStrcasestr">xmlStrcasestr</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str,
154 <a href="libxml-tree.html#xmlChar">xmlChar</a> *val);
155int <a href="libxml-parser.html#xmlStrcmp">xmlStrcmp</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str1,
156 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str2);
157int <a href="libxml-parser.html#xmlStrncmp">xmlStrncmp</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str1,
158 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str2,
Daniel Veillard35925471999-02-25 08:46:07 +0000159 int len);
Daniel Veillardd4330462003-04-29 12:40:16 +0000160int <a href="libxml-parser.html#xmlStrcasecmp">xmlStrcasecmp</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str1,
161 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str2);
162int <a href="libxml-parser.html#xmlStrncasecmp">xmlStrncasecmp</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str1,
163 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str2,
Daniel Veillard3bff2b02000-10-01 20:33:47 +0000164 int len);
Daniel Veillardd4330462003-04-29 12:40:16 +0000165int <a href="libxml-parser.html#xmlStrEqual">xmlStrEqual</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str1,
166 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str2);
167int <a href="libxml-parser.html#xmlStrlen">xmlStrlen</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str);
168<a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-parser.html#xmlStrcat">xmlStrcat</a> (<a href="libxml-tree.html#xmlChar">xmlChar</a> *cur,
169 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *add);
170<a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-parser.html#xmlStrncat">xmlStrncat</a> (<a href="libxml-tree.html#xmlChar">xmlChar</a> *cur,
171 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *add,
Daniel Veillard35925471999-02-25 08:46:07 +0000172 int len);
Daniel Veillardd4330462003-04-29 12:40:16 +0000173<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlParseDoc">xmlParseDoc</a> (<a href="libxml-tree.html#xmlChar">xmlChar</a> *cur);
174<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlParseMemory">xmlParseMemory</a> (const char *buffer,
Daniel Veillard35925471999-02-25 08:46:07 +0000175 int size);
Daniel Veillardd4330462003-04-29 12:40:16 +0000176<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlParseFile">xmlParseFile</a> (const char *filename);
177int <a href="libxml-parser.html#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault</a> (int val);
178int <a href="libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault</a> (int val);
179void <a href="libxml-parser.html#xmlStopParser">xmlStopParser</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
180int <a href="libxml-parser.html#xmlPedanticParserDefault">xmlPedanticParserDefault</a> (int val);
181int <a href="libxml-parser.html#xmlLineNumbersDefault">xmlLineNumbersDefault</a> (int val);
182<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlRecoverDoc">xmlRecoverDoc</a> (<a href="libxml-tree.html#xmlChar">xmlChar</a> *cur);
183<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlRecoverMemory">xmlRecoverMemory</a> (const char *buffer,
Daniel Veillard35925471999-02-25 08:46:07 +0000184 int size);
Daniel Veillardd4330462003-04-29 12:40:16 +0000185<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlRecoverFile">xmlRecoverFile</a> (const char *filename);
186int <a href="libxml-parser.html#xmlParseDocument">xmlParseDocument</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
187int <a href="libxml-parser.html#xmlParseExtParsedEnt">xmlParseExtParsedEnt</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
188<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlSAXParseDoc">xmlSAXParseDoc</a> (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
189 <a href="libxml-tree.html#xmlChar">xmlChar</a> *cur,
Daniel Veillard35925471999-02-25 08:46:07 +0000190 int recovery);
Daniel Veillardd4330462003-04-29 12:40:16 +0000191int <a href="libxml-parser.html#xmlSAXUserParseFile">xmlSAXUserParseFile</a> (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000192 void *user_data,
193 const char *filename);
Daniel Veillardd4330462003-04-29 12:40:16 +0000194int <a href="libxml-parser.html#xmlSAXUserParseMemory">xmlSAXUserParseMemory</a> (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000195 void *user_data,
Daniel Veillardbed7b052001-05-19 14:59:49 +0000196 const char *buffer,
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000197 int size);
Daniel Veillardd4330462003-04-29 12:40:16 +0000198<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlSAXParseMemory">xmlSAXParseMemory</a> (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000199 const char *buffer,
Daniel Veillard35925471999-02-25 08:46:07 +0000200 int size,
201 int recovery);
Daniel Veillardd4330462003-04-29 12:40:16 +0000202<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlSAXParseMemoryWithData">xmlSAXParseMemoryWithData</a> (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillardaec63562003-03-23 20:42:17 +0000203 const char *buffer,
204 int size,
205 int recovery,
206 void *data);
Daniel Veillardd4330462003-04-29 12:40:16 +0000207<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlSAXParseFile">xmlSAXParseFile</a> (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard35925471999-02-25 08:46:07 +0000208 const char *filename,
209 int recovery);
Daniel Veillardd4330462003-04-29 12:40:16 +0000210<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlSAXParseFileWithData">xmlSAXParseFileWithData</a> (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard60087f32001-10-10 09:45:09 +0000211 const char *filename,
212 int recovery,
213 void *data);
Daniel Veillardd4330462003-04-29 12:40:16 +0000214<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlSAXParseEntity">xmlSAXParseEntity</a> (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard3bff2b02000-10-01 20:33:47 +0000215 const char *filename);
Daniel Veillardd4330462003-04-29 12:40:16 +0000216<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="libxml-parser.html#xmlParseEntity">xmlParseEntity</a> (const char *filename);
217<a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> <a href="libxml-parser.html#xmlParseDTD">xmlParseDTD</a> (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID,
218 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);
219<a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> <a href="libxml-parser.html#xmlSAXParseDTD">xmlSAXParseDTD</a> (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
220 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID,
221 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);
222<a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> <a href="libxml-parser.html#xmlIOParseDTD">xmlIOParseDTD</a> (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
223 <a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input,
224 <a href="libxml-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc);
225int <a href="libxml-parser.html#xmlParseBalancedChunkMemory">xmlParseBalancedChunkMemory</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
226 <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000227 void *user_data,
228 int depth,
Daniel Veillardd4330462003-04-29 12:40:16 +0000229 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *string,
230 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> *lst);
231int <a href="libxml-parser.html#xmlParseBalancedChunkMemoryRecover">xmlParseBalancedChunkMemoryRecover</a>
232 (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
233 <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard2ace1952002-09-26 12:28:02 +0000234 void *user_data,
235 int depth,
Daniel Veillardd4330462003-04-29 12:40:16 +0000236 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *string,
237 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> *lst,
Daniel Veillard2ace1952002-09-26 12:28:02 +0000238 int recover);
Daniel Veillardd4330462003-04-29 12:40:16 +0000239int <a href="libxml-parser.html#xmlParseExternalEntity">xmlParseExternalEntity</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
240 <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000241 void *user_data,
242 int depth,
Daniel Veillardd4330462003-04-29 12:40:16 +0000243 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *URL,
244 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ID,
245 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> *lst);
246int <a href="libxml-parser.html#xmlParseCtxtExternalEntity">xmlParseCtxtExternalEntity</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctx,
247 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *URL,
248 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ID,
249 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> *lst);
250int <a href="libxml-parser.html#xmlInitParserCtxt">xmlInitParserCtxt</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
251void <a href="libxml-parser.html#xmlClearParserCtxt">xmlClearParserCtxt</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
252void <a href="libxml-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
253void <a href="libxml-parser.html#xmlSetupParserForBuffer">xmlSetupParserForBuffer</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
254 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *buffer,
Daniel Veillard35925471999-02-25 08:46:07 +0000255 const char *filename);
Daniel Veillardd4330462003-04-29 12:40:16 +0000256<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> <a href="libxml-parser.html#xmlCreateDocParserCtxt">xmlCreateDocParserCtxt</a> (<a href="libxml-tree.html#xmlChar">xmlChar</a> *cur);
257int <a href="libxml-parser.html#xmlGetFeaturesList">xmlGetFeaturesList</a> (int *len,
Daniel Veillard7c29ce22000-08-12 21:20:53 +0000258 const char **result);
Daniel Veillardd4330462003-04-29 12:40:16 +0000259int <a href="libxml-parser.html#xmlGetFeature">xmlGetFeature</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
Daniel Veillard7c29ce22000-08-12 21:20:53 +0000260 const char *name,
261 void *result);
Daniel Veillardd4330462003-04-29 12:40:16 +0000262int <a href="libxml-parser.html#xmlSetFeature">xmlSetFeature</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
Daniel Veillard7c29ce22000-08-12 21:20:53 +0000263 const char *name,
264 void *value);
Daniel Veillardd4330462003-04-29 12:40:16 +0000265<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> <a href="libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a> (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000266 void *user_data,
267 const char *chunk,
268 int size,
269 const char *filename);
Daniel Veillardd4330462003-04-29 12:40:16 +0000270int <a href="libxml-parser.html#xmlParseChunk">xmlParseChunk</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000271 const char *chunk,
272 int size,
273 int terminate);
Daniel Veillardd4330462003-04-29 12:40:16 +0000274<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> <a href="libxml-parser.html#xmlCreateIOParserCtxt">xmlCreateIOParserCtxt</a> (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000275 void *user_data,
Daniel Veillardd4330462003-04-29 12:40:16 +0000276 <a href="libxml-xmlIO.html#xmlInputReadCallback">xmlInputReadCallback</a> ioread,
277 <a href="libxml-xmlIO.html#xmlInputCloseCallback">xmlInputCloseCallback</a> ioclose,
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000278 void *ioctx,
Daniel Veillardd4330462003-04-29 12:40:16 +0000279 <a href="libxml-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc);
280<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> <a href="libxml-parser.html#xmlNewIOInputStream">xmlNewIOInputStream</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
281 <a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input,
282 <a href="libxml-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc);
283const <a href="libxml-parser.html#xmlParserNodeInfo">xmlParserNodeInfo</a>* <a href="libxml-parser.html#xmlParserFindNodeInfo">xmlParserFindNodeInfo</a>
284 (const <a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
285 const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node);
286void <a href="libxml-parser.html#xmlInitNodeInfoSeq">xmlInitNodeInfoSeq</a> (<a href="libxml-parser.html#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a> seq);
287void <a href="libxml-parser.html#xmlClearNodeInfoSeq">xmlClearNodeInfoSeq</a> (<a href="libxml-parser.html#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a> seq);
288unsigned <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="long">long</GTKDOCLINK> <a href="libxml-parser.html#xmlParserFindNodeInfoIndex">xmlParserFindNodeInfoIndex</a> (const <a href="libxml-parser.html#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a> seq,
289 const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node);
290void <a href="libxml-parser.html#xmlParserAddNodeInfo">xmlParserAddNodeInfo</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
291 const <a href="libxml-parser.html#xmlParserNodeInfoPtr">xmlParserNodeInfoPtr</a> info);
292void <a href="libxml-parser.html#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a> (<a href="libxml-parser.html#xmlExternalEntityLoader">xmlExternalEntityLoader</a> f);
293<a href="libxml-parser.html#xmlExternalEntityLoader">xmlExternalEntityLoader</a> <a href="libxml-parser.html#xmlGetExternalEntityLoader">xmlGetExternalEntityLoader</a>
Daniel Veillard6bd26dc1999-09-03 14:28:40 +0000294 (void);
Daniel Veillardd4330462003-04-29 12:40:16 +0000295<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> <a href="libxml-parser.html#xmlLoadExternalEntity">xmlLoadExternalEntity</a> (const char *URL,
Daniel Veillard6bd26dc1999-09-03 14:28:40 +0000296 const char *ID,
Daniel Veillardd4330462003-04-29 12:40:16 +0000297 <a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
298</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
299
Daniel Veillardcfba2fe2003-08-15 00:33:43 +0000300</p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="XML-DEFAULT-VERSION-CAPS"></a>XML_DEFAULT_VERSION</h3><pre class="programlisting">#define XML_DEFAULT_VERSION "1.0"
Daniel Veillardd7cec922003-06-13 12:30:10 +0000301</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000302The default version of XML used: 1.0</p><p>
303
304</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserInputDeallocate"></a>xmlParserInputDeallocate ()</h3><pre class="programlisting">void (*xmlParserInputDeallocate) (<a href="libxml-tree.html#xmlChar">xmlChar</a> *str);</pre><p>
305Callback for freeing some parser input allocations.</p><p>
306
William M. Brackc6e07552003-08-16 12:44:47 +0000307</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> the string to deallocate
Daniel Veillardd4330462003-04-29 12:40:16 +0000308</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserInput"></a>struct xmlParserInput</h3><pre class="programlisting">struct xmlParserInput {
William M. Brackc6e07552003-08-16 12:44:47 +0000309
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000310 /* Input buffer */
311 xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
312
313 const char *filename; /* The file analyzed, if any */
Daniel Veillard60087f32001-10-10 09:45:09 +0000314 const char *directory; /* the directory/base of the file */
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000315 const xmlChar *base; /* Base of the array to parse */
316 const xmlChar *cur; /* Current char being parsed */
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000317 const xmlChar *end; /* end of the array to parse */
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000318 int length; /* length if known */
319 int line; /* Current line */
320 int col; /* Current column */
Daniel Veillardd4330462003-04-29 12:40:16 +0000321 /*
322 * NOTE: consumed is only tested for equality in the parser code,
323 * so even if there is an overflow this should not give troubles
324 * for parsing very large instances.
325 */
326 unsigned long consumed; /* How many xmlChars already consumed */
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000327 xmlParserInputDeallocate free; /* function to deallocate the base */
328 const xmlChar *encoding; /* the encoding string for entity */
329 const xmlChar *version; /* the version string for entity */
330 int standalone; /* Was that entity marked standalone */
Daniel Veillardd4330462003-04-29 12:40:16 +0000331};
332</pre><p>
333An xmlParserInput is an input flow for the XML processor.
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000334Each entity parsed is associated an xmlParserInput (except the
335few predefined ones). This is the case both for internal entities
336- in which case the flow is already completely in memory - or
337external entities - in which case we use the buf structure for
Daniel Veillardd4330462003-04-29 12:40:16 +0000338progressive reading and I18N conversions to the internal UTF-8 format.</p><p>
339
340</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserNodeInfo"></a>struct xmlParserNodeInfo</h3><pre class="programlisting">struct xmlParserNodeInfo {
William M. Brackc6e07552003-08-16 12:44:47 +0000341
Daniel Veillard71b656e2000-01-05 14:46:17 +0000342 const struct _xmlNode* node;
Daniel Veillard3bbbe6f2001-05-03 11:15:37 +0000343 /* Position &amp; line # that text that created the node begins &amp; ends on */
Daniel Veillard71b656e2000-01-05 14:46:17 +0000344 unsigned long begin_pos;
345 unsigned long begin_line;
346 unsigned long end_pos;
347 unsigned long end_line;
Daniel Veillardd4330462003-04-29 12:40:16 +0000348};
349</pre><p>
350The parser can be asked to collect Node informations, i.e. at what
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000351place in the file they were detected.
Daniel Veillardd4330462003-04-29 12:40:16 +0000352NOTE: This is off by default and not very well tested.</p><p>
353
Daniel Veillardd7cec922003-06-13 12:30:10 +0000354</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserNodeInfoPtr"></a>xmlParserNodeInfoPtr</h3><pre class="programlisting">typedef xmlParserNodeInfo *xmlParserNodeInfoPtr;
355</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000356
357</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserNodeInfoSeq"></a>struct xmlParserNodeInfoSeq</h3><pre class="programlisting">struct xmlParserNodeInfoSeq {
William M. Brackc6e07552003-08-16 12:44:47 +0000358
Daniel Veillard71b656e2000-01-05 14:46:17 +0000359 unsigned long maximum;
360 unsigned long length;
361 xmlParserNodeInfo* buffer;
Daniel Veillardd4330462003-04-29 12:40:16 +0000362};
363</pre><p>
364
Daniel Veillardd7cec922003-06-13 12:30:10 +0000365</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserNodeInfoSeqPtr"></a>xmlParserNodeInfoSeqPtr</h3><pre class="programlisting">typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
366</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000367
368</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserInputState"></a>enum xmlParserInputState</h3><pre class="programlisting">typedef enum {
Daniel Veillardbe849cf1999-12-28 16:43:59 +0000369 XML_PARSER_EOF = -1, /* nothing is to be parsed */
370 XML_PARSER_START = 0, /* nothing has been parsed */
371 XML_PARSER_MISC, /* Misc* before int subset */
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000372 XML_PARSER_PI, /* Within a processing instruction */
Daniel Veillardbe849cf1999-12-28 16:43:59 +0000373 XML_PARSER_DTD, /* within some DTD content */
374 XML_PARSER_PROLOG, /* Misc* after internal subset */
375 XML_PARSER_COMMENT, /* within a comment */
376 XML_PARSER_START_TAG, /* within a start tag */
377 XML_PARSER_CONTENT, /* within the content */
378 XML_PARSER_CDATA_SECTION, /* within a CDATA section */
379 XML_PARSER_END_TAG, /* within a closing tag */
380 XML_PARSER_ENTITY_DECL, /* within an entity declaration */
381 XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */
382 XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */
Daniel Veillardedfb29b2000-03-14 19:59:05 +0000383 XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */
Daniel Veillard28929b22000-11-13 18:22:49 +0000384 XML_PARSER_EPILOG, /* the Misc* after the last end tag */
Daniel Veillard5f4b5992002-02-20 10:22:49 +0000385 XML_PARSER_IGNORE, /* within an IGNORED section */
386 XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */
Daniel Veillardd4330462003-04-29 12:40:16 +0000387} xmlParserInputState;
388</pre><p>
389The parser is now working also as a state based parser.
390The recursive one use the state info for entities processing.</p><p>
391
Daniel Veillardd7cec922003-06-13 12:30:10 +0000392</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="XML-DETECT-IDS-CAPS"></a>XML_DETECT_IDS</h3><pre class="programlisting">#define XML_DETECT_IDS 2
393</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000394Bit in the loadsubset context field to tell to do ID/REFs lookups.
395Use it to initialize xmlLoadExtDtdDefaultValue.</p><p>
396
Daniel Veillardd7cec922003-06-13 12:30:10 +0000397</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="XML-COMPLETE-ATTRS-CAPS"></a>XML_COMPLETE_ATTRS</h3><pre class="programlisting">#define XML_COMPLETE_ATTRS 4
398</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000399Bit in the loadsubset context field to tell to do complete the
Daniel Veillard19274092002-03-25 16:48:03 +0000400elements attributes lists with the ones defaulted from the DTDs.
Daniel Veillardd4330462003-04-29 12:40:16 +0000401Use it to initialize xmlLoadExtDtdDefaultValue.</p><p>
402
Daniel Veillardd7cec922003-06-13 12:30:10 +0000403</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="XML-SKIP-IDS-CAPS"></a>XML_SKIP_IDS</h3><pre class="programlisting">#define XML_SKIP_IDS 8
404</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000405Bit in the loadsubset context field to tell to not do ID/REFs registration.
406Used to initialize xmlLoadExtDtdDefaultValue in some special cases.</p><p>
407
408</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserCtxt"></a>struct xmlParserCtxt</h3><pre class="programlisting">struct xmlParserCtxt {
William M. Brackc6e07552003-08-16 12:44:47 +0000409
Daniel Veillard71b656e2000-01-05 14:46:17 +0000410 struct _xmlSAXHandler *sax; /* The SAX handler */
Daniel Veillard3bff2b02000-10-01 20:33:47 +0000411 void *userData; /* For SAX interface only, used by DOM build */
Daniel Veillard71b656e2000-01-05 14:46:17 +0000412 xmlDocPtr myDoc; /* the document being built */
413 int wellFormed; /* is the document well formed */
414 int replaceEntities; /* shall we replace entities ? */
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000415 const xmlChar *version; /* the XML version string */
416 const xmlChar *encoding; /* the declared encoding, if any */
Daniel Veillard71b656e2000-01-05 14:46:17 +0000417 int standalone; /* standalone document */
Daniel Veillard3bff2b02000-10-01 20:33:47 +0000418 int html; /* an HTML(1)/Docbook(2) document */
Daniel Veillard71b656e2000-01-05 14:46:17 +0000419
420 /* Input stream stack */
421 xmlParserInputPtr input; /* Current input stream */
422 int inputNr; /* Number of current input streams */
423 int inputMax; /* Max number of input streams */
424 xmlParserInputPtr *inputTab; /* stack of inputs */
425
426 /* Node analysis stack only used for DOM building */
427 xmlNodePtr node; /* Current parsed Node */
428 int nodeNr; /* Depth of the parsing stack */
429 int nodeMax; /* Max depth of the parsing stack */
430 xmlNodePtr *nodeTab; /* array of nodes */
431
432 int record_info; /* Whether node info should be kept */
433 xmlParserNodeInfoSeq node_seq; /* info about each node parsed */
434
435 int errNo; /* error code */
436
437 int hasExternalSubset; /* reference and external subset */
438 int hasPErefs; /* the internal subset has PE refs */
439 int external; /* are we parsing an external entity */
440
441 int valid; /* is the document valid */
442 int validate; /* shall we try to validate ? */
443 xmlValidCtxt vctxt; /* The validity context */
444
445 xmlParserInputState instate; /* current type of input */
446 int token; /* next char look-ahead */
447
448 char *directory; /* the data directory */
449
Daniel Veillardedfb29b2000-03-14 19:59:05 +0000450 /* Node name stack */
Daniel Veillard71b656e2000-01-05 14:46:17 +0000451 xmlChar *name; /* Current parsed Node */
452 int nameNr; /* Depth of the parsing stack */
453 int nameMax; /* Max depth of the parsing stack */
454 xmlChar * *nameTab; /* array of nodes */
455
456 long nbChars; /* number of xmlChar processed */
457 long checkIndex; /* used by progressive parsing lookup */
Daniel Veillardf6868712000-01-05 14:58:38 +0000458 int keepBlanks; /* ugly but ... */
Daniel Veillardedfb29b2000-03-14 19:59:05 +0000459 int disableSAX; /* SAX callbacks are disabled */
460 int inSubset; /* Parsing is in int 1/ext 2 subset */
461 xmlChar * intSubName; /* name of subset */
462 xmlChar * extSubURI; /* URI of external subset */
463 xmlChar * extSubSystem; /* SYSTEM ID of external subset */
464
465 /* xml:space values */
466 int * space; /* Should the parser preserve spaces */
467 int spaceNr; /* Depth of the parsing stack */
468 int spaceMax; /* Max depth of the parsing stack */
469 int * spaceTab; /* array of space infos */
470
471 int depth; /* to prevent entity substitution loops */
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000472 xmlParserInputPtr entity; /* used to check entities boundaries */
473 int charset; /* encoding of the in-memory content
474 actually an xmlCharEncoding */
475 int nodelen; /* Those two fields are there to */
476 int nodemem; /* Speed up large node parsing */
Daniel Veillard3bff2b02000-10-01 20:33:47 +0000477 int pedantic; /* signal pedantic warnings */
478 void *_private; /* For user data, libxml won't touch it */
Daniel Veillardd194dd22001-02-14 10:37:43 +0000479
480 int loadsubset; /* should the external subset be loaded */
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000481 int linenumbers; /* set line number in element content */
482 void *catalogs; /* document's own catalog */
Daniel Veillardaec63562003-03-23 20:42:17 +0000483 int recovery; /* run in recovery mode */
Daniel Veillardd4330462003-04-29 12:40:16 +0000484 int progressive; /* is this a progressive parsing */
485};
486</pre><p>
487The parser context.
Daniel Veillard19274092002-03-25 16:48:03 +0000488NOTE This doesn't completely define the parser state, the (current ?)
Daniel Veillardaec63562003-03-23 20:42:17 +0000489 design of the parser uses recursive function calls since this allow
490 and easy mapping from the production rules of the specification
491 to the actual code. The drawback is that the actual function call
492 also reflect the parser state. However most of the parsing routines
493 takes as the only argument the parser context pointer, so migrating
Daniel Veillardd4330462003-04-29 12:40:16 +0000494 to a state based parser for progressive parsing shouldn't be too hard.</p><p>
495
496</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSAXLocator"></a>struct xmlSAXLocator</h3><pre class="programlisting">struct xmlSAXLocator {
William M. Brackc6e07552003-08-16 12:44:47 +0000497
Daniel Veillard71b656e2000-01-05 14:46:17 +0000498 const xmlChar *(*getPublicId)(void *ctx);
499 const xmlChar *(*getSystemId)(void *ctx);
500 int (*getLineNumber)(void *ctx);
501 int (*getColumnNumber)(void *ctx);
Daniel Veillardd4330462003-04-29 12:40:16 +0000502};
503</pre><p>
504A SAX Locator.</p><p>
505
506</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="resolveEntitySAXFunc"></a>resolveEntitySAXFunc ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> (*resolveEntitySAXFunc) (void *ctx,
507 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId,
508 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId);</pre><p>
509Callback:
Daniel Veillard5f4b5992002-02-20 10:22:49 +0000510The entity loader, to control the loading of external entities,
511the application can either:
Daniel Veillardd4330462003-04-29 12:40:16 +0000512 - override this <a href="libxml-SAX.html#resolveEntity">resolveEntity</a>() callback in the SAX block
513 - or better use the <a href="libxml-parser.html#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a>() function to
514 set up it's own entity resolution routine</p><p>
515
William M. Brackc6e07552003-08-16 12:44:47 +0000516</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
517</td></tr><tr><td><span class="term"><i class="parameter"><tt>publicId</tt></i> :</span></td><td> The public ID of the entity
518</td></tr><tr><td><span class="term"><i class="parameter"><tt>systemId</tt></i> :</span></td><td> The system ID of the entity
Daniel Veillardd7cec922003-06-13 12:30:10 +0000519</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlParserInputPtr if inlined or NULL for DOM behaviour.
Daniel Veillardd4330462003-04-29 12:40:16 +0000520</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="internalSubsetSAXFunc"></a>internalSubsetSAXFunc ()</h3><pre class="programlisting">void (*internalSubsetSAXFunc) (void *ctx,
521 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
522 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID,
523 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);</pre><p>
524Callback on internal subset declaration.</p><p>
525
William M. Brackc6e07552003-08-16 12:44:47 +0000526</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
527</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> the root element name
528</td></tr><tr><td><span class="term"><i class="parameter"><tt>ExternalID</tt></i> :</span></td><td> the external ID
529</td></tr><tr><td><span class="term"><i class="parameter"><tt>SystemID</tt></i> :</span></td><td> the SYSTEM ID (e.g. filename or URL)
Daniel Veillardd4330462003-04-29 12:40:16 +0000530</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="externalSubsetSAXFunc"></a>externalSubsetSAXFunc ()</h3><pre class="programlisting">void (*externalSubsetSAXFunc) (void *ctx,
531 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
532 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID,
533 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);</pre><p>
534Callback on external subset declaration.</p><p>
535
William M. Brackc6e07552003-08-16 12:44:47 +0000536</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
537</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> the root element name
538</td></tr><tr><td><span class="term"><i class="parameter"><tt>ExternalID</tt></i> :</span></td><td> the external ID
539</td></tr><tr><td><span class="term"><i class="parameter"><tt>SystemID</tt></i> :</span></td><td> the SYSTEM ID (e.g. filename or URL)
Daniel Veillardd4330462003-04-29 12:40:16 +0000540</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="getEntitySAXFunc"></a>getEntitySAXFunc ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> (*getEntitySAXFunc) (void *ctx,
541 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p>
542Get an entity by name.</p><p>
543
William M. Brackc6e07552003-08-16 12:44:47 +0000544</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
545</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> The entity name
Daniel Veillardd7cec922003-06-13 12:30:10 +0000546</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlEntityPtr if found.
Daniel Veillardd4330462003-04-29 12:40:16 +0000547</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="getParameterEntitySAXFunc"></a>getParameterEntitySAXFunc ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> (*getParameterEntitySAXFunc) (void *ctx,
548 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p>
549Get a parameter entity by name.</p><p>
550
William M. Brackc6e07552003-08-16 12:44:47 +0000551</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
552</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> The entity name
Daniel Veillardd7cec922003-06-13 12:30:10 +0000553</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlEntityPtr if found.
Daniel Veillardd4330462003-04-29 12:40:16 +0000554</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="entityDeclSAXFunc"></a>entityDeclSAXFunc ()</h3><pre class="programlisting">void (*entityDeclSAXFunc) (void *ctx,
555 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
Daniel Veillard5099ae81999-04-21 20:12:07 +0000556 int type,
Daniel Veillardd4330462003-04-29 12:40:16 +0000557 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId,
558 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId,
559 <a href="libxml-tree.html#xmlChar">xmlChar</a> *content);</pre><p>
560An entity definition has been parsed.</p><p>
561
William M. Brackc6e07552003-08-16 12:44:47 +0000562</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
563</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> the entity name
564</td></tr><tr><td><span class="term"><i class="parameter"><tt>type</tt></i> :</span></td><td> the entity type
565</td></tr><tr><td><span class="term"><i class="parameter"><tt>publicId</tt></i> :</span></td><td> The public ID of the entity
566</td></tr><tr><td><span class="term"><i class="parameter"><tt>systemId</tt></i> :</span></td><td> The system ID of the entity
567</td></tr><tr><td><span class="term"><i class="parameter"><tt>content</tt></i> :</span></td><td> the entity value (without processing).
Daniel Veillardd4330462003-04-29 12:40:16 +0000568</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="notationDeclSAXFunc"></a>notationDeclSAXFunc ()</h3><pre class="programlisting">void (*notationDeclSAXFunc) (void *ctx,
569 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
570 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId,
571 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId);</pre><p>
572What to do when a notation declaration has been parsed.</p><p>
573
William M. Brackc6e07552003-08-16 12:44:47 +0000574</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
575</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> The name of the notation
576</td></tr><tr><td><span class="term"><i class="parameter"><tt>publicId</tt></i> :</span></td><td> The public ID of the entity
577</td></tr><tr><td><span class="term"><i class="parameter"><tt>systemId</tt></i> :</span></td><td> The system ID of the entity
Daniel Veillardd4330462003-04-29 12:40:16 +0000578</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="attributeDeclSAXFunc"></a>attributeDeclSAXFunc ()</h3><pre class="programlisting">void (*attributeDeclSAXFunc) (void *ctx,
579 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *elem,
580 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *fullname,
Daniel Veillard5099ae81999-04-21 20:12:07 +0000581 int type,
582 int def,
Daniel Veillardd4330462003-04-29 12:40:16 +0000583 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *defaultValue,
584 <a href="libxml-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree);</pre><p>
585An attribute definition has been parsed.</p><p>
586
William M. Brackc6e07552003-08-16 12:44:47 +0000587</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
588</td></tr><tr><td><span class="term"><i class="parameter"><tt>elem</tt></i> :</span></td><td> the name of the element
589</td></tr><tr><td><span class="term"><i class="parameter"><tt>fullname</tt></i> :</span></td><td> the attribute name
590</td></tr><tr><td><span class="term"><i class="parameter"><tt>type</tt></i> :</span></td><td> the attribute type
591</td></tr><tr><td><span class="term"><i class="parameter"><tt>def</tt></i> :</span></td><td> the type of default value
592</td></tr><tr><td><span class="term"><i class="parameter"><tt>defaultValue</tt></i> :</span></td><td> the attribute default value
593</td></tr><tr><td><span class="term"><i class="parameter"><tt>tree</tt></i> :</span></td><td> the tree of enumerated value set
Daniel Veillardd4330462003-04-29 12:40:16 +0000594</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="elementDeclSAXFunc"></a>elementDeclSAXFunc ()</h3><pre class="programlisting">void (*elementDeclSAXFunc) (void *ctx,
595 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
Daniel Veillard5099ae81999-04-21 20:12:07 +0000596 int type,
Daniel Veillardd4330462003-04-29 12:40:16 +0000597 <a href="libxml-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> content);</pre><p>
598An element definition has been parsed.</p><p>
599
William M. Brackc6e07552003-08-16 12:44:47 +0000600</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
601</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> the element name
602</td></tr><tr><td><span class="term"><i class="parameter"><tt>type</tt></i> :</span></td><td> the element type
603</td></tr><tr><td><span class="term"><i class="parameter"><tt>content</tt></i> :</span></td><td> the element value tree
Daniel Veillardd4330462003-04-29 12:40:16 +0000604</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="unparsedEntityDeclSAXFunc"></a>unparsedEntityDeclSAXFunc ()</h3><pre class="programlisting">void (*unparsedEntityDeclSAXFunc) (void *ctx,
605 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
606 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId,
607 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId,
608 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *notationName);</pre><p>
609What to do when an unparsed entity declaration is parsed.</p><p>
610
William M. Brackc6e07552003-08-16 12:44:47 +0000611</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
612</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> The name of the entity
613</td></tr><tr><td><span class="term"><i class="parameter"><tt>publicId</tt></i> :</span></td><td> The public ID of the entity
614</td></tr><tr><td><span class="term"><i class="parameter"><tt>systemId</tt></i> :</span></td><td> The system ID of the entity
615</td></tr><tr><td><span class="term"><i class="parameter"><tt>notationName</tt></i> :</span></td><td> the name of the notation
Daniel Veillardd4330462003-04-29 12:40:16 +0000616</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="setDocumentLocatorSAXFunc"></a>setDocumentLocatorSAXFunc ()</h3><pre class="programlisting">void (*setDocumentLocatorSAXFunc) (void *ctx,
617 <a href="libxml-tree.html#xmlSAXLocatorPtr">xmlSAXLocatorPtr</a> loc);</pre><p>
618Receive the document locator at startup, actually xmlDefaultSAXLocator.
619Everything is available on the context, so this is useless in our case.</p><p>
620
William M. Brackc6e07552003-08-16 12:44:47 +0000621</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
622</td></tr><tr><td><span class="term"><i class="parameter"><tt>loc</tt></i> :</span></td><td> A SAX Locator
Daniel Veillardd4330462003-04-29 12:40:16 +0000623</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="startDocumentSAXFunc"></a>startDocumentSAXFunc ()</h3><pre class="programlisting">void (*startDocumentSAXFunc) (void *ctx);</pre><p>
624Called when the document start being processed.</p><p>
625
William M. Brackc6e07552003-08-16 12:44:47 +0000626</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
Daniel Veillardd4330462003-04-29 12:40:16 +0000627</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="endDocumentSAXFunc"></a>endDocumentSAXFunc ()</h3><pre class="programlisting">void (*endDocumentSAXFunc) (void *ctx);</pre><p>
628Called when the document end has been detected.</p><p>
629
William M. Brackc6e07552003-08-16 12:44:47 +0000630</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
Daniel Veillardd4330462003-04-29 12:40:16 +0000631</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="startElementSAXFunc"></a>startElementSAXFunc ()</h3><pre class="programlisting">void (*startElementSAXFunc) (void *ctx,
632 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
633 const <a href="libxml-tree.html#xmlChar">xmlChar</a> **atts);</pre><p>
634Called when an opening tag has been processed.</p><p>
635
William M. Brackc6e07552003-08-16 12:44:47 +0000636</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
637</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> The element name, including namespace prefix
638</td></tr><tr><td><span class="term"><i class="parameter"><tt>atts</tt></i> :</span></td><td> An array of name/value attributes pairs, NULL terminated
Daniel Veillardd4330462003-04-29 12:40:16 +0000639</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="endElementSAXFunc"></a>endElementSAXFunc ()</h3><pre class="programlisting">void (*endElementSAXFunc) (void *ctx,
640 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p>
641Called when the end of an element has been detected.</p><p>
642
William M. Brackc6e07552003-08-16 12:44:47 +0000643</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
644</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> The element name
Daniel Veillardd4330462003-04-29 12:40:16 +0000645</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="attributeSAXFunc"></a>attributeSAXFunc ()</h3><pre class="programlisting">void (*attributeSAXFunc) (void *ctx,
646 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name,
647 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value);</pre><p>
648Handle an attribute that has been read by the parser.
Daniel Veillard5f4b5992002-02-20 10:22:49 +0000649The default handling is to convert the attribute into an
650DOM subtree and past it in a new xmlAttr element added to
Daniel Veillardd4330462003-04-29 12:40:16 +0000651the element.</p><p>
652
William M. Brackc6e07552003-08-16 12:44:47 +0000653</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
654</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> The attribute name, including namespace prefix
655</td></tr><tr><td><span class="term"><i class="parameter"><tt>value</tt></i> :</span></td><td> The attribute value
Daniel Veillardd4330462003-04-29 12:40:16 +0000656</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="referenceSAXFunc"></a>referenceSAXFunc ()</h3><pre class="programlisting">void (*referenceSAXFunc) (void *ctx,
657 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p>
658Called when an entity reference is detected.</p><p>
659
William M. Brackc6e07552003-08-16 12:44:47 +0000660</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
661</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> The entity name
Daniel Veillardd4330462003-04-29 12:40:16 +0000662</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="charactersSAXFunc"></a>charactersSAXFunc ()</h3><pre class="programlisting">void (*charactersSAXFunc) (void *ctx,
663 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch,
664 int len);</pre><p>
665Receiving some chars from the parser.</p><p>
666
William M. Brackc6e07552003-08-16 12:44:47 +0000667</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
668</td></tr><tr><td><span class="term"><i class="parameter"><tt>ch</tt></i> :</span></td><td> a xmlChar string
669</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the number of xmlChar
Daniel Veillardd4330462003-04-29 12:40:16 +0000670</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="ignorableWhitespaceSAXFunc"></a>ignorableWhitespaceSAXFunc ()</h3><pre class="programlisting">void (*ignorableWhitespaceSAXFunc) (void *ctx,
671 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch,
672 int len);</pre><p>
673Receiving some ignorable whitespaces from the parser.
674UNUSED: by default the DOM building will use characters.</p><p>
675
William M. Brackc6e07552003-08-16 12:44:47 +0000676</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
677</td></tr><tr><td><span class="term"><i class="parameter"><tt>ch</tt></i> :</span></td><td> a xmlChar string
678</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the number of xmlChar
Daniel Veillardd4330462003-04-29 12:40:16 +0000679</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="processingInstructionSAXFunc"></a>processingInstructionSAXFunc ()</h3><pre class="programlisting">void (*processingInstructionSAXFunc) (void *ctx,
680 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *target,
681 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *data);</pre><p>
682A processing instruction has been parsed.</p><p>
683
William M. Brackc6e07552003-08-16 12:44:47 +0000684</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
685</td></tr><tr><td><span class="term"><i class="parameter"><tt>target</tt></i> :</span></td><td> the target name
686</td></tr><tr><td><span class="term"><i class="parameter"><tt>data</tt></i> :</span></td><td> the PI data's
Daniel Veillardd4330462003-04-29 12:40:16 +0000687</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="commentSAXFunc"></a>commentSAXFunc ()</h3><pre class="programlisting">void (*commentSAXFunc) (void *ctx,
688 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value);</pre><p>
689A comment has been parsed.</p><p>
690
William M. Brackc6e07552003-08-16 12:44:47 +0000691</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
692</td></tr><tr><td><span class="term"><i class="parameter"><tt>value</tt></i> :</span></td><td> the comment content
Daniel Veillardd4330462003-04-29 12:40:16 +0000693</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="cdataBlockSAXFunc"></a>cdataBlockSAXFunc ()</h3><pre class="programlisting">void (*cdataBlockSAXFunc) (void *ctx,
694 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value,
695 int len);</pre><p>
696Called when a pcdata block has been parsed.</p><p>
697
William M. Brackc6e07552003-08-16 12:44:47 +0000698</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
699</td></tr><tr><td><span class="term"><i class="parameter"><tt>value</tt></i> :</span></td><td> The pcdata content
700</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the block length
Daniel Veillardd4330462003-04-29 12:40:16 +0000701</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="warningSAXFunc"></a>warningSAXFunc ()</h3><pre class="programlisting">void (*warningSAXFunc) (void *ctx,
Daniel Veillard35925471999-02-25 08:46:07 +0000702 const char *msg,
Daniel Veillardd4330462003-04-29 12:40:16 +0000703 ...);</pre><p>
704Display and format a warning messages, callback.</p><p>
705
William M. Brackc6e07552003-08-16 12:44:47 +0000706</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> an XML parser context
707</td></tr><tr><td><span class="term"><i class="parameter"><tt>msg</tt></i> :</span></td><td> the message to display/transmit
708</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i> :</span></td><td> extra parameters for the message display
Daniel Veillardd4330462003-04-29 12:40:16 +0000709</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="errorSAXFunc"></a>errorSAXFunc ()</h3><pre class="programlisting">void (*errorSAXFunc) (void *ctx,
Daniel Veillard35925471999-02-25 08:46:07 +0000710 const char *msg,
Daniel Veillardd4330462003-04-29 12:40:16 +0000711 ...);</pre><p>
712Display and format an error messages, callback.</p><p>
713
William M. Brackc6e07552003-08-16 12:44:47 +0000714</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> an XML parser context
715</td></tr><tr><td><span class="term"><i class="parameter"><tt>msg</tt></i> :</span></td><td> the message to display/transmit
716</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i> :</span></td><td> extra parameters for the message display
Daniel Veillardd4330462003-04-29 12:40:16 +0000717</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="fatalErrorSAXFunc"></a>fatalErrorSAXFunc ()</h3><pre class="programlisting">void (*fatalErrorSAXFunc) (void *ctx,
Daniel Veillard35925471999-02-25 08:46:07 +0000718 const char *msg,
Daniel Veillardd4330462003-04-29 12:40:16 +0000719 ...);</pre><p>
720Display and format fatal error messages, callback.
721Note: so far <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="fatalError">fatalError</GTKDOCLINK>() SAX callbacks are not used, <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="error">error</GTKDOCLINK>()
722 get all the callbacks for errors.</p><p>
723
William M. Brackc6e07552003-08-16 12:44:47 +0000724</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> an XML parser context
725</td></tr><tr><td><span class="term"><i class="parameter"><tt>msg</tt></i> :</span></td><td> the message to display/transmit
726</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i> :</span></td><td> extra parameters for the message display
Daniel Veillardd4330462003-04-29 12:40:16 +0000727</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="isStandaloneSAXFunc"></a>isStandaloneSAXFunc ()</h3><pre class="programlisting">int (*isStandaloneSAXFunc) (void *ctx);</pre><p>
728Is this document tagged standalone?</p><p>
729
William M. Brackc6e07552003-08-16 12:44:47 +0000730</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
Daniel Veillardd7cec922003-06-13 12:30:10 +0000731</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 if true
Daniel Veillardd4330462003-04-29 12:40:16 +0000732</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="hasInternalSubsetSAXFunc"></a>hasInternalSubsetSAXFunc ()</h3><pre class="programlisting">int (*hasInternalSubsetSAXFunc) (void *ctx);</pre><p>
733Does this document has an internal subset.</p><p>
734
William M. Brackc6e07552003-08-16 12:44:47 +0000735</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
Daniel Veillardd7cec922003-06-13 12:30:10 +0000736</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 if true
Daniel Veillardd4330462003-04-29 12:40:16 +0000737</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="hasExternalSubsetSAXFunc"></a>hasExternalSubsetSAXFunc ()</h3><pre class="programlisting">int (*hasExternalSubsetSAXFunc) (void *ctx);</pre><p>
738Does this document has an external subset?</p><p>
739
William M. Brackc6e07552003-08-16 12:44:47 +0000740</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the user data (XML parser context)
Daniel Veillardd7cec922003-06-13 12:30:10 +0000741</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 if true
Daniel Veillardd4330462003-04-29 12:40:16 +0000742</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSAXHandler"></a>struct xmlSAXHandler</h3><pre class="programlisting">struct xmlSAXHandler {
William M. Brackc6e07552003-08-16 12:44:47 +0000743
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000744 internalSubsetSAXFunc internalSubset;
745 isStandaloneSAXFunc isStandalone;
746 hasInternalSubsetSAXFunc hasInternalSubset;
747 hasExternalSubsetSAXFunc hasExternalSubset;
748 resolveEntitySAXFunc resolveEntity;
749 getEntitySAXFunc getEntity;
750 entityDeclSAXFunc entityDecl;
751 notationDeclSAXFunc notationDecl;
752 attributeDeclSAXFunc attributeDecl;
753 elementDeclSAXFunc elementDecl;
754 unparsedEntityDeclSAXFunc unparsedEntityDecl;
755 setDocumentLocatorSAXFunc setDocumentLocator;
756 startDocumentSAXFunc startDocument;
757 endDocumentSAXFunc endDocument;
758 startElementSAXFunc startElement;
759 endElementSAXFunc endElement;
760 referenceSAXFunc reference;
761 charactersSAXFunc characters;
762 ignorableWhitespaceSAXFunc ignorableWhitespace;
763 processingInstructionSAXFunc processingInstruction;
764 commentSAXFunc comment;
765 warningSAXFunc warning;
766 errorSAXFunc error;
Daniel Veillardaec63562003-03-23 20:42:17 +0000767 fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000768 getParameterEntitySAXFunc getParameterEntity;
769 cdataBlockSAXFunc cdataBlock;
770 externalSubsetSAXFunc externalSubset;
Daniel Veillard52dcab32001-10-30 12:51:17 +0000771 int initialized;
Daniel Veillardd4330462003-04-29 12:40:16 +0000772};
773</pre><p>
774A SAX handler is bunch of callbacks called by the parser when processing
775of the input generate data or structure informations.</p><p>
776
777</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlExternalEntityLoader"></a>xmlExternalEntityLoader ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> (*xmlExternalEntityLoader)
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000778 (const char *URL,
779 const char *ID,
Daniel Veillardd4330462003-04-29 12:40:16 +0000780 <a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> context);</pre><p>
781External entity loaders types.</p><p>
782
William M. Brackc6e07552003-08-16 12:44:47 +0000783</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>URL</tt></i> :</span></td><td> The System ID of the resource requested
784</td></tr><tr><td><span class="term"><i class="parameter"><tt>ID</tt></i> :</span></td><td> The Public ID of the resource requested
785</td></tr><tr><td><span class="term"><i class="parameter"><tt>context</tt></i> :</span></td><td> the XML parser context
Daniel Veillardd7cec922003-06-13 12:30:10 +0000786</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the entity input parser.
Daniel Veillardd4330462003-04-29 12:40:16 +0000787</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlInitParser"></a>xmlInitParser ()</h3><pre class="programlisting">void xmlInitParser (void);</pre><p>
788Initialization function for the XML parser.
Daniel Veillard3bff2b02000-10-01 20:33:47 +0000789This is not reentrant. Call once before processing in case of
Daniel Veillardd4330462003-04-29 12:40:16 +0000790use in multithreaded programs.</p><p>
791
792</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlCleanupParser"></a>xmlCleanupParser ()</h3><pre class="programlisting">void xmlCleanupParser (void);</pre><p>
793Cleanup function for the XML parser. It tries to reclaim all
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000794parsing related global memory allocated for the parser processing.
795It doesn't deallocate any document related memory. Calling this
Daniel Veillardaec63562003-03-23 20:42:17 +0000796function should not prevent reusing the parser.
Daniel Veillardd4330462003-04-29 12:40:16 +0000797One should call <a href="libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a>() only when the process has
798finished using the library or XML document built with it.</p><p>
799
800</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserInputRead"></a>xmlParserInputRead ()</h3><pre class="programlisting">int xmlParserInputRead (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> in,
801 int len);</pre><p>
802This function refresh the input for the parser. It doesn't try to
803preserve pointers to the input buffer, and discard already read data</p><p>
804
William M. Brackc6e07552003-08-16 12:44:47 +0000805</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>in</tt></i> :</span></td><td> an XML parser input
806</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> an indicative size for the lookahead
Daniel Veillardd7cec922003-06-13 12:30:10 +0000807</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number of xmlChars read, or -1 in case of error, 0 indicate the
808end of this entity
Daniel Veillardd4330462003-04-29 12:40:16 +0000809</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserInputGrow"></a>xmlParserInputGrow ()</h3><pre class="programlisting">int xmlParserInputGrow (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> in,
810 int len);</pre><p>
811This function increase the input for the parser. It tries to
812preserve pointers to the input buffer, and keep already read data</p><p>
813
William M. Brackc6e07552003-08-16 12:44:47 +0000814</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>in</tt></i> :</span></td><td> an XML parser input
815</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> an indicative size for the lookahead
Daniel Veillardd7cec922003-06-13 12:30:10 +0000816</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number of xmlChars read, or -1 in case of error, 0 indicate the
817end of this entity
Daniel Veillardd4330462003-04-29 12:40:16 +0000818</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrdup"></a>xmlStrdup ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlStrdup (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *cur);</pre><p>
819a strdup for array of xmlChar's. Since they are supposed to be
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000820encoded in UTF-8 or an encoding with 8bit based chars, we assume
Daniel Veillardd4330462003-04-29 12:40:16 +0000821a termination mark of '0'.</p><p>
822
William M. Brackc6e07552003-08-16 12:44:47 +0000823</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>cur</tt></i> :</span></td><td> the input xmlChar *
Daniel Veillardd7cec922003-06-13 12:30:10 +0000824</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a new xmlChar * or NULL
Daniel Veillardd4330462003-04-29 12:40:16 +0000825</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrndup"></a>xmlStrndup ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlStrndup (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *cur,
826 int len);</pre><p>
827a strndup for array of xmlChar's</p><p>
828
William M. Brackc6e07552003-08-16 12:44:47 +0000829</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>cur</tt></i> :</span></td><td> the input xmlChar *
830</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the len of <i class="parameter"><tt>cur</tt></i>
Daniel Veillardd7cec922003-06-13 12:30:10 +0000831</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a new xmlChar * or NULL
Daniel Veillardd4330462003-04-29 12:40:16 +0000832</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlCharStrndup"></a>xmlCharStrndup ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlCharStrndup (const char *cur,
833 int len);</pre><p>
834a strndup for char's to xmlChar's</p><p>
835
William M. Brackc6e07552003-08-16 12:44:47 +0000836</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>cur</tt></i> :</span></td><td> the input char *
837</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the len of <i class="parameter"><tt>cur</tt></i>
Daniel Veillardd7cec922003-06-13 12:30:10 +0000838</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a new xmlChar * or NULL
Daniel Veillardd4330462003-04-29 12:40:16 +0000839</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlCharStrdup"></a>xmlCharStrdup ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlCharStrdup (const char *cur);</pre><p>
840a strdup for char's to xmlChar's</p><p>
841
William M. Brackc6e07552003-08-16 12:44:47 +0000842</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>cur</tt></i> :</span></td><td> the input char *
Daniel Veillardd7cec922003-06-13 12:30:10 +0000843</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a new xmlChar * or NULL
Daniel Veillardd4330462003-04-29 12:40:16 +0000844</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrsub"></a>xmlStrsub ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlStrsub (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str,
Daniel Veillard1566d3a1999-07-15 14:24:29 +0000845 int start,
Daniel Veillardd4330462003-04-29 12:40:16 +0000846 int len);</pre><p>
847Extract a substring of a given string</p><p>
848
William M. Brackc6e07552003-08-16 12:44:47 +0000849</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> the xmlChar * array (haystack)
850</td></tr><tr><td><span class="term"><i class="parameter"><tt>start</tt></i> :</span></td><td> the index of the first char (zero based)
851</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the length of the substring
Daniel Veillardd7cec922003-06-13 12:30:10 +0000852</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlChar * for the first occurrence or NULL.
Daniel Veillardd4330462003-04-29 12:40:16 +0000853</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrchr"></a>xmlStrchr ()</h3><pre class="programlisting">const <a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlStrchr (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str,
854 <a href="libxml-tree.html#xmlChar">xmlChar</a> val);</pre><p>
855a strchr for xmlChar's</p><p>
856
William M. Brackc6e07552003-08-16 12:44:47 +0000857</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> the xmlChar * array
858</td></tr><tr><td><span class="term"><i class="parameter"><tt>val</tt></i> :</span></td><td> the xmlChar to search
Daniel Veillardd7cec922003-06-13 12:30:10 +0000859</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlChar * for the first occurrence or NULL.
Daniel Veillardd4330462003-04-29 12:40:16 +0000860</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrstr"></a>xmlStrstr ()</h3><pre class="programlisting">const <a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlStrstr (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str,
861 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *val);</pre><p>
862a strstr for xmlChar's</p><p>
863
William M. Brackc6e07552003-08-16 12:44:47 +0000864</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> the xmlChar * array (haystack)
865</td></tr><tr><td><span class="term"><i class="parameter"><tt>val</tt></i> :</span></td><td> the xmlChar to search (needle)
Daniel Veillardd7cec922003-06-13 12:30:10 +0000866</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlChar * for the first occurrence or NULL.
Daniel Veillardd4330462003-04-29 12:40:16 +0000867</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrcasestr"></a>xmlStrcasestr ()</h3><pre class="programlisting">const <a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlStrcasestr (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str,
868 <a href="libxml-tree.html#xmlChar">xmlChar</a> *val);</pre><p>
869a case-ignoring strstr for xmlChar's</p><p>
870
William M. Brackc6e07552003-08-16 12:44:47 +0000871</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> the xmlChar * array (haystack)
872</td></tr><tr><td><span class="term"><i class="parameter"><tt>val</tt></i> :</span></td><td> the xmlChar to search (needle)
Daniel Veillardd7cec922003-06-13 12:30:10 +0000873</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlChar * for the first occurrence or NULL.
Daniel Veillardd4330462003-04-29 12:40:16 +0000874</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrcmp"></a>xmlStrcmp ()</h3><pre class="programlisting">int xmlStrcmp (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str1,
875 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str2);</pre><p>
876a strcmp for xmlChar's</p><p>
877
William M. Brackc6e07552003-08-16 12:44:47 +0000878</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str1</tt></i> :</span></td><td> the first xmlChar *
879</td></tr><tr><td><span class="term"><i class="parameter"><tt>str2</tt></i> :</span></td><td> the second xmlChar *
Daniel Veillardd7cec922003-06-13 12:30:10 +0000880</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the integer result of the comparison
Daniel Veillardd4330462003-04-29 12:40:16 +0000881</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrncmp"></a>xmlStrncmp ()</h3><pre class="programlisting">int xmlStrncmp (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str1,
882 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str2,
883 int len);</pre><p>
884a strncmp for xmlChar's</p><p>
885
William M. Brackc6e07552003-08-16 12:44:47 +0000886</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str1</tt></i> :</span></td><td> the first xmlChar *
887</td></tr><tr><td><span class="term"><i class="parameter"><tt>str2</tt></i> :</span></td><td> the second xmlChar *
888</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the max comparison length
Daniel Veillardd7cec922003-06-13 12:30:10 +0000889</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the integer result of the comparison
Daniel Veillardd4330462003-04-29 12:40:16 +0000890</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrcasecmp"></a>xmlStrcasecmp ()</h3><pre class="programlisting">int xmlStrcasecmp (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str1,
891 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str2);</pre><p>
892a strcasecmp for xmlChar's</p><p>
893
William M. Brackc6e07552003-08-16 12:44:47 +0000894</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str1</tt></i> :</span></td><td> the first xmlChar *
895</td></tr><tr><td><span class="term"><i class="parameter"><tt>str2</tt></i> :</span></td><td> the second xmlChar *
Daniel Veillardd7cec922003-06-13 12:30:10 +0000896</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the integer result of the comparison
Daniel Veillardd4330462003-04-29 12:40:16 +0000897</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrncasecmp"></a>xmlStrncasecmp ()</h3><pre class="programlisting">int xmlStrncasecmp (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str1,
898 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str2,
899 int len);</pre><p>
900a strncasecmp for xmlChar's</p><p>
901
William M. Brackc6e07552003-08-16 12:44:47 +0000902</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str1</tt></i> :</span></td><td> the first xmlChar *
903</td></tr><tr><td><span class="term"><i class="parameter"><tt>str2</tt></i> :</span></td><td> the second xmlChar *
904</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the max comparison length
Daniel Veillardd7cec922003-06-13 12:30:10 +0000905</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the integer result of the comparison
Daniel Veillardd4330462003-04-29 12:40:16 +0000906</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrEqual"></a>xmlStrEqual ()</h3><pre class="programlisting">int xmlStrEqual (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str1,
907 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str2);</pre><p>
908Check if both string are equal of have same content
909Should be a bit more readable and faster than <a href="libxml-parser.html#xmlStrEqual">xmlStrEqual</a>()</p><p>
910
William M. Brackc6e07552003-08-16 12:44:47 +0000911</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str1</tt></i> :</span></td><td> the first xmlChar *
912</td></tr><tr><td><span class="term"><i class="parameter"><tt>str2</tt></i> :</span></td><td> the second xmlChar *
Daniel Veillardd7cec922003-06-13 12:30:10 +0000913</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 if they are equal, 0 if they are different
Daniel Veillardd4330462003-04-29 12:40:16 +0000914</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrlen"></a>xmlStrlen ()</h3><pre class="programlisting">int xmlStrlen (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *str);</pre><p>
915length of a xmlChar's string</p><p>
916
William M. Brackc6e07552003-08-16 12:44:47 +0000917</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>str</tt></i> :</span></td><td> the xmlChar * array
Daniel Veillardd7cec922003-06-13 12:30:10 +0000918</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number of xmlChar contained in the ARRAY.
Daniel Veillardd4330462003-04-29 12:40:16 +0000919</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrcat"></a>xmlStrcat ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlStrcat (<a href="libxml-tree.html#xmlChar">xmlChar</a> *cur,
920 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *add);</pre><p>
921a strcat for array of xmlChar's. Since they are supposed to be
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000922encoded in UTF-8 or an encoding with 8bit based chars, we assume
Daniel Veillardd4330462003-04-29 12:40:16 +0000923a termination mark of '0'.</p><p>
924
William M. Brackc6e07552003-08-16 12:44:47 +0000925</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>cur</tt></i> :</span></td><td> the original xmlChar * array
926</td></tr><tr><td><span class="term"><i class="parameter"><tt>add</tt></i> :</span></td><td> the xmlChar * array added
Daniel Veillardd7cec922003-06-13 12:30:10 +0000927</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a new xmlChar * containing the concatenated string.
Daniel Veillardd4330462003-04-29 12:40:16 +0000928</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrncat"></a>xmlStrncat ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlChar">xmlChar</a>* xmlStrncat (<a href="libxml-tree.html#xmlChar">xmlChar</a> *cur,
929 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *add,
930 int len);</pre><p>
William M. Brackc6e07552003-08-16 12:44:47 +0000931a strncat for array of xmlChar's, it will extend <i class="parameter"><tt>cur</tt></i> with the len
932first bytes of <i class="parameter"><tt>add</tt></i>.</p><p>
Daniel Veillardd4330462003-04-29 12:40:16 +0000933
William M. Brackc6e07552003-08-16 12:44:47 +0000934</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>cur</tt></i> :</span></td><td> the original xmlChar * array
935</td></tr><tr><td><span class="term"><i class="parameter"><tt>add</tt></i> :</span></td><td> the xmlChar * array added
936</td></tr><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the length of <i class="parameter"><tt>add</tt></i>
937</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a new xmlChar *, the original <i class="parameter"><tt>cur</tt></i> is reallocated if needed
Daniel Veillardd7cec922003-06-13 12:30:10 +0000938and should not be freed
Daniel Veillardd4330462003-04-29 12:40:16 +0000939</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParseDoc"></a>xmlParseDoc ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlParseDoc (<a href="libxml-tree.html#xmlChar">xmlChar</a> *cur);</pre><p>
940parse an XML in-memory document and build a tree.</p><p>
941
William M. Brackc6e07552003-08-16 12:44:47 +0000942</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>cur</tt></i> :</span></td><td> a pointer to an array of xmlChar
Daniel Veillardd7cec922003-06-13 12:30:10 +0000943</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree
Daniel Veillardd4330462003-04-29 12:40:16 +0000944</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParseMemory"></a>xmlParseMemory ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlParseMemory (const char *buffer,
945 int size);</pre><p>
946parse an XML in-memory block and build a tree.</p><p>
947
William M. Brackc6e07552003-08-16 12:44:47 +0000948</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> an pointer to a char array
949</td></tr><tr><td><span class="term"><i class="parameter"><tt>size</tt></i> :</span></td><td> the size of the array
Daniel Veillardd7cec922003-06-13 12:30:10 +0000950</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree
Daniel Veillardd4330462003-04-29 12:40:16 +0000951</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParseFile"></a>xmlParseFile ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlParseFile (const char *filename);</pre><p>
952parse an XML file and build a tree. Automatic support for ZLIB/Compress
953compressed document is provided by default if found at compile-time.</p><p>
954
William M. Brackc6e07552003-08-16 12:44:47 +0000955</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i> :</span></td><td> the filename
Daniel Veillardd7cec922003-06-13 12:30:10 +0000956</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree if the file was wellformed,
957NULL otherwise.
Daniel Veillardd4330462003-04-29 12:40:16 +0000958</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSubstituteEntitiesDefault"></a>xmlSubstituteEntitiesDefault ()</h3><pre class="programlisting">int xmlSubstituteEntitiesDefault (int val);</pre><p>
959Set and return the previous value for default entity support.
Daniel Veillard011b63c1999-06-02 17:44:04 +0000960Initially the parser always keep entity references instead of substituting
961entity values in the output. This function has to be used to change the
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000962default parser behavior
Daniel Veillardd4330462003-04-29 12:40:16 +0000963SAX::<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="substituteEntities">substituteEntities</GTKDOCLINK>() has to be used for changing that on a file by
964file basis.</p><p>
965
William M. Brackc6e07552003-08-16 12:44:47 +0000966</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>val</tt></i> :</span></td><td> int 0 or 1
Daniel Veillardd7cec922003-06-13 12:30:10 +0000967</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the last value for 0 for no substitution, 1 for substitution.
Daniel Veillardd4330462003-04-29 12:40:16 +0000968</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlKeepBlanksDefault"></a>xmlKeepBlanksDefault ()</h3><pre class="programlisting">int xmlKeepBlanksDefault (int val);</pre><p>
969Set and return the previous value for default blanks text nodes support.
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000970The 1.x version of the parser used an heuristic to try to detect
971ignorable white spaces. As a result the SAX callback was generating
Daniel Veillardd4330462003-04-29 12:40:16 +0000972<a href="libxml-SAX.html#ignorableWhitespace">ignorableWhitespace</a>() callbacks instead of <a href="libxml-SAX.html#characters">characters</a>() one, and when
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000973using the DOM output text nodes containing those blanks were not generated.
974The 2.x and later version will switch to the XML standard way and
Daniel Veillardd4330462003-04-29 12:40:16 +0000975<a href="libxml-SAX.html#ignorableWhitespace">ignorableWhitespace</a>() are only generated when running the parser in
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000976validating mode and when the current element doesn't allow CDATA or
977mixed content.
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000978This function is provided as a way to force the standard behavior
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000979on 1.X libs and to switch back to the old mode for compatibility when
980running 1.X client code on 2.X . Upgrade of 1.X code should be done
Daniel Veillardcfba2fe2003-08-15 00:33:43 +0000981by using <a href="libxml-tree.html#xmlIsBlankNode">xmlIsBlankNode</a>() commodity function to detect the "empty"
Daniel Veillard3f6f7f62000-06-30 17:58:25 +0000982nodes generated.
983This value also affect autogeneration of indentation when saving code
Daniel Veillardd4330462003-04-29 12:40:16 +0000984if blanks sections are kept, indentation is not generated.</p><p>
985
William M. Brackc6e07552003-08-16 12:44:47 +0000986</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>val</tt></i> :</span></td><td> int 0 or 1
Daniel Veillardd7cec922003-06-13 12:30:10 +0000987</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the last value for 0 for no substitution, 1 for substitution.
Daniel Veillardd4330462003-04-29 12:40:16 +0000988</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStopParser"></a>xmlStopParser ()</h3><pre class="programlisting">void xmlStopParser (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);</pre><p>
989Blocks further parser processing</p><p>
990
William M. Brackc6e07552003-08-16 12:44:47 +0000991</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> an XML parser context
Daniel Veillardd4330462003-04-29 12:40:16 +0000992</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlPedanticParserDefault"></a>xmlPedanticParserDefault ()</h3><pre class="programlisting">int xmlPedanticParserDefault (int val);</pre><p>
993Set and return the previous value for enabling pedantic warnings.</p><p>
994
William M. Brackc6e07552003-08-16 12:44:47 +0000995</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>val</tt></i> :</span></td><td> int 0 or 1
Daniel Veillardd7cec922003-06-13 12:30:10 +0000996</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the last value for 0 for no substitution, 1 for substitution.
Daniel Veillardd4330462003-04-29 12:40:16 +0000997</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlLineNumbersDefault"></a>xmlLineNumbersDefault ()</h3><pre class="programlisting">int xmlLineNumbersDefault (int val);</pre><p>
998Set and return the previous value for enabling line numbers in elements
999contents. This may break on old application and is turned off by default.</p><p>
1000
William M. Brackc6e07552003-08-16 12:44:47 +00001001</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>val</tt></i> :</span></td><td> int 0 or 1
Daniel Veillardd7cec922003-06-13 12:30:10 +00001002</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the last value for 0 for no substitution, 1 for substitution.
Daniel Veillardd4330462003-04-29 12:40:16 +00001003</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlRecoverDoc"></a>xmlRecoverDoc ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlRecoverDoc (<a href="libxml-tree.html#xmlChar">xmlChar</a> *cur);</pre><p>
1004parse an XML in-memory document and build a tree.
1005In the case the document is not Well Formed, a tree is built anyway</p><p>
1006
William M. Brackc6e07552003-08-16 12:44:47 +00001007</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>cur</tt></i> :</span></td><td> a pointer to an array of xmlChar
Daniel Veillardd7cec922003-06-13 12:30:10 +00001008</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree
Daniel Veillardd4330462003-04-29 12:40:16 +00001009</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlRecoverMemory"></a>xmlRecoverMemory ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlRecoverMemory (const char *buffer,
1010 int size);</pre><p>
1011parse an XML in-memory block and build a tree.
1012In the case the document is not Well Formed, a tree is built anyway</p><p>
1013
William M. Brackc6e07552003-08-16 12:44:47 +00001014</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> an pointer to a char array
1015</td></tr><tr><td><span class="term"><i class="parameter"><tt>size</tt></i> :</span></td><td> the size of the array
Daniel Veillardd7cec922003-06-13 12:30:10 +00001016</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree
Daniel Veillardd4330462003-04-29 12:40:16 +00001017</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlRecoverFile"></a>xmlRecoverFile ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlRecoverFile (const char *filename);</pre><p>
1018parse an XML file and build a tree. Automatic support for ZLIB/Compress
Daniel Veillard06622df2002-01-21 17:53:42 +00001019compressed document is provided by default if found at compile-time.
Daniel Veillardd4330462003-04-29 12:40:16 +00001020In the case the document is not Well Formed, a tree is built anyway</p><p>
1021
William M. Brackc6e07552003-08-16 12:44:47 +00001022</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i> :</span></td><td> the filename
Daniel Veillardd7cec922003-06-13 12:30:10 +00001023</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree
Daniel Veillardd4330462003-04-29 12:40:16 +00001024</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParseDocument"></a>xmlParseDocument ()</h3><pre class="programlisting">int xmlParseDocument (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);</pre><p>
1025parse an XML document (and build a tree if using the standard SAX
1026interface).
1027</p><p>
1028[1] document ::= prolog element Misc*
1029</p><p>
1030[22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?</p><p>
1031
William M. Brackc6e07552003-08-16 12:44:47 +00001032</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> an XML parser context
Daniel Veillardd7cec922003-06-13 12:30:10 +00001033</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0, -1 in case of error. the parser context is augmented
1034 as a result of the parsing.
Daniel Veillardd4330462003-04-29 12:40:16 +00001035</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParseExtParsedEnt"></a>xmlParseExtParsedEnt ()</h3><pre class="programlisting">int xmlParseExtParsedEnt (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);</pre><p>
1036parse a general parsed entity
Daniel Veillard06622df2002-01-21 17:53:42 +00001037An external general parsed entity is well-formed if it matches the
Daniel Veillardd4330462003-04-29 12:40:16 +00001038production labeled extParsedEnt.
1039</p><p>
1040[78] extParsedEnt ::= TextDecl? content</p><p>
1041
William M. Brackc6e07552003-08-16 12:44:47 +00001042</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> an XML parser context
Daniel Veillardd7cec922003-06-13 12:30:10 +00001043</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0, -1 in case of error. the parser context is augmented
1044 as a result of the parsing.
Daniel Veillardd4330462003-04-29 12:40:16 +00001045</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSAXParseDoc"></a>xmlSAXParseDoc ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlSAXParseDoc (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
1046 <a href="libxml-tree.html#xmlChar">xmlChar</a> *cur,
1047 int recovery);</pre><p>
1048parse an XML in-memory document and build a tree.
Daniel Veillard06622df2002-01-21 17:53:42 +00001049It use the given SAX function block to handle the parsing callback.
Daniel Veillardd4330462003-04-29 12:40:16 +00001050If sax is NULL, fallback to the default DOM tree building routines.</p><p>
1051
William M. Brackc6e07552003-08-16 12:44:47 +00001052</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> the SAX handler block
1053</td></tr><tr><td><span class="term"><i class="parameter"><tt>cur</tt></i> :</span></td><td> a pointer to an array of xmlChar
1054</td></tr><tr><td><span class="term"><i class="parameter"><tt>recovery</tt></i> :</span></td><td> work in recovery mode, i.e. tries to read no Well Formed
Daniel Veillardd7cec922003-06-13 12:30:10 +00001055 documents
1056</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree
Daniel Veillardd4330462003-04-29 12:40:16 +00001057</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSAXUserParseFile"></a>xmlSAXUserParseFile ()</h3><pre class="programlisting">int xmlSAXUserParseFile (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard06622df2002-01-21 17:53:42 +00001058 void *user_data,
Daniel Veillardd4330462003-04-29 12:40:16 +00001059 const char *filename);</pre><p>
1060parse an XML file and call the given SAX handler routines.
1061Automatic support for ZLIB/Compress compressed document is provided</p><p>
1062
William M. Brackc6e07552003-08-16 12:44:47 +00001063</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> a SAX handler
1064</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_data</tt></i> :</span></td><td> The user data returned on SAX callbacks
1065</td></tr><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i> :</span></td><td> a file name
Daniel Veillardd7cec922003-06-13 12:30:10 +00001066</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 in case of success or a error number otherwise
Daniel Veillardd4330462003-04-29 12:40:16 +00001067</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSAXUserParseMemory"></a>xmlSAXUserParseMemory ()</h3><pre class="programlisting">int xmlSAXUserParseMemory (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard06622df2002-01-21 17:53:42 +00001068 void *user_data,
1069 const char *buffer,
Daniel Veillardd4330462003-04-29 12:40:16 +00001070 int size);</pre><p>
1071A better SAX parsing routine.
1072parse an XML in-memory buffer and call the given SAX handler routines.</p><p>
1073
William M. Brackc6e07552003-08-16 12:44:47 +00001074</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> a SAX handler
1075</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_data</tt></i> :</span></td><td> The user data returned on SAX callbacks
1076</td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> an in-memory XML document input
1077</td></tr><tr><td><span class="term"><i class="parameter"><tt>size</tt></i> :</span></td><td> the length of the XML document in bytes
Daniel Veillardd7cec922003-06-13 12:30:10 +00001078</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 in case of success or a error number otherwise
Daniel Veillardd4330462003-04-29 12:40:16 +00001079</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSAXParseMemory"></a>xmlSAXParseMemory ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlSAXParseMemory (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard06622df2002-01-21 17:53:42 +00001080 const char *buffer,
1081 int size,
Daniel Veillardd4330462003-04-29 12:40:16 +00001082 int recovery);</pre><p>
1083parse an XML in-memory block and use the given SAX function block
Daniel Veillard06622df2002-01-21 17:53:42 +00001084to handle the parsing callback. If sax is NULL, fallback to the default
Daniel Veillardd4330462003-04-29 12:40:16 +00001085DOM tree building routines.</p><p>
1086
William M. Brackc6e07552003-08-16 12:44:47 +00001087</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> the SAX handler block
1088</td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> an pointer to a char array
1089</td></tr><tr><td><span class="term"><i class="parameter"><tt>size</tt></i> :</span></td><td> the size of the array
1090</td></tr><tr><td><span class="term"><i class="parameter"><tt>recovery</tt></i> :</span></td><td> work in recovery mode, i.e. tries to read not Well Formed
Daniel Veillardd7cec922003-06-13 12:30:10 +00001091 documents
1092</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree
Daniel Veillardd4330462003-04-29 12:40:16 +00001093</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSAXParseMemoryWithData"></a>xmlSAXParseMemoryWithData ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlSAXParseMemoryWithData (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillardaec63562003-03-23 20:42:17 +00001094 const char *buffer,
1095 int size,
Daniel Veillard06622df2002-01-21 17:53:42 +00001096 int recovery,
Daniel Veillardd4330462003-04-29 12:40:16 +00001097 void *data);</pre><p>
1098parse an XML in-memory block and use the given SAX function block
Daniel Veillardaec63562003-03-23 20:42:17 +00001099to handle the parsing callback. If sax is NULL, fallback to the default
Daniel Veillardd4330462003-04-29 12:40:16 +00001100DOM tree building routines.
1101</p><p>
1102User data (void *) is stored within the parser context in the
1103context's _private member, so it is available nearly everywhere in libxml</p><p>
1104
William M. Brackc6e07552003-08-16 12:44:47 +00001105</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> the SAX handler block
1106</td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> an pointer to a char array
1107</td></tr><tr><td><span class="term"><i class="parameter"><tt>size</tt></i> :</span></td><td> the size of the array
1108</td></tr><tr><td><span class="term"><i class="parameter"><tt>recovery</tt></i> :</span></td><td> work in recovery mode, i.e. tries to read no Well Formed
Daniel Veillardd7cec922003-06-13 12:30:10 +00001109 documents
William M. Brackc6e07552003-08-16 12:44:47 +00001110</td></tr><tr><td><span class="term"><i class="parameter"><tt>data</tt></i> :</span></td><td> the userdata
Daniel Veillardd7cec922003-06-13 12:30:10 +00001111</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree
Daniel Veillardd4330462003-04-29 12:40:16 +00001112</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSAXParseFile"></a>xmlSAXParseFile ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlSAXParseFile (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillardaec63562003-03-23 20:42:17 +00001113 const char *filename,
Daniel Veillardd4330462003-04-29 12:40:16 +00001114 int recovery);</pre><p>
1115parse an XML file and build a tree. Automatic support for ZLIB/Compress
Daniel Veillardaec63562003-03-23 20:42:17 +00001116compressed document is provided by default if found at compile-time.
1117It use the given SAX function block to handle the parsing callback.
Daniel Veillardd4330462003-04-29 12:40:16 +00001118If sax is NULL, fallback to the default DOM tree building routines.</p><p>
1119
William M. Brackc6e07552003-08-16 12:44:47 +00001120</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> the SAX handler block
1121</td></tr><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i> :</span></td><td> the filename
1122</td></tr><tr><td><span class="term"><i class="parameter"><tt>recovery</tt></i> :</span></td><td> work in recovery mode, i.e. tries to read no Well Formed
Daniel Veillardd7cec922003-06-13 12:30:10 +00001123 documents
1124</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree
Daniel Veillardd4330462003-04-29 12:40:16 +00001125</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSAXParseFileWithData"></a>xmlSAXParseFileWithData ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlSAXParseFileWithData (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillardaec63562003-03-23 20:42:17 +00001126 const char *filename,
1127 int recovery,
Daniel Veillardd4330462003-04-29 12:40:16 +00001128 void *data);</pre><p>
1129parse an XML file and build a tree. Automatic support for ZLIB/Compress
Daniel Veillardaec63562003-03-23 20:42:17 +00001130compressed document is provided by default if found at compile-time.
1131It use the given SAX function block to handle the parsing callback.
Daniel Veillardd4330462003-04-29 12:40:16 +00001132If sax is NULL, fallback to the default DOM tree building routines.
1133</p><p>
1134User data (void *) is stored within the parser context in the
1135context's _private member, so it is available nearly everywhere in libxml</p><p>
1136
William M. Brackc6e07552003-08-16 12:44:47 +00001137</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> the SAX handler block
1138</td></tr><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i> :</span></td><td> the filename
1139</td></tr><tr><td><span class="term"><i class="parameter"><tt>recovery</tt></i> :</span></td><td> work in recovery mode, i.e. tries to read no Well Formed
Daniel Veillardd7cec922003-06-13 12:30:10 +00001140 documents
William M. Brackc6e07552003-08-16 12:44:47 +00001141</td></tr><tr><td><span class="term"><i class="parameter"><tt>data</tt></i> :</span></td><td> the userdata
Daniel Veillardd7cec922003-06-13 12:30:10 +00001142</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree
Daniel Veillardd4330462003-04-29 12:40:16 +00001143</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSAXParseEntity"></a>xmlSAXParseEntity ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlSAXParseEntity (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
1144 const char *filename);</pre><p>
1145parse an XML external entity out of context and build a tree.
Daniel Veillard06622df2002-01-21 17:53:42 +00001146It use the given SAX function block to handle the parsing callback.
Daniel Veillardd4330462003-04-29 12:40:16 +00001147If sax is NULL, fallback to the default DOM tree building routines.
1148</p><p>
1149[78] extParsedEnt ::= TextDecl? content
1150</p><p>
Daniel Veillardcfba2fe2003-08-15 00:33:43 +00001151This correspond to a "Well Balanced" chunk</p><p>
Daniel Veillardd4330462003-04-29 12:40:16 +00001152
William M. Brackc6e07552003-08-16 12:44:47 +00001153</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> the SAX handler block
1154</td></tr><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i> :</span></td><td> the filename
Daniel Veillardd7cec922003-06-13 12:30:10 +00001155</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree
Daniel Veillardd4330462003-04-29 12:40:16 +00001156</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParseEntity"></a>xmlParseEntity ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> xmlParseEntity (const char *filename);</pre><p>
1157parse an XML external entity out of context and build a tree.
1158</p><p>
1159[78] extParsedEnt ::= TextDecl? content
1160</p><p>
Daniel Veillardcfba2fe2003-08-15 00:33:43 +00001161This correspond to a "Well Balanced" chunk</p><p>
Daniel Veillardd4330462003-04-29 12:40:16 +00001162
William M. Brackc6e07552003-08-16 12:44:47 +00001163</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i> :</span></td><td> the filename
Daniel Veillardd7cec922003-06-13 12:30:10 +00001164</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting document tree
Daniel Veillardd4330462003-04-29 12:40:16 +00001165</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParseDTD"></a>xmlParseDTD ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> xmlParseDTD (const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID,
1166 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);</pre><p>
1167Load and parse an external subset.</p><p>
1168
William M. Brackc6e07552003-08-16 12:44:47 +00001169</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ExternalID</tt></i> :</span></td><td> a NAME* containing the External ID of the DTD
1170</td></tr><tr><td><span class="term"><i class="parameter"><tt>SystemID</tt></i> :</span></td><td> a NAME* containing the URL to the DTD
Daniel Veillardd7cec922003-06-13 12:30:10 +00001171</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting xmlDtdPtr or NULL in case of error.
Daniel Veillardd4330462003-04-29 12:40:16 +00001172</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSAXParseDTD"></a>xmlSAXParseDTD ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> xmlSAXParseDTD (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
1173 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID,
1174 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);</pre><p>
1175Load and parse an external subset.</p><p>
1176
William M. Brackc6e07552003-08-16 12:44:47 +00001177</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> the SAX handler block
1178</td></tr><tr><td><span class="term"><i class="parameter"><tt>ExternalID</tt></i> :</span></td><td> a NAME* containing the External ID of the DTD
1179</td></tr><tr><td><span class="term"><i class="parameter"><tt>SystemID</tt></i> :</span></td><td> a NAME* containing the URL to the DTD
Daniel Veillardd7cec922003-06-13 12:30:10 +00001180</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting xmlDtdPtr or NULL in case of error.
Daniel Veillardd4330462003-04-29 12:40:16 +00001181</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlIOParseDTD"></a>xmlIOParseDTD ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDtdPtr">xmlDtdPtr</a> xmlIOParseDTD (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
1182 <a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input,
1183 <a href="libxml-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc);</pre><p>
1184Load and parse a DTD</p><p>
1185
William M. Brackc6e07552003-08-16 12:44:47 +00001186</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> the SAX handler block or NULL
1187</td></tr><tr><td><span class="term"><i class="parameter"><tt>input</tt></i> :</span></td><td> an Input Buffer
1188</td></tr><tr><td><span class="term"><i class="parameter"><tt>enc</tt></i> :</span></td><td> the charset encoding if known
Daniel Veillardd7cec922003-06-13 12:30:10 +00001189</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the resulting xmlDtdPtr or NULL in case of error.
William M. Brackc6e07552003-08-16 12:44:47 +00001190<i class="parameter"><tt>input</tt></i> will be freed at parsing end.
Daniel Veillardd4330462003-04-29 12:40:16 +00001191</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParseBalancedChunkMemory"></a>xmlParseBalancedChunkMemory ()</h3><pre class="programlisting">int xmlParseBalancedChunkMemory (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
1192 <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard06622df2002-01-21 17:53:42 +00001193 void *user_data,
1194 int depth,
Daniel Veillardd4330462003-04-29 12:40:16 +00001195 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *string,
1196 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> *lst);</pre><p>
1197Parse a well-balanced chunk of an XML document
Daniel Veillard06622df2002-01-21 17:53:42 +00001198called by the parser
1199The allowed sequence for the Well Balanced Chunk is the one defined by
Daniel Veillardd4330462003-04-29 12:40:16 +00001200the content production in the XML grammar:
1201</p><p>
1202[43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p><p>
1203
William M. Brackc6e07552003-08-16 12:44:47 +00001204</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>doc</tt></i> :</span></td><td> the document the chunk pertains to
1205</td></tr><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> the SAX handler bloc (possibly NULL)
1206</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_data</tt></i> :</span></td><td> The user data returned on SAX callbacks (possibly NULL)
1207</td></tr><tr><td><span class="term"><i class="parameter"><tt>depth</tt></i> :</span></td><td> Used for loop detection, use 0
1208</td></tr><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> the input string in UTF8 or ISO-Latin (zero terminated)
1209</td></tr><tr><td><span class="term"><i class="parameter"><tt>lst</tt></i> :</span></td><td> the return value for the set of parsed nodes
Daniel Veillardd7cec922003-06-13 12:30:10 +00001210</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and
1211 the parser error code otherwise
Daniel Veillardd4330462003-04-29 12:40:16 +00001212</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParseBalancedChunkMemoryRecover"></a>xmlParseBalancedChunkMemoryRecover ()</h3><pre class="programlisting">int xmlParseBalancedChunkMemoryRecover
1213 (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
1214 <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard2ace1952002-09-26 12:28:02 +00001215 void *user_data,
1216 int depth,
Daniel Veillardd4330462003-04-29 12:40:16 +00001217 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *string,
1218 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> *lst,
1219 int recover);</pre><p>
1220Parse a well-balanced chunk of an XML document
Daniel Veillard2ace1952002-09-26 12:28:02 +00001221called by the parser
1222The allowed sequence for the Well Balanced Chunk is the one defined by
Daniel Veillardd4330462003-04-29 12:40:16 +00001223the content production in the XML grammar:
1224</p><p>
1225[43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p><p>
1226
William M. Brackc6e07552003-08-16 12:44:47 +00001227</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>doc</tt></i> :</span></td><td> the document the chunk pertains to
1228</td></tr><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> the SAX handler bloc (possibly NULL)
1229</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_data</tt></i> :</span></td><td> The user data returned on SAX callbacks (possibly NULL)
1230</td></tr><tr><td><span class="term"><i class="parameter"><tt>depth</tt></i> :</span></td><td> Used for loop detection, use 0
1231</td></tr><tr><td><span class="term"><i class="parameter"><tt>string</tt></i> :</span></td><td> the input string in UTF8 or ISO-Latin (zero terminated)
1232</td></tr><tr><td><span class="term"><i class="parameter"><tt>lst</tt></i> :</span></td><td> the return value for the set of parsed nodes
1233</td></tr><tr><td><span class="term"><i class="parameter"><tt>recover</tt></i> :</span></td><td> return nodes even if the data is broken (use 0)
Daniel Veillardd7cec922003-06-13 12:30:10 +00001234</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and
1235 the parser error code otherwise
1236
1237In case recover is set to 1, the nodelist will not be empty even if
1238the parsed chunk is not well balanced.
Daniel Veillardd4330462003-04-29 12:40:16 +00001239</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParseExternalEntity"></a>xmlParseExternalEntity ()</h3><pre class="programlisting">int xmlParseExternalEntity (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
1240 <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard06622df2002-01-21 17:53:42 +00001241 void *user_data,
1242 int depth,
Daniel Veillardd4330462003-04-29 12:40:16 +00001243 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *URL,
1244 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ID,
1245 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> *lst);</pre><p>
1246Parse an external general entity
Daniel Veillard06622df2002-01-21 17:53:42 +00001247An external general parsed entity is well-formed if it matches the
Daniel Veillardd4330462003-04-29 12:40:16 +00001248production labeled extParsedEnt.
1249</p><p>
1250[78] extParsedEnt ::= TextDecl? content</p><p>
1251
William M. Brackc6e07552003-08-16 12:44:47 +00001252</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>doc</tt></i> :</span></td><td> the document the chunk pertains to
1253</td></tr><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> the SAX handler bloc (possibly NULL)
1254</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_data</tt></i> :</span></td><td> The user data returned on SAX callbacks (possibly NULL)
1255</td></tr><tr><td><span class="term"><i class="parameter"><tt>depth</tt></i> :</span></td><td> Used for loop detection, use 0
1256</td></tr><tr><td><span class="term"><i class="parameter"><tt>URL</tt></i> :</span></td><td> the URL for the entity to load
1257</td></tr><tr><td><span class="term"><i class="parameter"><tt>ID</tt></i> :</span></td><td> the System ID for the entity to load
1258</td></tr><tr><td><span class="term"><i class="parameter"><tt>lst</tt></i> :</span></td><td> the return value for the set of parsed nodes
Daniel Veillardd7cec922003-06-13 12:30:10 +00001259</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 if the entity is well formed, -1 in case of args problem and
1260 the parser error code otherwise
Daniel Veillardd4330462003-04-29 12:40:16 +00001261</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParseCtxtExternalEntity"></a>xmlParseCtxtExternalEntity ()</h3><pre class="programlisting">int xmlParseCtxtExternalEntity (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctx,
1262 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *URL,
1263 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ID,
1264 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> *lst);</pre><p>
1265Parse an external general entity within an existing parsing context
Daniel Veillard06622df2002-01-21 17:53:42 +00001266An external general parsed entity is well-formed if it matches the
Daniel Veillardd4330462003-04-29 12:40:16 +00001267production labeled extParsedEnt.
1268</p><p>
1269[78] extParsedEnt ::= TextDecl? content</p><p>
1270
William M. Brackc6e07552003-08-16 12:44:47 +00001271</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctx</tt></i> :</span></td><td> the existing parsing context
1272</td></tr><tr><td><span class="term"><i class="parameter"><tt>URL</tt></i> :</span></td><td> the URL for the entity to load
1273</td></tr><tr><td><span class="term"><i class="parameter"><tt>ID</tt></i> :</span></td><td> the System ID for the entity to load
1274</td></tr><tr><td><span class="term"><i class="parameter"><tt>lst</tt></i> :</span></td><td> the return value for the set of parsed nodes
Daniel Veillardd7cec922003-06-13 12:30:10 +00001275</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 if the entity is well formed, -1 in case of args problem and
1276 the parser error code otherwise
Daniel Veillardd4330462003-04-29 12:40:16 +00001277</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlInitParserCtxt"></a>xmlInitParserCtxt ()</h3><pre class="programlisting">int xmlInitParserCtxt (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);</pre><p>
1278Initialize a parser context</p><p>
1279
William M. Brackc6e07552003-08-16 12:44:47 +00001280</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> an HTML parser context
1281</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
1282
1283
Daniel Veillardd4330462003-04-29 12:40:16 +00001284</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlClearParserCtxt"></a>xmlClearParserCtxt ()</h3><pre class="programlisting">void xmlClearParserCtxt (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);</pre><p>
1285Clear (release owned resources) and reinitialize a parser context</p><p>
1286
William M. Brackc6e07552003-08-16 12:44:47 +00001287</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> an XML parser context
Daniel Veillardd4330462003-04-29 12:40:16 +00001288</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlFreeParserCtxt"></a>xmlFreeParserCtxt ()</h3><pre class="programlisting">void xmlFreeParserCtxt (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);</pre><p>
1289Free all the memory used by a parser context. However the parsed
1290document in ctxt-&gt;myDoc is not freed.</p><p>
1291
William M. Brackc6e07552003-08-16 12:44:47 +00001292</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> an XML parser context
Daniel Veillardd4330462003-04-29 12:40:16 +00001293</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSetupParserForBuffer"></a>xmlSetupParserForBuffer ()</h3><pre class="programlisting">void xmlSetupParserForBuffer (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
1294 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *buffer,
1295 const char *filename);</pre><p>
1296Setup the parser context to parse a new buffer; Clears any prior
Daniel Veillard06622df2002-01-21 17:53:42 +00001297contents from the parser context. The buffer parameter must not be
Daniel Veillardd4330462003-04-29 12:40:16 +00001298NULL, but the filename parameter can be</p><p>
1299
William M. Brackc6e07552003-08-16 12:44:47 +00001300</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> an XML parser context
1301</td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> a xmlChar * buffer
1302</td></tr><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i> :</span></td><td> a file name
Daniel Veillardd4330462003-04-29 12:40:16 +00001303</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlCreateDocParserCtxt"></a>xmlCreateDocParserCtxt ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> xmlCreateDocParserCtxt (<a href="libxml-tree.html#xmlChar">xmlChar</a> *cur);</pre><p>
1304Creates a parser context for an XML in-memory document.</p><p>
1305
William M. Brackc6e07552003-08-16 12:44:47 +00001306</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>cur</tt></i> :</span></td><td> a pointer to an array of xmlChar
Daniel Veillardd7cec922003-06-13 12:30:10 +00001307</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the new parser context or NULL
Daniel Veillardd4330462003-04-29 12:40:16 +00001308</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlGetFeaturesList"></a>xmlGetFeaturesList ()</h3><pre class="programlisting">int xmlGetFeaturesList (int *len,
1309 const char **result);</pre><p>
William M. Brackc6e07552003-08-16 12:44:47 +00001310Copy at most *<i class="parameter"><tt>len</tt></i> feature names into the <i class="parameter"><tt>result</tt></i> array</p><p>
Daniel Veillardd4330462003-04-29 12:40:16 +00001311
William M. Brackc6e07552003-08-16 12:44:47 +00001312</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>len</tt></i> :</span></td><td> the length of the features name array (input/output)
1313</td></tr><tr><td><span class="term"><i class="parameter"><tt>result</tt></i> :</span></td><td> an array of string to be filled with the features name.
Daniel Veillardd7cec922003-06-13 12:30:10 +00001314</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 in case or error, or the total number of features,
1315 len is updated with the number of strings copied,
1316 strings must not be deallocated
Daniel Veillardd4330462003-04-29 12:40:16 +00001317</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlGetFeature"></a>xmlGetFeature ()</h3><pre class="programlisting">int xmlGetFeature (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
Daniel Veillard06622df2002-01-21 17:53:42 +00001318 const char *name,
Daniel Veillardd4330462003-04-29 12:40:16 +00001319 void *result);</pre><p>
1320Read the current value of one feature of this parser instance</p><p>
1321
William M. Brackc6e07552003-08-16 12:44:47 +00001322</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> an XML/HTML parser context
1323</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> the feature name
1324</td></tr><tr><td><span class="term"><i class="parameter"><tt>result</tt></i> :</span></td><td> location to store the result
Daniel Veillardd7cec922003-06-13 12:30:10 +00001325</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 in case or error, 0 otherwise
Daniel Veillardd4330462003-04-29 12:40:16 +00001326</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSetFeature"></a>xmlSetFeature ()</h3><pre class="programlisting">int xmlSetFeature (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
Daniel Veillard06622df2002-01-21 17:53:42 +00001327 const char *name,
Daniel Veillardd4330462003-04-29 12:40:16 +00001328 void *value);</pre><p>
1329Change the current value of one feature of this parser instance</p><p>
1330
William M. Brackc6e07552003-08-16 12:44:47 +00001331</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> an XML/HTML parser context
1332</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i> :</span></td><td> the feature name
1333</td></tr><tr><td><span class="term"><i class="parameter"><tt>value</tt></i> :</span></td><td> pointer to the location of the new value
Daniel Veillardd7cec922003-06-13 12:30:10 +00001334</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 in case or error, 0 otherwise
Daniel Veillardd4330462003-04-29 12:40:16 +00001335</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlCreatePushParserCtxt"></a>xmlCreatePushParserCtxt ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> xmlCreatePushParserCtxt (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard06622df2002-01-21 17:53:42 +00001336 void *user_data,
1337 const char *chunk,
1338 int size,
Daniel Veillardd4330462003-04-29 12:40:16 +00001339 const char *filename);</pre><p>
1340Create a parser context for using the XML parser in push mode.
William M. Brackc6e07552003-08-16 12:44:47 +00001341If <i class="parameter"><tt>buffer</tt></i> and <i class="parameter"><tt>size</tt></i> are non-NULL, the data is used to detect
Daniel Veillardaec63562003-03-23 20:42:17 +00001342the encoding. The remaining characters will be parsed so they
1343don't need to be fed in again through xmlParseChunk.
William M. Brackc6e07552003-08-16 12:44:47 +00001344To allow content encoding detection, <i class="parameter"><tt>size</tt></i> should be &gt;= 4
1345The value of <i class="parameter"><tt>filename</tt></i> is used for fetching external entities
Daniel Veillardd4330462003-04-29 12:40:16 +00001346and error/warning reports.</p><p>
1347
William M. Brackc6e07552003-08-16 12:44:47 +00001348</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> a SAX handler
1349</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_data</tt></i> :</span></td><td> The user data returned on SAX callbacks
1350</td></tr><tr><td><span class="term"><i class="parameter"><tt>chunk</tt></i> :</span></td><td> a pointer to an array of chars
1351</td></tr><tr><td><span class="term"><i class="parameter"><tt>size</tt></i> :</span></td><td> number of chars in the array
1352</td></tr><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i> :</span></td><td> an optional file name or URI
Daniel Veillardd7cec922003-06-13 12:30:10 +00001353</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the new parser context or NULL
Daniel Veillardd4330462003-04-29 12:40:16 +00001354</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParseChunk"></a>xmlParseChunk ()</h3><pre class="programlisting">int xmlParseChunk (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
Daniel Veillard06622df2002-01-21 17:53:42 +00001355 const char *chunk,
1356 int size,
Daniel Veillardd4330462003-04-29 12:40:16 +00001357 int terminate);</pre><p>
1358Parse a Chunk of memory</p><p>
1359
William M. Brackc6e07552003-08-16 12:44:47 +00001360</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> an XML parser context
1361</td></tr><tr><td><span class="term"><i class="parameter"><tt>chunk</tt></i> :</span></td><td> an char array
1362</td></tr><tr><td><span class="term"><i class="parameter"><tt>size</tt></i> :</span></td><td> the size in byte of the chunk
1363</td></tr><tr><td><span class="term"><i class="parameter"><tt>terminate</tt></i> :</span></td><td> last chunk indicator
Daniel Veillardd7cec922003-06-13 12:30:10 +00001364</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>zero if no error, the xmlParserErrors otherwise.
Daniel Veillardd4330462003-04-29 12:40:16 +00001365</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlCreateIOParserCtxt"></a>xmlCreateIOParserCtxt ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> xmlCreateIOParserCtxt (<a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax,
Daniel Veillard06622df2002-01-21 17:53:42 +00001366 void *user_data,
Daniel Veillardd4330462003-04-29 12:40:16 +00001367 <a href="libxml-xmlIO.html#xmlInputReadCallback">xmlInputReadCallback</a> ioread,
1368 <a href="libxml-xmlIO.html#xmlInputCloseCallback">xmlInputCloseCallback</a> ioclose,
Daniel Veillard06622df2002-01-21 17:53:42 +00001369 void *ioctx,
Daniel Veillardd4330462003-04-29 12:40:16 +00001370 <a href="libxml-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc);</pre><p>
1371Create a parser context for using the XML parser with an existing
1372I/O stream</p><p>
1373
William M. Brackc6e07552003-08-16 12:44:47 +00001374</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>sax</tt></i> :</span></td><td> a SAX handler
1375</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_data</tt></i> :</span></td><td> The user data returned on SAX callbacks
1376</td></tr><tr><td><span class="term"><i class="parameter"><tt>ioread</tt></i> :</span></td><td> an I/O read function
1377</td></tr><tr><td><span class="term"><i class="parameter"><tt>ioclose</tt></i> :</span></td><td> an I/O close function
1378</td></tr><tr><td><span class="term"><i class="parameter"><tt>ioctx</tt></i> :</span></td><td> an I/O handler
1379</td></tr><tr><td><span class="term"><i class="parameter"><tt>enc</tt></i> :</span></td><td> the charset encoding if known
Daniel Veillardd7cec922003-06-13 12:30:10 +00001380</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the new parser context or NULL
Daniel Veillardd4330462003-04-29 12:40:16 +00001381</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNewIOInputStream"></a>xmlNewIOInputStream ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> xmlNewIOInputStream (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
1382 <a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input,
1383 <a href="libxml-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc);</pre><p>
William M. Brackc6e07552003-08-16 12:44:47 +00001384Create a new input stream structure encapsulating the <i class="parameter"><tt>input</tt></i> into
Daniel Veillardd4330462003-04-29 12:40:16 +00001385a stream suitable for the parser.</p><p>
1386
William M. Brackc6e07552003-08-16 12:44:47 +00001387</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> an XML parser context
1388</td></tr><tr><td><span class="term"><i class="parameter"><tt>input</tt></i> :</span></td><td> an I/O Input
1389</td></tr><tr><td><span class="term"><i class="parameter"><tt>enc</tt></i> :</span></td><td> the charset encoding if known
Daniel Veillardd7cec922003-06-13 12:30:10 +00001390</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the new input stream or NULL
Daniel Veillardd4330462003-04-29 12:40:16 +00001391</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserFindNodeInfo"></a>xmlParserFindNodeInfo ()</h3><pre class="programlisting">const <a href="libxml-parser.html#xmlParserNodeInfo">xmlParserNodeInfo</a>* xmlParserFindNodeInfo
1392 (const <a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
1393 const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node);</pre><p>
1394Find the parser node info struct for a given node</p><p>
1395
William M. Brackc6e07552003-08-16 12:44:47 +00001396</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td>
1397</td></tr><tr><td><span class="term"><i class="parameter"><tt>node</tt></i> :</span></td><td> an XML node within the tree
Daniel Veillardd7cec922003-06-13 12:30:10 +00001398</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>an xmlParserNodeInfo block pointer or NULL
Daniel Veillardd4330462003-04-29 12:40:16 +00001399</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlInitNodeInfoSeq"></a>xmlInitNodeInfoSeq ()</h3><pre class="programlisting">void xmlInitNodeInfoSeq (<a href="libxml-parser.html#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a> seq);</pre><p>
1400-- Initialize (set to initial state) node info sequence</p><p>
1401
William M. Brackc6e07552003-08-16 12:44:47 +00001402</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>seq</tt></i> :</span></td><td> a node info sequence pointer
Daniel Veillardd4330462003-04-29 12:40:16 +00001403</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlClearNodeInfoSeq"></a>xmlClearNodeInfoSeq ()</h3><pre class="programlisting">void xmlClearNodeInfoSeq (<a href="libxml-parser.html#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a> seq);</pre><p>
1404-- Clear (release memory and reinitialize) node
1405 info sequence</p><p>
1406
William M. Brackc6e07552003-08-16 12:44:47 +00001407</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>seq</tt></i> :</span></td><td> a node info sequence pointer
Daniel Veillardd4330462003-04-29 12:40:16 +00001408</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserFindNodeInfoIndex"></a>xmlParserFindNodeInfoIndex ()</h3><pre class="programlisting">unsigned <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="long">long</GTKDOCLINK> xmlParserFindNodeInfoIndex (const <a href="libxml-parser.html#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a> seq,
1409 const <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node);</pre><p>
1410xmlParserFindNodeInfoIndex : Find the index that the info record for
1411 the given node is or should be at in a sorted sequence</p><p>
1412
William M. Brackc6e07552003-08-16 12:44:47 +00001413</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>seq</tt></i> :</span></td><td> a node info sequence pointer
1414</td></tr><tr><td><span class="term"><i class="parameter"><tt>node</tt></i> :</span></td><td> an XML node pointer
Daniel Veillardd7cec922003-06-13 12:30:10 +00001415</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a long indicating the position of the record
Daniel Veillardd4330462003-04-29 12:40:16 +00001416</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlParserAddNodeInfo"></a>xmlParserAddNodeInfo ()</h3><pre class="programlisting">void xmlParserAddNodeInfo (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt,
1417 const <a href="libxml-parser.html#xmlParserNodeInfoPtr">xmlParserNodeInfoPtr</a> info);</pre><p>
1418Insert node info record into the sorted sequence</p><p>
1419
William M. Brackc6e07552003-08-16 12:44:47 +00001420</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> an XML parser context
1421</td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i> :</span></td><td> a node info sequence pointer
Daniel Veillardd4330462003-04-29 12:40:16 +00001422</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlSetExternalEntityLoader"></a>xmlSetExternalEntityLoader ()</h3><pre class="programlisting">void xmlSetExternalEntityLoader (<a href="libxml-parser.html#xmlExternalEntityLoader">xmlExternalEntityLoader</a> f);</pre><p>
1423Changes the defaultexternal entity resolver function for the application</p><p>
1424
William M. Brackc6e07552003-08-16 12:44:47 +00001425</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>f</tt></i> :</span></td><td> the new entity resolver function
Daniel Veillardd4330462003-04-29 12:40:16 +00001426</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlGetExternalEntityLoader"></a>xmlGetExternalEntityLoader ()</h3><pre class="programlisting"><a href="libxml-parser.html#xmlExternalEntityLoader">xmlExternalEntityLoader</a> xmlGetExternalEntityLoader
1427 (void);</pre><p>
1428Get the default external entity resolver function for the application</p><p>
1429
Daniel Veillardd7cec922003-06-13 12:30:10 +00001430</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlExternalEntityLoader function pointer
Daniel Veillardd4330462003-04-29 12:40:16 +00001431</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlLoadExternalEntity"></a>xmlLoadExternalEntity ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> xmlLoadExternalEntity (const char *URL,
Daniel Veillard06622df2002-01-21 17:53:42 +00001432 const char *ID,
Daniel Veillardd4330462003-04-29 12:40:16 +00001433 <a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);</pre><p>
1434Load an external entity, note that the use of this function for
Daniel Veillard06622df2002-01-21 17:53:42 +00001435unparsed entities may generate problems
Daniel Veillardd4330462003-04-29 12:40:16 +00001436TODO: a more generic External entity API must be designed</p><p>
1437
William M. Brackc6e07552003-08-16 12:44:47 +00001438</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>URL</tt></i> :</span></td><td> the URL for the entity to load
1439</td></tr><tr><td><span class="term"><i class="parameter"><tt>ID</tt></i> :</span></td><td> the Public ID for the entity to load
1440</td></tr><tr><td><span class="term"><i class="parameter"><tt>ctxt</tt></i> :</span></td><td> the context in which the entity is called or NULL
Daniel Veillardd7cec922003-06-13 12:30:10 +00001441</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlParserInputPtr or NULL
William M. Brackc6e07552003-08-16 12:44:47 +00001442</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-threads.html"><b>&lt;&lt; threads</b></a></td><td align="right"><a accesskey="n" href="libxml-c14n.html"><b>c14n &gt;&gt;</b></a></td></tr></table></body></html>