William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 1 | <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.48"><meta name="generator" content="GTK-Doc V1.1 (XML mode)"><style type="text/css"> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 2 | .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. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 31 | </style><link rel="home" href="index.html" title="Gnome XML Library Reference Manual "><link rel="up" href="ch01.html" title="Libxml Programming Notes"><link rel="previous" href="libxml-threads.html" title="threads"><link rel="next" href="libxml-c14n.html" title="c14n"></head><body text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-threads.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">Gnome XML Library Reference Manual </th><td><a accesskey="n" href="libxml-c14n.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry"><a name="libxml-parser"></a><div class="titlepage"></div><div class="refnamediv"><h2>parser</h2><p>parser — </p></div><div class="refsynopsisdiv"><h2><h1 class="title"><a name="id2595846"></a>Synopsis</h1></h2><pre class="synopsis"> |
Daniel Veillard | 3592547 | 1999-02-25 08:46:07 +0000 | [diff] [blame] | 32 | |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 33 | |
| 34 | |
| 35 | #define <a href="libxml-parser.html#XML-DEFAULT-VERSION-CAPS">XML_DEFAULT_VERSION</a> |
| 36 | void (<a href="libxml-parser.html#xmlParserInputDeallocate">*xmlParserInputDeallocate</a>) (<a href="libxml-tree.html#xmlChar">xmlChar</a> *str); |
| 37 | struct <a href="libxml-parser.html#xmlParserInput">xmlParserInput</a>; |
| 38 | struct <a href="libxml-parser.html#xmlParserNodeInfo">xmlParserNodeInfo</a>; |
| 39 | typedef <a href="libxml-parser.html#xmlParserNodeInfoPtr">xmlParserNodeInfoPtr</a>; |
| 40 | struct <a href="libxml-parser.html#xmlParserNodeInfoSeq">xmlParserNodeInfoSeq</a>; |
| 41 | typedef <a href="libxml-parser.html#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a>; |
| 42 | enum <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> |
| 46 | struct <a href="libxml-parser.html#xmlParserCtxt">xmlParserCtxt</a>; |
| 47 | struct <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); |
| 51 | void (<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); |
| 55 | void (<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); |
| 63 | void (<a href="libxml-parser.html#entityDeclSAXFunc">*entityDeclSAXFunc</a>) (void *ctx, |
| 64 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
Daniel Veillard | 5099ae8 | 1999-04-21 20:12:07 +0000 | [diff] [blame] | 65 | int type, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 66 | 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); |
| 69 | void (<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); |
| 73 | void (<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 Veillard | 5099ae8 | 1999-04-21 20:12:07 +0000 | [diff] [blame] | 76 | int type, |
| 77 | int def, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 78 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *defaultValue, |
| 79 | <a href="libxml-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree); |
| 80 | void (<a href="libxml-parser.html#elementDeclSAXFunc">*elementDeclSAXFunc</a>) (void *ctx, |
| 81 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
Daniel Veillard | 5099ae8 | 1999-04-21 20:12:07 +0000 | [diff] [blame] | 82 | int type, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 83 | <a href="libxml-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> content); |
| 84 | void (<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); |
| 89 | void (<a href="libxml-parser.html#setDocumentLocatorSAXFunc">*setDocumentLocatorSAXFunc</a>) (void *ctx, |
| 90 | <a href="libxml-tree.html#xmlSAXLocatorPtr">xmlSAXLocatorPtr</a> loc); |
| 91 | void (<a href="libxml-parser.html#startDocumentSAXFunc">*startDocumentSAXFunc</a>) (void *ctx); |
| 92 | void (<a href="libxml-parser.html#endDocumentSAXFunc">*endDocumentSAXFunc</a>) (void *ctx); |
| 93 | void (<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); |
| 96 | void (<a href="libxml-parser.html#endElementSAXFunc">*endElementSAXFunc</a>) (void *ctx, |
| 97 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name); |
| 98 | void (<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); |
| 101 | void (<a href="libxml-parser.html#referenceSAXFunc">*referenceSAXFunc</a>) (void *ctx, |
| 102 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name); |
| 103 | void (<a href="libxml-parser.html#charactersSAXFunc">*charactersSAXFunc</a>) (void *ctx, |
| 104 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch, |
Daniel Veillard | 3592547 | 1999-02-25 08:46:07 +0000 | [diff] [blame] | 105 | int len); |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 106 | void (<a href="libxml-parser.html#ignorableWhitespaceSAXFunc">*ignorableWhitespaceSAXFunc</a>) (void *ctx, |
| 107 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch, |
Daniel Veillard | 3592547 | 1999-02-25 08:46:07 +0000 | [diff] [blame] | 108 | int len); |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 109 | void (<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); |
| 112 | void (<a href="libxml-parser.html#commentSAXFunc">*commentSAXFunc</a>) (void *ctx, |
| 113 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value); |
| 114 | void (<a href="libxml-parser.html#cdataBlockSAXFunc">*cdataBlockSAXFunc</a>) (void *ctx, |
| 115 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value, |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 116 | int len); |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 117 | void (<a href="libxml-parser.html#warningSAXFunc">*warningSAXFunc</a>) (void *ctx, |
Daniel Veillard | 3592547 | 1999-02-25 08:46:07 +0000 | [diff] [blame] | 118 | const char *msg, |
| 119 | ...); |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 120 | void (<a href="libxml-parser.html#errorSAXFunc">*errorSAXFunc</a>) (void *ctx, |
Daniel Veillard | 3592547 | 1999-02-25 08:46:07 +0000 | [diff] [blame] | 121 | const char *msg, |
| 122 | ...); |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 123 | void (<a href="libxml-parser.html#fatalErrorSAXFunc">*fatalErrorSAXFunc</a>) (void *ctx, |
Daniel Veillard | 3592547 | 1999-02-25 08:46:07 +0000 | [diff] [blame] | 124 | const char *msg, |
| 125 | ...); |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 126 | int (<a href="libxml-parser.html#isStandaloneSAXFunc">*isStandaloneSAXFunc</a>) (void *ctx); |
| 127 | int (<a href="libxml-parser.html#hasInternalSubsetSAXFunc">*hasInternalSubsetSAXFunc</a>) (void *ctx); |
| 128 | int (<a href="libxml-parser.html#hasExternalSubsetSAXFunc">*hasExternalSubsetSAXFunc</a>) (void *ctx); |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 129 | #define <a href="libxml-parser.html#XML-SAX2-MAGIC-CAPS">XML_SAX2_MAGIC</a> |
| 130 | void (<a href="libxml-parser.html#startElementNsSAX2Func">*startElementNsSAX2Func</a>) (void *ctx, |
| 131 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *localname, |
| 132 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *prefix, |
| 133 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *URI, |
| 134 | int nb_namespaces, |
| 135 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> **namespaces, |
| 136 | int nb_attributes, |
| 137 | int nb_defaulted, |
| 138 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> **attributes); |
| 139 | void (<a href="libxml-parser.html#endElementNsSAX2Func">*endElementNsSAX2Func</a>) (void *ctx, |
| 140 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *localname, |
| 141 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *prefix, |
| 142 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *URI); |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 143 | struct <a href="libxml-parser.html#xmlSAXHandler">xmlSAXHandler</a>; |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 144 | struct <a href="libxml-parser.html#xmlSAXHandlerV1">xmlSAXHandlerV1</a>; |
| 145 | typedef <a href="libxml-parser.html#xmlSAXHandlerV1Ptr">xmlSAXHandlerV1Ptr</a>; |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 146 | <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> (<a href="libxml-parser.html#xmlExternalEntityLoader">*xmlExternalEntityLoader</a>) |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 147 | (const char *URL, |
| 148 | const char *ID, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 149 | <a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> context); |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 150 | enum <a href="libxml-parser.html#xmlParserOption">xmlParserOption</a>; |
| 151 | </pre></div><div class="refsect1"><h2>Description</h2><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 152 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 153 | </p></div><div class="refsect1"><h2>Details</h2><div class="refsect2"><h3><a name="XML-DEFAULT-VERSION-CAPS"></a>XML_DEFAULT_VERSION</h3><pre class="programlisting">#define XML_DEFAULT_VERSION "1.0" |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame] | 154 | </pre><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 155 | The default version of XML used: 1.0</p><p> |
| 156 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 157 | </p></div><hr><div class="refsect2"><h3><a name="xmlParserInputDeallocate"></a>xmlParserInputDeallocate ()</h3><pre class="programlisting">void (*xmlParserInputDeallocate) (<a href="libxml-tree.html#xmlChar">xmlChar</a> *str);</pre><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 158 | Callback for freeing some parser input allocations.</p><p> |
| 159 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 160 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td> the string to deallocate |
| 161 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlParserInput"></a>struct xmlParserInput</h3><pre class="programlisting">struct xmlParserInput { |
| 162 | |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 163 | /* Input buffer */ |
| 164 | xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */ |
| 165 | |
| 166 | const char *filename; /* The file analyzed, if any */ |
Daniel Veillard | 60087f3 | 2001-10-10 09:45:09 +0000 | [diff] [blame] | 167 | const char *directory; /* the directory/base of the file */ |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 168 | const xmlChar *base; /* Base of the array to parse */ |
| 169 | const xmlChar *cur; /* Current char being parsed */ |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 170 | const xmlChar *end; /* end of the array to parse */ |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 171 | int length; /* length if known */ |
| 172 | int line; /* Current line */ |
| 173 | int col; /* Current column */ |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 174 | /* |
| 175 | * NOTE: consumed is only tested for equality in the parser code, |
| 176 | * so even if there is an overflow this should not give troubles |
| 177 | * for parsing very large instances. |
| 178 | */ |
| 179 | unsigned long consumed; /* How many xmlChars already consumed */ |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 180 | xmlParserInputDeallocate free; /* function to deallocate the base */ |
| 181 | const xmlChar *encoding; /* the encoding string for entity */ |
| 182 | const xmlChar *version; /* the version string for entity */ |
| 183 | int standalone; /* Was that entity marked standalone */ |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 184 | int id; /* an unique identifier for the entity */ |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 185 | }; |
| 186 | </pre><p> |
| 187 | An xmlParserInput is an input flow for the XML processor. |
Daniel Veillard | e7ead2d | 2001-08-22 23:44:09 +0000 | [diff] [blame] | 188 | Each entity parsed is associated an xmlParserInput (except the |
| 189 | few predefined ones). This is the case both for internal entities |
| 190 | - in which case the flow is already completely in memory - or |
| 191 | external entities - in which case we use the buf structure for |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 192 | progressive reading and I18N conversions to the internal UTF-8 format.</p><p> |
| 193 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 194 | </p></div><hr><div class="refsect2"><h3><a name="xmlParserNodeInfo"></a>struct xmlParserNodeInfo</h3><pre class="programlisting">struct xmlParserNodeInfo { |
| 195 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 196 | const struct _xmlNode* node; |
Daniel Veillard | 3bbbe6f | 2001-05-03 11:15:37 +0000 | [diff] [blame] | 197 | /* Position & line # that text that created the node begins & ends on */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 198 | unsigned long begin_pos; |
| 199 | unsigned long begin_line; |
| 200 | unsigned long end_pos; |
| 201 | unsigned long end_line; |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 202 | }; |
| 203 | </pre><p> |
| 204 | The parser can be asked to collect Node informations, i.e. at what |
Daniel Veillard | e7ead2d | 2001-08-22 23:44:09 +0000 | [diff] [blame] | 205 | place in the file they were detected. |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 206 | NOTE: This is off by default and not very well tested.</p><p> |
| 207 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 208 | </p></div><hr><div class="refsect2"><h3><a name="xmlParserNodeInfoPtr"></a>xmlParserNodeInfoPtr</h3><pre class="programlisting">typedef xmlParserNodeInfo *xmlParserNodeInfoPtr; |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame] | 209 | </pre><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 210 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 211 | </p></div><hr><div class="refsect2"><h3><a name="xmlParserNodeInfoSeq"></a>struct xmlParserNodeInfoSeq</h3><pre class="programlisting">struct xmlParserNodeInfoSeq { |
| 212 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 213 | unsigned long maximum; |
| 214 | unsigned long length; |
| 215 | xmlParserNodeInfo* buffer; |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 216 | }; |
| 217 | </pre><p> |
| 218 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 219 | </p></div><hr><div class="refsect2"><h3><a name="xmlParserNodeInfoSeqPtr"></a>xmlParserNodeInfoSeqPtr</h3><pre class="programlisting">typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr; |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame] | 220 | </pre><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 221 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 222 | </p></div><hr><div class="refsect2"><h3><a name="xmlParserInputState"></a>enum xmlParserInputState</h3><pre class="programlisting">typedef enum { |
Daniel Veillard | be849cf | 1999-12-28 16:43:59 +0000 | [diff] [blame] | 223 | XML_PARSER_EOF = -1, /* nothing is to be parsed */ |
| 224 | XML_PARSER_START = 0, /* nothing has been parsed */ |
| 225 | XML_PARSER_MISC, /* Misc* before int subset */ |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 226 | XML_PARSER_PI, /* Within a processing instruction */ |
Daniel Veillard | be849cf | 1999-12-28 16:43:59 +0000 | [diff] [blame] | 227 | XML_PARSER_DTD, /* within some DTD content */ |
| 228 | XML_PARSER_PROLOG, /* Misc* after internal subset */ |
| 229 | XML_PARSER_COMMENT, /* within a comment */ |
| 230 | XML_PARSER_START_TAG, /* within a start tag */ |
| 231 | XML_PARSER_CONTENT, /* within the content */ |
| 232 | XML_PARSER_CDATA_SECTION, /* within a CDATA section */ |
| 233 | XML_PARSER_END_TAG, /* within a closing tag */ |
| 234 | XML_PARSER_ENTITY_DECL, /* within an entity declaration */ |
| 235 | XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */ |
| 236 | XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */ |
Daniel Veillard | edfb29b | 2000-03-14 19:59:05 +0000 | [diff] [blame] | 237 | XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */ |
Daniel Veillard | 28929b2 | 2000-11-13 18:22:49 +0000 | [diff] [blame] | 238 | XML_PARSER_EPILOG, /* the Misc* after the last end tag */ |
Daniel Veillard | 5f4b599 | 2002-02-20 10:22:49 +0000 | [diff] [blame] | 239 | XML_PARSER_IGNORE, /* within an IGNORED section */ |
| 240 | XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */ |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 241 | } xmlParserInputState; |
| 242 | </pre><p> |
| 243 | The parser is now working also as a state based parser. |
| 244 | The recursive one use the state info for entities processing.</p><p> |
| 245 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 246 | </p></div><hr><div class="refsect2"><h3><a name="XML-DETECT-IDS-CAPS"></a>XML_DETECT_IDS</h3><pre class="programlisting">#define XML_DETECT_IDS 2 |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame] | 247 | </pre><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 248 | Bit in the loadsubset context field to tell to do ID/REFs lookups. |
| 249 | Use it to initialize xmlLoadExtDtdDefaultValue.</p><p> |
| 250 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 251 | </p></div><hr><div class="refsect2"><h3><a name="XML-COMPLETE-ATTRS-CAPS"></a>XML_COMPLETE_ATTRS</h3><pre class="programlisting">#define XML_COMPLETE_ATTRS 4 |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame] | 252 | </pre><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 253 | Bit in the loadsubset context field to tell to do complete the |
Daniel Veillard | 1927409 | 2002-03-25 16:48:03 +0000 | [diff] [blame] | 254 | elements attributes lists with the ones defaulted from the DTDs. |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 255 | Use it to initialize xmlLoadExtDtdDefaultValue.</p><p> |
| 256 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 257 | </p></div><hr><div class="refsect2"><h3><a name="XML-SKIP-IDS-CAPS"></a>XML_SKIP_IDS</h3><pre class="programlisting">#define XML_SKIP_IDS 8 |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame] | 258 | </pre><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 259 | Bit in the loadsubset context field to tell to not do ID/REFs registration. |
| 260 | Used to initialize xmlLoadExtDtdDefaultValue in some special cases.</p><p> |
| 261 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 262 | </p></div><hr><div class="refsect2"><h3><a name="xmlParserCtxt"></a>struct xmlParserCtxt</h3><pre class="programlisting">struct xmlParserCtxt { |
| 263 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 264 | struct _xmlSAXHandler *sax; /* The SAX handler */ |
Daniel Veillard | 3bff2b0 | 2000-10-01 20:33:47 +0000 | [diff] [blame] | 265 | void *userData; /* For SAX interface only, used by DOM build */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 266 | xmlDocPtr myDoc; /* the document being built */ |
| 267 | int wellFormed; /* is the document well formed */ |
| 268 | int replaceEntities; /* shall we replace entities ? */ |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 269 | const xmlChar *version; /* the XML version string */ |
| 270 | const xmlChar *encoding; /* the declared encoding, if any */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 271 | int standalone; /* standalone document */ |
Daniel Veillard | 3bff2b0 | 2000-10-01 20:33:47 +0000 | [diff] [blame] | 272 | int html; /* an HTML(1)/Docbook(2) document */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 273 | |
| 274 | /* Input stream stack */ |
| 275 | xmlParserInputPtr input; /* Current input stream */ |
| 276 | int inputNr; /* Number of current input streams */ |
| 277 | int inputMax; /* Max number of input streams */ |
| 278 | xmlParserInputPtr *inputTab; /* stack of inputs */ |
| 279 | |
| 280 | /* Node analysis stack only used for DOM building */ |
| 281 | xmlNodePtr node; /* Current parsed Node */ |
| 282 | int nodeNr; /* Depth of the parsing stack */ |
| 283 | int nodeMax; /* Max depth of the parsing stack */ |
| 284 | xmlNodePtr *nodeTab; /* array of nodes */ |
| 285 | |
| 286 | int record_info; /* Whether node info should be kept */ |
| 287 | xmlParserNodeInfoSeq node_seq; /* info about each node parsed */ |
| 288 | |
| 289 | int errNo; /* error code */ |
| 290 | |
| 291 | int hasExternalSubset; /* reference and external subset */ |
| 292 | int hasPErefs; /* the internal subset has PE refs */ |
| 293 | int external; /* are we parsing an external entity */ |
| 294 | |
| 295 | int valid; /* is the document valid */ |
| 296 | int validate; /* shall we try to validate ? */ |
| 297 | xmlValidCtxt vctxt; /* The validity context */ |
| 298 | |
| 299 | xmlParserInputState instate; /* current type of input */ |
| 300 | int token; /* next char look-ahead */ |
| 301 | |
| 302 | char *directory; /* the data directory */ |
| 303 | |
Daniel Veillard | edfb29b | 2000-03-14 19:59:05 +0000 | [diff] [blame] | 304 | /* Node name stack */ |
Daniel Veillard | 2fdbd32 | 2003-08-18 12:15:38 +0000 | [diff] [blame] | 305 | const xmlChar *name; /* Current parsed Node */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 306 | int nameNr; /* Depth of the parsing stack */ |
| 307 | int nameMax; /* Max depth of the parsing stack */ |
Daniel Veillard | 2fdbd32 | 2003-08-18 12:15:38 +0000 | [diff] [blame] | 308 | const xmlChar * *nameTab; /* array of nodes */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 309 | |
| 310 | long nbChars; /* number of xmlChar processed */ |
| 311 | long checkIndex; /* used by progressive parsing lookup */ |
Daniel Veillard | f686871 | 2000-01-05 14:58:38 +0000 | [diff] [blame] | 312 | int keepBlanks; /* ugly but ... */ |
Daniel Veillard | edfb29b | 2000-03-14 19:59:05 +0000 | [diff] [blame] | 313 | int disableSAX; /* SAX callbacks are disabled */ |
| 314 | int inSubset; /* Parsing is in int 1/ext 2 subset */ |
Daniel Veillard | 2fdbd32 | 2003-08-18 12:15:38 +0000 | [diff] [blame] | 315 | const xmlChar * intSubName; /* name of subset */ |
Daniel Veillard | edfb29b | 2000-03-14 19:59:05 +0000 | [diff] [blame] | 316 | xmlChar * extSubURI; /* URI of external subset */ |
| 317 | xmlChar * extSubSystem; /* SYSTEM ID of external subset */ |
| 318 | |
| 319 | /* xml:space values */ |
| 320 | int * space; /* Should the parser preserve spaces */ |
| 321 | int spaceNr; /* Depth of the parsing stack */ |
| 322 | int spaceMax; /* Max depth of the parsing stack */ |
| 323 | int * spaceTab; /* array of space infos */ |
| 324 | |
| 325 | int depth; /* to prevent entity substitution loops */ |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 326 | xmlParserInputPtr entity; /* used to check entities boundaries */ |
| 327 | int charset; /* encoding of the in-memory content |
| 328 | actually an xmlCharEncoding */ |
| 329 | int nodelen; /* Those two fields are there to */ |
| 330 | int nodemem; /* Speed up large node parsing */ |
Daniel Veillard | 3bff2b0 | 2000-10-01 20:33:47 +0000 | [diff] [blame] | 331 | int pedantic; /* signal pedantic warnings */ |
| 332 | void *_private; /* For user data, libxml won't touch it */ |
Daniel Veillard | d194dd2 | 2001-02-14 10:37:43 +0000 | [diff] [blame] | 333 | |
| 334 | int loadsubset; /* should the external subset be loaded */ |
Daniel Veillard | e7ead2d | 2001-08-22 23:44:09 +0000 | [diff] [blame] | 335 | int linenumbers; /* set line number in element content */ |
| 336 | void *catalogs; /* document's own catalog */ |
Daniel Veillard | aec6356 | 2003-03-23 20:42:17 +0000 | [diff] [blame] | 337 | int recovery; /* run in recovery mode */ |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 338 | int progressive; /* is this a progressive parsing */ |
Daniel Veillard | 2fdbd32 | 2003-08-18 12:15:38 +0000 | [diff] [blame] | 339 | xmlDictPtr dict; /* dictionnary for the parser */ |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 340 | const xmlChar * *atts; /* array for the attributes callbacks */ |
| 341 | int maxatts; /* the size of the array */ |
| 342 | int docdict; /* use strings from dict to build tree */ |
| 343 | |
| 344 | /* |
| 345 | * pre-interned strings |
| 346 | */ |
| 347 | const xmlChar *str_xml; |
| 348 | const xmlChar *str_xmlns; |
| 349 | const xmlChar *str_xml_ns; |
| 350 | |
| 351 | /* |
| 352 | * Everything below is used only by the new SAX mode |
| 353 | */ |
| 354 | int sax2; /* operating in the new SAX mode */ |
| 355 | int nsNr; /* the number of inherited namespaces */ |
| 356 | int nsMax; /* the size of the arrays */ |
| 357 | const xmlChar * *nsTab; /* the array of prefix/namespace name */ |
| 358 | int *attallocs; /* which attribute were allocated */ |
| 359 | void * *pushTab; /* array of data for push */ |
| 360 | xmlHashTablePtr attsDefault; /* defaulted attributes if any */ |
| 361 | xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */ |
| 362 | int nsWellFormed; /* is the document XML Nanespace okay */ |
| 363 | int options; /* Extra options */ |
| 364 | |
| 365 | /* |
| 366 | * Those fields are needed only for treaming parsing so far |
| 367 | */ |
| 368 | int dictNames; /* Use dictionary names for the tree */ |
| 369 | int freeElemsNr; /* number of freed element nodes */ |
| 370 | xmlNodePtr freeElems; /* List of freed element nodes */ |
| 371 | int freeAttrsNr; /* number of freed attributes nodes */ |
| 372 | xmlAttrPtr freeAttrs; /* List of freed attributes nodes */ |
| 373 | |
| 374 | /* |
| 375 | * the complete error informations for the last error. |
| 376 | */ |
| 377 | xmlError lastError; |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 378 | }; |
| 379 | </pre><p> |
| 380 | The parser context. |
Daniel Veillard | 1927409 | 2002-03-25 16:48:03 +0000 | [diff] [blame] | 381 | NOTE This doesn't completely define the parser state, the (current ?) |
Daniel Veillard | aec6356 | 2003-03-23 20:42:17 +0000 | [diff] [blame] | 382 | design of the parser uses recursive function calls since this allow |
| 383 | and easy mapping from the production rules of the specification |
| 384 | to the actual code. The drawback is that the actual function call |
| 385 | also reflect the parser state. However most of the parsing routines |
| 386 | takes as the only argument the parser context pointer, so migrating |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 387 | to a state based parser for progressive parsing shouldn't be too hard.</p><p> |
| 388 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 389 | </p></div><hr><div class="refsect2"><h3><a name="xmlSAXLocator"></a>struct xmlSAXLocator</h3><pre class="programlisting">struct xmlSAXLocator { |
| 390 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 391 | const xmlChar *(*getPublicId)(void *ctx); |
| 392 | const xmlChar *(*getSystemId)(void *ctx); |
| 393 | int (*getLineNumber)(void *ctx); |
| 394 | int (*getColumnNumber)(void *ctx); |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 395 | }; |
| 396 | </pre><p> |
| 397 | A SAX Locator.</p><p> |
| 398 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 399 | </p></div><hr><div class="refsect2"><h3><a name="resolveEntitySAXFunc"></a>resolveEntitySAXFunc ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> (*resolveEntitySAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 400 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, |
| 401 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId);</pre><p> |
| 402 | Callback: |
Daniel Veillard | 5f4b599 | 2002-02-20 10:22:49 +0000 | [diff] [blame] | 403 | The entity loader, to control the loading of external entities, |
| 404 | the application can either: |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 405 | - override this <GTKDOCLINK HREF="resolveEntity">resolveEntity</GTKDOCLINK>() callback in the SAX block |
| 406 | - or better use the <GTKDOCLINK HREF="xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</GTKDOCLINK>() function to |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 407 | set up it's own entity resolution routine</p><p> |
| 408 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 409 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 410 | </td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>:</span></td><td> The public ID of the entity |
| 411 | </td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>:</span></td><td> The system ID of the entity |
| 412 | </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>the xmlParserInputPtr if inlined or NULL for DOM behaviour. |
| 413 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="internalSubsetSAXFunc"></a>internalSubsetSAXFunc ()</h3><pre class="programlisting">void (*internalSubsetSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 414 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| 415 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID, |
| 416 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);</pre><p> |
| 417 | Callback on internal subset declaration.</p><p> |
| 418 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 419 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 420 | </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> the root element name |
| 421 | </td></tr><tr><td><span class="term"><i><tt>ExternalID</tt></i>:</span></td><td> the external ID |
| 422 | </td></tr><tr><td><span class="term"><i><tt>SystemID</tt></i>:</span></td><td> the SYSTEM ID (e.g. filename or URL) |
| 423 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="externalSubsetSAXFunc"></a>externalSubsetSAXFunc ()</h3><pre class="programlisting">void (*externalSubsetSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 424 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| 425 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID, |
| 426 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);</pre><p> |
| 427 | Callback on external subset declaration.</p><p> |
| 428 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 429 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 430 | </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> the root element name |
| 431 | </td></tr><tr><td><span class="term"><i><tt>ExternalID</tt></i>:</span></td><td> the external ID |
| 432 | </td></tr><tr><td><span class="term"><i><tt>SystemID</tt></i>:</span></td><td> the SYSTEM ID (e.g. filename or URL) |
| 433 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="getEntitySAXFunc"></a>getEntitySAXFunc ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> (*getEntitySAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 434 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> |
| 435 | Get an entity by name.</p><p> |
| 436 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 437 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 438 | </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The entity name |
| 439 | </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>the xmlEntityPtr if found. |
| 440 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="getParameterEntitySAXFunc"></a>getParameterEntitySAXFunc ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> (*getParameterEntitySAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 441 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> |
| 442 | Get a parameter entity by name.</p><p> |
| 443 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 444 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 445 | </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The entity name |
| 446 | </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>the xmlEntityPtr if found. |
| 447 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="entityDeclSAXFunc"></a>entityDeclSAXFunc ()</h3><pre class="programlisting">void (*entityDeclSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 448 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
Daniel Veillard | 5099ae8 | 1999-04-21 20:12:07 +0000 | [diff] [blame] | 449 | int type, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 450 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, |
| 451 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId, |
| 452 | <a href="libxml-tree.html#xmlChar">xmlChar</a> *content);</pre><p> |
| 453 | An entity definition has been parsed.</p><p> |
| 454 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 455 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 456 | </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> the entity name |
| 457 | </td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td> the entity type |
| 458 | </td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>:</span></td><td> The public ID of the entity |
| 459 | </td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>:</span></td><td> The system ID of the entity |
| 460 | </td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td> the entity value (without processing). |
| 461 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="notationDeclSAXFunc"></a>notationDeclSAXFunc ()</h3><pre class="programlisting">void (*notationDeclSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 462 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| 463 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, |
| 464 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId);</pre><p> |
| 465 | What to do when a notation declaration has been parsed.</p><p> |
| 466 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 467 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 468 | </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The name of the notation |
| 469 | </td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>:</span></td><td> The public ID of the entity |
| 470 | </td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>:</span></td><td> The system ID of the entity |
| 471 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="attributeDeclSAXFunc"></a>attributeDeclSAXFunc ()</h3><pre class="programlisting">void (*attributeDeclSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 472 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *elem, |
| 473 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *fullname, |
Daniel Veillard | 5099ae8 | 1999-04-21 20:12:07 +0000 | [diff] [blame] | 474 | int type, |
| 475 | int def, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 476 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *defaultValue, |
| 477 | <a href="libxml-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree);</pre><p> |
| 478 | An attribute definition has been parsed.</p><p> |
| 479 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 480 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 481 | </td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td> the name of the element |
| 482 | </td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>:</span></td><td> the attribute name |
| 483 | </td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td> the attribute type |
| 484 | </td></tr><tr><td><span class="term"><i><tt>def</tt></i>:</span></td><td> the type of default value |
| 485 | </td></tr><tr><td><span class="term"><i><tt>defaultValue</tt></i>:</span></td><td> the attribute default value |
| 486 | </td></tr><tr><td><span class="term"><i><tt>tree</tt></i>:</span></td><td> the tree of enumerated value set |
| 487 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="elementDeclSAXFunc"></a>elementDeclSAXFunc ()</h3><pre class="programlisting">void (*elementDeclSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 488 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
Daniel Veillard | 5099ae8 | 1999-04-21 20:12:07 +0000 | [diff] [blame] | 489 | int type, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 490 | <a href="libxml-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> content);</pre><p> |
| 491 | An element definition has been parsed.</p><p> |
| 492 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 493 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 494 | </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> the element name |
| 495 | </td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td> the element type |
| 496 | </td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td> the element value tree |
| 497 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="unparsedEntityDeclSAXFunc"></a>unparsedEntityDeclSAXFunc ()</h3><pre class="programlisting">void (*unparsedEntityDeclSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 498 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| 499 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, |
| 500 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId, |
| 501 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *notationName);</pre><p> |
| 502 | What to do when an unparsed entity declaration is parsed.</p><p> |
| 503 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 504 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 505 | </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The name of the entity |
| 506 | </td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>:</span></td><td> The public ID of the entity |
| 507 | </td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>:</span></td><td> The system ID of the entity |
| 508 | </td></tr><tr><td><span class="term"><i><tt>notationName</tt></i>:</span></td><td> the name of the notation |
| 509 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="setDocumentLocatorSAXFunc"></a>setDocumentLocatorSAXFunc ()</h3><pre class="programlisting">void (*setDocumentLocatorSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 510 | <a href="libxml-tree.html#xmlSAXLocatorPtr">xmlSAXLocatorPtr</a> loc);</pre><p> |
| 511 | Receive the document locator at startup, actually xmlDefaultSAXLocator. |
| 512 | Everything is available on the context, so this is useless in our case.</p><p> |
| 513 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 514 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 515 | </td></tr><tr><td><span class="term"><i><tt>loc</tt></i>:</span></td><td> A SAX Locator |
| 516 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="startDocumentSAXFunc"></a>startDocumentSAXFunc ()</h3><pre class="programlisting">void (*startDocumentSAXFunc) (void *ctx);</pre><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 517 | Called when the document start being processed.</p><p> |
| 518 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 519 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 520 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="endDocumentSAXFunc"></a>endDocumentSAXFunc ()</h3><pre class="programlisting">void (*endDocumentSAXFunc) (void *ctx);</pre><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 521 | Called when the document end has been detected.</p><p> |
| 522 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 523 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 524 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="startElementSAXFunc"></a>startElementSAXFunc ()</h3><pre class="programlisting">void (*startElementSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 525 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| 526 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> **atts);</pre><p> |
| 527 | Called when an opening tag has been processed.</p><p> |
| 528 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 529 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 530 | </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The element name, including namespace prefix |
| 531 | </td></tr><tr><td><span class="term"><i><tt>atts</tt></i>:</span></td><td> An array of name/value attributes pairs, NULL terminated |
| 532 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="endElementSAXFunc"></a>endElementSAXFunc ()</h3><pre class="programlisting">void (*endElementSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 533 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> |
| 534 | Called when the end of an element has been detected.</p><p> |
| 535 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 536 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 537 | </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The element name |
| 538 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="attributeSAXFunc"></a>attributeSAXFunc ()</h3><pre class="programlisting">void (*attributeSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 539 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| 540 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value);</pre><p> |
| 541 | Handle an attribute that has been read by the parser. |
Daniel Veillard | 5f4b599 | 2002-02-20 10:22:49 +0000 | [diff] [blame] | 542 | The default handling is to convert the attribute into an |
| 543 | DOM subtree and past it in a new xmlAttr element added to |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 544 | the element.</p><p> |
| 545 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 546 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 547 | </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The attribute name, including namespace prefix |
| 548 | </td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td> The attribute value |
| 549 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="referenceSAXFunc"></a>referenceSAXFunc ()</h3><pre class="programlisting">void (*referenceSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 550 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> |
| 551 | Called when an entity reference is detected.</p><p> |
| 552 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 553 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 554 | </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The entity name |
| 555 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="charactersSAXFunc"></a>charactersSAXFunc ()</h3><pre class="programlisting">void (*charactersSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 556 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch, |
| 557 | int len);</pre><p> |
| 558 | Receiving some chars from the parser.</p><p> |
| 559 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 560 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 561 | </td></tr><tr><td><span class="term"><i><tt>ch</tt></i>:</span></td><td> a xmlChar string |
| 562 | </td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td> the number of xmlChar |
| 563 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="ignorableWhitespaceSAXFunc"></a>ignorableWhitespaceSAXFunc ()</h3><pre class="programlisting">void (*ignorableWhitespaceSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 564 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch, |
| 565 | int len);</pre><p> |
| 566 | Receiving some ignorable whitespaces from the parser. |
| 567 | UNUSED: by default the DOM building will use characters.</p><p> |
| 568 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 569 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 570 | </td></tr><tr><td><span class="term"><i><tt>ch</tt></i>:</span></td><td> a xmlChar string |
| 571 | </td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td> the number of xmlChar |
| 572 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="processingInstructionSAXFunc"></a>processingInstructionSAXFunc ()</h3><pre class="programlisting">void (*processingInstructionSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 573 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *target, |
| 574 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *data);</pre><p> |
| 575 | A processing instruction has been parsed.</p><p> |
| 576 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 577 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 578 | </td></tr><tr><td><span class="term"><i><tt>target</tt></i>:</span></td><td> the target name |
| 579 | </td></tr><tr><td><span class="term"><i><tt>data</tt></i>:</span></td><td> the PI data's |
| 580 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="commentSAXFunc"></a>commentSAXFunc ()</h3><pre class="programlisting">void (*commentSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 581 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value);</pre><p> |
| 582 | A comment has been parsed.</p><p> |
| 583 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 584 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 585 | </td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td> the comment content |
| 586 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="cdataBlockSAXFunc"></a>cdataBlockSAXFunc ()</h3><pre class="programlisting">void (*cdataBlockSAXFunc) (void *ctx, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 587 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value, |
| 588 | int len);</pre><p> |
| 589 | Called when a pcdata block has been parsed.</p><p> |
| 590 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 591 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 592 | </td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td> The pcdata content |
| 593 | </td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td> the block length |
| 594 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="warningSAXFunc"></a>warningSAXFunc ()</h3><pre class="programlisting">void (*warningSAXFunc) (void *ctx, |
Daniel Veillard | 3592547 | 1999-02-25 08:46:07 +0000 | [diff] [blame] | 595 | const char *msg, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 596 | ...);</pre><p> |
| 597 | Display and format a warning messages, callback.</p><p> |
| 598 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 599 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> an XML parser context |
| 600 | </td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td> the message to display/transmit |
| 601 | </td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td> extra parameters for the message display |
| 602 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="errorSAXFunc"></a>errorSAXFunc ()</h3><pre class="programlisting">void (*errorSAXFunc) (void *ctx, |
Daniel Veillard | 3592547 | 1999-02-25 08:46:07 +0000 | [diff] [blame] | 603 | const char *msg, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 604 | ...);</pre><p> |
| 605 | Display and format an error messages, callback.</p><p> |
| 606 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 607 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> an XML parser context |
| 608 | </td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td> the message to display/transmit |
| 609 | </td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td> extra parameters for the message display |
| 610 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="fatalErrorSAXFunc"></a>fatalErrorSAXFunc ()</h3><pre class="programlisting">void (*fatalErrorSAXFunc) (void *ctx, |
Daniel Veillard | 3592547 | 1999-02-25 08:46:07 +0000 | [diff] [blame] | 611 | const char *msg, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 612 | ...);</pre><p> |
| 613 | Display and format fatal error messages, callback. |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 614 | Note: so far <GTKDOCLINK HREF="fatalError">fatalError</GTKDOCLINK>() SAX callbacks are not used, <GTKDOCLINK HREF="error">error</GTKDOCLINK>() |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 615 | get all the callbacks for errors.</p><p> |
| 616 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 617 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> an XML parser context |
| 618 | </td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td> the message to display/transmit |
| 619 | </td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td> extra parameters for the message display |
| 620 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="isStandaloneSAXFunc"></a>isStandaloneSAXFunc ()</h3><pre class="programlisting">int (*isStandaloneSAXFunc) (void *ctx);</pre><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 621 | Is this document tagged standalone?</p><p> |
| 622 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 623 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 624 | </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>1 if true |
| 625 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="hasInternalSubsetSAXFunc"></a>hasInternalSubsetSAXFunc ()</h3><pre class="programlisting">int (*hasInternalSubsetSAXFunc) (void *ctx);</pre><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 626 | Does this document has an internal subset.</p><p> |
| 627 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 628 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 629 | </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>1 if true |
| 630 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="hasExternalSubsetSAXFunc"></a>hasExternalSubsetSAXFunc ()</h3><pre class="programlisting">int (*hasExternalSubsetSAXFunc) (void *ctx);</pre><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 631 | Does this document has an external subset?</p><p> |
| 632 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 633 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 634 | </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>1 if true |
| 635 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="XML-SAX2-MAGIC-CAPS"></a>XML_SAX2_MAGIC</h3><pre class="programlisting">#define XML_SAX2_MAGIC 0xDEEDBEAF |
| 636 | </pre><p> |
| 637 | Special constant found in SAX2 blocks initialized fields</p><p> |
| 638 | |
| 639 | </p></div><hr><div class="refsect2"><h3><a name="startElementNsSAX2Func"></a>startElementNsSAX2Func ()</h3><pre class="programlisting">void (*startElementNsSAX2Func) (void *ctx, |
| 640 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *localname, |
| 641 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *prefix, |
| 642 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *URI, |
| 643 | int nb_namespaces, |
| 644 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> **namespaces, |
| 645 | int nb_attributes, |
| 646 | int nb_defaulted, |
| 647 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> **attributes);</pre><p> |
| 648 | SAX2 callback when an element start has been detected by the parser. |
| 649 | It provides the namespace informations for the element, as well as |
| 650 | the new namespace declarations on the element.</p><p> |
| 651 | |
| 652 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 653 | </td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td> the local name of the element |
| 654 | </td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td> the element namespace prefix if available |
| 655 | </td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td> the element namespace name if available |
| 656 | </td></tr><tr><td><span class="term"><i><tt>nb_namespaces</tt></i>:</span></td><td> number of namespace definitions on that node |
| 657 | </td></tr><tr><td><span class="term"><i><tt>namespaces</tt></i>:</span></td><td> pointer to the array of prefix/URI pairs namespace definitions |
| 658 | </td></tr><tr><td><span class="term"><i><tt>nb_attributes</tt></i>:</span></td><td> the number of attributes on that node |
| 659 | </td></tr><tr><td><span class="term"><i><tt>nb_defaulted</tt></i>:</span></td><td> the number of defaulted attributes. The defaulted |
| 660 | ones are at the end of the array |
| 661 | </td></tr><tr><td><span class="term"><i><tt>attributes</tt></i>:</span></td><td> pointer to the array of (localname/prefix/URI/value/end) |
| 662 | attribute values. |
| 663 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="endElementNsSAX2Func"></a>endElementNsSAX2Func ()</h3><pre class="programlisting">void (*endElementNsSAX2Func) (void *ctx, |
| 664 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *localname, |
| 665 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *prefix, |
| 666 | const <a href="libxml-tree.html#xmlChar">xmlChar</a> *URI);</pre><p> |
| 667 | SAX2 callback when an element end has been detected by the parser. |
| 668 | It provides the namespace informations for the element.</p><p> |
| 669 | |
| 670 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td> the user data (XML parser context) |
| 671 | </td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td> the local name of the element |
| 672 | </td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td> the element namespace prefix if available |
| 673 | </td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td> the element namespace name if available |
| 674 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlSAXHandler"></a>struct xmlSAXHandler</h3><pre class="programlisting">struct xmlSAXHandler { |
| 675 | |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 676 | internalSubsetSAXFunc internalSubset; |
| 677 | isStandaloneSAXFunc isStandalone; |
| 678 | hasInternalSubsetSAXFunc hasInternalSubset; |
| 679 | hasExternalSubsetSAXFunc hasExternalSubset; |
| 680 | resolveEntitySAXFunc resolveEntity; |
| 681 | getEntitySAXFunc getEntity; |
| 682 | entityDeclSAXFunc entityDecl; |
| 683 | notationDeclSAXFunc notationDecl; |
| 684 | attributeDeclSAXFunc attributeDecl; |
| 685 | elementDeclSAXFunc elementDecl; |
| 686 | unparsedEntityDeclSAXFunc unparsedEntityDecl; |
| 687 | setDocumentLocatorSAXFunc setDocumentLocator; |
| 688 | startDocumentSAXFunc startDocument; |
| 689 | endDocumentSAXFunc endDocument; |
| 690 | startElementSAXFunc startElement; |
| 691 | endElementSAXFunc endElement; |
| 692 | referenceSAXFunc reference; |
| 693 | charactersSAXFunc characters; |
| 694 | ignorableWhitespaceSAXFunc ignorableWhitespace; |
| 695 | processingInstructionSAXFunc processingInstruction; |
| 696 | commentSAXFunc comment; |
| 697 | warningSAXFunc warning; |
| 698 | errorSAXFunc error; |
Daniel Veillard | aec6356 | 2003-03-23 20:42:17 +0000 | [diff] [blame] | 699 | fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 700 | getParameterEntitySAXFunc getParameterEntity; |
| 701 | cdataBlockSAXFunc cdataBlock; |
| 702 | externalSubsetSAXFunc externalSubset; |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 703 | unsigned int initialized; |
| 704 | /* The following fields are extensions available only on version 2 */ |
| 705 | void *_private; |
| 706 | startElementNsSAX2Func startElementNs; |
| 707 | endElementNsSAX2Func endElementNs; |
| 708 | xmlStructuredErrorFunc serror; |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 709 | }; |
| 710 | </pre><p> |
| 711 | A SAX handler is bunch of callbacks called by the parser when processing |
| 712 | of the input generate data or structure informations.</p><p> |
| 713 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 714 | </p></div><hr><div class="refsect2"><h3><a name="xmlSAXHandlerV1"></a>struct xmlSAXHandlerV1</h3><pre class="programlisting">struct xmlSAXHandlerV1 { |
| 715 | |
| 716 | internalSubsetSAXFunc internalSubset; |
| 717 | isStandaloneSAXFunc isStandalone; |
| 718 | hasInternalSubsetSAXFunc hasInternalSubset; |
| 719 | hasExternalSubsetSAXFunc hasExternalSubset; |
| 720 | resolveEntitySAXFunc resolveEntity; |
| 721 | getEntitySAXFunc getEntity; |
| 722 | entityDeclSAXFunc entityDecl; |
| 723 | notationDeclSAXFunc notationDecl; |
| 724 | attributeDeclSAXFunc attributeDecl; |
| 725 | elementDeclSAXFunc elementDecl; |
| 726 | unparsedEntityDeclSAXFunc unparsedEntityDecl; |
| 727 | setDocumentLocatorSAXFunc setDocumentLocator; |
| 728 | startDocumentSAXFunc startDocument; |
| 729 | endDocumentSAXFunc endDocument; |
| 730 | startElementSAXFunc startElement; |
| 731 | endElementSAXFunc endElement; |
| 732 | referenceSAXFunc reference; |
| 733 | charactersSAXFunc characters; |
| 734 | ignorableWhitespaceSAXFunc ignorableWhitespace; |
| 735 | processingInstructionSAXFunc processingInstruction; |
| 736 | commentSAXFunc comment; |
| 737 | warningSAXFunc warning; |
| 738 | errorSAXFunc error; |
| 739 | fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ |
| 740 | getParameterEntitySAXFunc getParameterEntity; |
| 741 | cdataBlockSAXFunc cdataBlock; |
| 742 | externalSubsetSAXFunc externalSubset; |
| 743 | unsigned int initialized; |
| 744 | }; |
| 745 | </pre><p> |
| 746 | |
| 747 | </p></div><hr><div class="refsect2"><h3><a name="xmlSAXHandlerV1Ptr"></a>xmlSAXHandlerV1Ptr</h3><pre class="programlisting">typedef xmlSAXHandlerV1 *xmlSAXHandlerV1Ptr; |
| 748 | </pre><p> |
| 749 | |
| 750 | </p></div><hr><div class="refsect2"><h3><a name="xmlExternalEntityLoader"></a>xmlExternalEntityLoader ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> (*xmlExternalEntityLoader) |
Daniel Veillard | 3f6f7f6 | 2000-06-30 17:58:25 +0000 | [diff] [blame] | 751 | (const char *URL, |
| 752 | const char *ID, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 753 | <a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> context);</pre><p> |
| 754 | External entity loaders types.</p><p> |
| 755 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 756 | </p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td> The System ID of the resource requested |
| 757 | </td></tr><tr><td><span class="term"><i><tt>ID</tt></i>:</span></td><td> The Public ID of the resource requested |
| 758 | </td></tr><tr><td><span class="term"><i><tt>context</tt></i>:</span></td><td> the XML parser context |
| 759 | </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>the entity input parser. |
| 760 | </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlParserOption"></a>enum xmlParserOption</h3><pre class="programlisting">typedef enum { |
| 761 | XML_PARSE_RECOVER = 1<<0, /* recover on errors */ |
| 762 | XML_PARSE_NOENT = 1<<1, /* substitute entities */ |
| 763 | XML_PARSE_DTDLOAD = 1<<2, /* load the external subset */ |
| 764 | XML_PARSE_DTDATTR = 1<<3, /* default DTD attributes */ |
| 765 | XML_PARSE_DTDVALID = 1<<4, /* validate with the DTD */ |
| 766 | XML_PARSE_NOERROR = 1<<5, /* suppress error reports */ |
| 767 | XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */ |
| 768 | XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ |
| 769 | XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ |
| 770 | XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */ |
| 771 | XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitition */ |
| 772 | XML_PARSE_NONET = 1<<11,/* Forbid network access */ |
| 773 | XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionnary */ |
| 774 | XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */ |
| 775 | XML_PARSE_NOCDATA = 1<<14 /* merge CDATA as text nodes */ |
| 776 | } xmlParserOption; |
| 777 | </pre><p> |
| 778 | This is the set of XML parser options that can be passed down |
| 779 | to the <GTKDOCLINK HREF="xmlReadDoc">xmlReadDoc</GTKDOCLINK>() and similar calls.</p><p> |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 780 | |
William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 781 | </p></div></div></div><table 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><< threads</b></a></td><td align="right"><a accesskey="n" href="libxml-c14n.html"><b>c14n >></b></a></td></tr></table></body></html> |