libxml-SAX.html revision cfba2fe0bbbdd1158666fc1090c7f48c0fdb00e1
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>SAX</title><meta name="generator" content="DocBook XSL Stylesheets V1.58.1"><style xmlns="http://www.w3.org/TR/xhtml1/transitional" type="text/css"> 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 } 31 </style><link rel="home" href="index.html" title="Gnome XML Library Reference Manual"><link rel="up" href="libxml-lib.html" title="Libxml Library Reference"><link rel="previous" href="libxml-xmlreader.html" title="xmlreader"><link rel="next" href="libxml-tree.html" title="tree"></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-xmlreader.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td><td><a accesskey="u" href="libxml-lib.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td><th width="100%" align="center">Gnome XML Library Reference Manual</th><td><a accesskey="n" href="libxml-tree.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-SAX"></a><div class="titlepage"></div><div class="refnamediv"><h2>SAX</h2><p>SAX — </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"> 32 33 34 35const <a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-SAX.html#getPublicId">getPublicId</a> (void *ctx); 36const <a href="libxml-tree.html#xmlChar">xmlChar</a>* <a href="libxml-SAX.html#getSystemId">getSystemId</a> (void *ctx); 37void <a href="libxml-SAX.html#setDocumentLocator">setDocumentLocator</a> (void *ctx, 38 <a href="libxml-tree.html#xmlSAXLocatorPtr">xmlSAXLocatorPtr</a> loc); 39int <a href="libxml-SAX.html#getLineNumber">getLineNumber</a> (void *ctx); 40int <a href="libxml-SAX.html#getColumnNumber">getColumnNumber</a> (void *ctx); 41int <a href="libxml-SAX.html#isStandalone">isStandalone</a> (void *ctx); 42int <a href="libxml-SAX.html#hasInternalSubset">hasInternalSubset</a> (void *ctx); 43int <a href="libxml-SAX.html#hasExternalSubset">hasExternalSubset</a> (void *ctx); 44void <a href="libxml-SAX.html#internalSubset">internalSubset</a> (void *ctx, 45 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, 46 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID, 47 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID); 48void <a href="libxml-SAX.html#externalSubset">externalSubset</a> (void *ctx, 49 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, 50 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID, 51 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID); 52<a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> <a href="libxml-SAX.html#getEntity">getEntity</a> (void *ctx, 53 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name); 54<a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> <a href="libxml-SAX.html#getParameterEntity">getParameterEntity</a> (void *ctx, 55 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name); 56<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> <a href="libxml-SAX.html#resolveEntity">resolveEntity</a> (void *ctx, 57 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, 58 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId); 59void <a href="libxml-SAX.html#entityDecl">entityDecl</a> (void *ctx, 60 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, 61 int type, 62 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, 63 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId, 64 <a href="libxml-tree.html#xmlChar">xmlChar</a> *content); 65void <a href="libxml-SAX.html#attributeDecl">attributeDecl</a> (void *ctx, 66 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *elem, 67 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *fullname, 68 int type, 69 int def, 70 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *defaultValue, 71 <a href="libxml-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree); 72void <a href="libxml-SAX.html#elementDecl">elementDecl</a> (void *ctx, 73 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, 74 int type, 75 <a href="libxml-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> content); 76void <a href="libxml-SAX.html#notationDecl">notationDecl</a> (void *ctx, 77 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, 78 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, 79 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId); 80void <a href="libxml-SAX.html#unparsedEntityDecl">unparsedEntityDecl</a> (void *ctx, 81 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, 82 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, 83 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId, 84 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *notationName); 85void <a href="libxml-SAX.html#startDocument">startDocument</a> (void *ctx); 86void <a href="libxml-SAX.html#endDocument">endDocument</a> (void *ctx); 87void <a href="libxml-SAX.html#attribute">attribute</a> (void *ctx, 88 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *fullname, 89 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value); 90void <a href="libxml-SAX.html#startElement">startElement</a> (void *ctx, 91 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *fullname, 92 const <a href="libxml-tree.html#xmlChar">xmlChar</a> **atts); 93void <a href="libxml-SAX.html#endElement">endElement</a> (void *ctx, 94 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name); 95void <a href="libxml-SAX.html#reference">reference</a> (void *ctx, 96 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name); 97void <a href="libxml-SAX.html#characters">characters</a> (void *ctx, 98 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch, 99 int len); 100void <a href="libxml-SAX.html#ignorableWhitespace">ignorableWhitespace</a> (void *ctx, 101 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch, 102 int len); 103void <a href="libxml-SAX.html#processingInstruction">processingInstruction</a> (void *ctx, 104 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *target, 105 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *data); 106void <a href="libxml-SAX.html#globalNamespace">globalNamespace</a> (void *ctx, 107 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *href, 108 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *prefix); 109void <a href="libxml-SAX.html#setNamespace">setNamespace</a> (void *ctx, 110 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name); 111<a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> <a href="libxml-SAX.html#getNamespace">getNamespace</a> (void *ctx); 112int <a href="libxml-SAX.html#checkNamespace">checkNamespace</a> (void *ctx, 113 <a href="libxml-tree.html#xmlChar">xmlChar</a> *nameSpace); 114void <a href="libxml-SAX.html#namespaceDecl">namespaceDecl</a> (void *ctx, 115 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *href, 116 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *prefix); 117void <a href="libxml-SAX.html#comment">comment</a> (void *ctx, 118 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value); 119void <a href="libxml-SAX.html#cdataBlock">cdataBlock</a> (void *ctx, 120 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value, 121 int len); 122void <a href="libxml-SAX.html#initxmlDefaultSAXHandler">initxmlDefaultSAXHandler</a> (<a href="libxml-parser.html#xmlSAXHandler">xmlSAXHandler</a> *hdlr, 123 int warning); 124void <a href="libxml-SAX.html#inithtmlDefaultSAXHandler">inithtmlDefaultSAXHandler</a> (<a href="libxml-parser.html#xmlSAXHandler">xmlSAXHandler</a> *hdlr); 125void <a href="libxml-SAX.html#initdocbDefaultSAXHandler">initdocbDefaultSAXHandler</a> (<a href="libxml-parser.html#xmlSAXHandler">xmlSAXHandler</a> *hdlr); 126void <a href="libxml-SAX.html#xmlDefaultSAXHandlerInit">xmlDefaultSAXHandlerInit</a> (void); 127void <a href="libxml-SAX.html#htmlDefaultSAXHandlerInit">htmlDefaultSAXHandlerInit</a> (void); 128void <a href="libxml-SAX.html#docbDefaultSAXHandlerInit">docbDefaultSAXHandlerInit</a> (void); 129</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p> 130 131</p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="getPublicId"></a>getPublicId ()</h3><pre class="programlisting">const <a href="libxml-tree.html#xmlChar">xmlChar</a>* getPublicId (void *ctx);</pre><p> 132Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"</p><p> 133 134</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 135</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a xmlChar * 136</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="getSystemId"></a>getSystemId ()</h3><pre class="programlisting">const <a href="libxml-tree.html#xmlChar">xmlChar</a>* getSystemId (void *ctx);</pre><p> 137Provides the system ID, basically URL or filename e.g. 138http://www.sgmlsource.com/dtds/memo.dtd</p><p> 139 140</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 141</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a xmlChar * 142</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="setDocumentLocator"></a>setDocumentLocator ()</h3><pre class="programlisting">void setDocumentLocator (void *ctx, 143 <a href="libxml-tree.html#xmlSAXLocatorPtr">xmlSAXLocatorPtr</a> loc);</pre><p> 144Receive the document locator at startup, actually xmlDefaultSAXLocator 145Everything is available on the context, so this is useless in our case.</p><p> 146 147</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 148</td></tr><tr><td><span class="term"><i><tt>loc</tt></i>�:</span></td><td> A SAX Locator 149</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="getLineNumber"></a>getLineNumber ()</h3><pre class="programlisting">int getLineNumber (void *ctx);</pre><p> 150Provide the line number of the current parsing point.</p><p> 151 152</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 153</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>an int 154</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="getColumnNumber"></a>getColumnNumber ()</h3><pre class="programlisting">int getColumnNumber (void *ctx);</pre><p> 155Provide the column number of the current parsing point.</p><p> 156 157</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 158</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>an int 159</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="isStandalone"></a>isStandalone ()</h3><pre class="programlisting">int isStandalone (void *ctx);</pre><p> 160Is this document tagged standalone ?</p><p> 161 162</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 163</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 if true 164</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="hasInternalSubset"></a>hasInternalSubset ()</h3><pre class="programlisting">int hasInternalSubset (void *ctx);</pre><p> 165Does this document has an internal subset</p><p> 166 167</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 168</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 if true 169</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="hasExternalSubset"></a>hasExternalSubset ()</h3><pre class="programlisting">int hasExternalSubset (void *ctx);</pre><p> 170Does this document has an external subset</p><p> 171 172</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 173</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 if true 174</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="internalSubset"></a>internalSubset ()</h3><pre class="programlisting">void internalSubset (void *ctx, 175 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, 176 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID, 177 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);</pre><p> 178Callback on internal subset declaration.</p><p> 179 180</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 181</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the root element name 182</td></tr><tr><td><span class="term"><i><tt>ExternalID</tt></i>�:</span></td><td> the external ID 183</td></tr><tr><td><span class="term"><i><tt>SystemID</tt></i>�:</span></td><td> the SYSTEM ID (e.g. filename or URL) 184</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="externalSubset"></a>externalSubset ()</h3><pre class="programlisting">void externalSubset (void *ctx, 185 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, 186 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID, 187 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);</pre><p> 188Callback on external subset declaration.</p><p> 189 190</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 191</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the root element name 192</td></tr><tr><td><span class="term"><i><tt>ExternalID</tt></i>�:</span></td><td> the external ID 193</td></tr><tr><td><span class="term"><i><tt>SystemID</tt></i>�:</span></td><td> the SYSTEM ID (e.g. filename or URL) 194</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="getEntity"></a>getEntity ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> getEntity (void *ctx, 195 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> 196Get an entity by name</p><p> 197 198</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 199</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> The entity name 200</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlEntityPtr if found. 201</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="getParameterEntity"></a>getParameterEntity ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> getParameterEntity (void *ctx, 202 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> 203Get a parameter entity by name</p><p> 204 205</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 206</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> The entity name 207</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlEntityPtr if found. 208</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="resolveEntity"></a>resolveEntity ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> resolveEntity (void *ctx, 209 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, 210 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId);</pre><p> 211The entity loader, to control the loading of external entities, 212the application can either: 213 - override this <a href="libxml-SAX.html#resolveEntity">resolveEntity</a>() callback in the SAX block 214 - or better use the <a href="libxml-parser.html#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a>() function to 215 set up it's own entity resolution routine</p><p> 216 217</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 218</td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>�:</span></td><td> The public ID of the entity 219</td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>�:</span></td><td> The system ID of the entity 220</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. 221</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="entityDecl"></a>entityDecl ()</h3><pre class="programlisting">void entityDecl (void *ctx, 222 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, 223 int type, 224 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, 225 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId, 226 <a href="libxml-tree.html#xmlChar">xmlChar</a> *content);</pre><p> 227An entity definition has been parsed</p><p> 228 229</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 230</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the entity name 231</td></tr><tr><td><span class="term"><i><tt>type</tt></i>�:</span></td><td> the entity type 232</td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>�:</span></td><td> The public ID of the entity 233</td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>�:</span></td><td> The system ID of the entity 234</td></tr><tr><td><span class="term"><i><tt>content</tt></i>�:</span></td><td> the entity value (without processing). 235</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="attributeDecl"></a>attributeDecl ()</h3><pre class="programlisting">void attributeDecl (void *ctx, 236 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *elem, 237 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *fullname, 238 int type, 239 int def, 240 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *defaultValue, 241 <a href="libxml-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree);</pre><p> 242An attribute definition has been parsed</p><p> 243 244</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 245</td></tr><tr><td><span class="term"><i><tt>elem</tt></i>�:</span></td><td> the name of the element 246</td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>�:</span></td><td> the attribute name 247</td></tr><tr><td><span class="term"><i><tt>type</tt></i>�:</span></td><td> the attribute type 248</td></tr><tr><td><span class="term"><i><tt>def</tt></i>�:</span></td><td> the type of default value 249</td></tr><tr><td><span class="term"><i><tt>defaultValue</tt></i>�:</span></td><td> the attribute default value 250</td></tr><tr><td><span class="term"><i><tt>tree</tt></i>�:</span></td><td> the tree of enumerated value set 251</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="elementDecl"></a>elementDecl ()</h3><pre class="programlisting">void elementDecl (void *ctx, 252 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, 253 int type, 254 <a href="libxml-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> content);</pre><p> 255An element definition has been parsed</p><p> 256 257</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 258</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the element name 259</td></tr><tr><td><span class="term"><i><tt>type</tt></i>�:</span></td><td> the element type 260</td></tr><tr><td><span class="term"><i><tt>content</tt></i>�:</span></td><td> the element value tree 261</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="notationDecl"></a>notationDecl ()</h3><pre class="programlisting">void notationDecl (void *ctx, 262 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, 263 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, 264 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId);</pre><p> 265What to do when a notation declaration has been parsed.</p><p> 266 267</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 268</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> The name of the notation 269</td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>�:</span></td><td> The public ID of the entity 270</td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>�:</span></td><td> The system ID of the entity 271</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="unparsedEntityDecl"></a>unparsedEntityDecl ()</h3><pre class="programlisting">void unparsedEntityDecl (void *ctx, 272 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, 273 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, 274 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId, 275 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *notationName);</pre><p> 276What to do when an unparsed entity declaration is parsed</p><p> 277 278</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 279</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> The name of the entity 280</td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>�:</span></td><td> The public ID of the entity 281</td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>�:</span></td><td> The system ID of the entity 282</td></tr><tr><td><span class="term"><i><tt>notationName</tt></i>�:</span></td><td> the name of the notation 283</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="startDocument"></a>startDocument ()</h3><pre class="programlisting">void startDocument (void *ctx);</pre><p> 284called when the document start being processed.</p><p> 285 286</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 287</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="endDocument"></a>endDocument ()</h3><pre class="programlisting">void endDocument (void *ctx);</pre><p> 288called when the document end has been detected.</p><p> 289 290</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 291</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="attribute"></a>attribute ()</h3><pre class="programlisting">void attribute (void *ctx, 292 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *fullname, 293 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value);</pre><p> 294Handle an attribute that has been read by the parser. 295The default handling is to convert the attribute into an 296DOM subtree and past it in a new xmlAttr element added to 297the element.</p><p> 298 299</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 300</td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>�:</span></td><td> The attribute name, including namespace prefix 301</td></tr><tr><td><span class="term"><i><tt>value</tt></i>�:</span></td><td> The attribute value 302</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="startElement"></a>startElement ()</h3><pre class="programlisting">void startElement (void *ctx, 303 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *fullname, 304 const <a href="libxml-tree.html#xmlChar">xmlChar</a> **atts);</pre><p> 305called when an opening tag has been processed.</p><p> 306 307</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 308</td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>�:</span></td><td> The element name, including namespace prefix 309</td></tr><tr><td><span class="term"><i><tt>atts</tt></i>�:</span></td><td> An array of name/value attributes pairs, NULL terminated 310</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="endElement"></a>endElement ()</h3><pre class="programlisting">void endElement (void *ctx, 311 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> 312called when the end of an element has been detected.</p><p> 313 314</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 315</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> The element name 316</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="reference"></a>reference ()</h3><pre class="programlisting">void reference (void *ctx, 317 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> 318called when an entity reference is detected.</p><p> 319 320</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 321</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> The entity name 322</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="characters"></a>characters ()</h3><pre class="programlisting">void characters (void *ctx, 323 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch, 324 int len);</pre><p> 325receiving some chars from the parser.</p><p> 326 327</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 328</td></tr><tr><td><span class="term"><i><tt>ch</tt></i>�:</span></td><td> a xmlChar string 329</td></tr><tr><td><span class="term"><i><tt>len</tt></i>�:</span></td><td> the number of xmlChar 330</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="ignorableWhitespace"></a>ignorableWhitespace ()</h3><pre class="programlisting">void ignorableWhitespace (void *ctx, 331 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch, 332 int len);</pre><p> 333receiving some ignorable whitespaces from the parser. 334UNUSED: by default the DOM building will use characters</p><p> 335 336</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 337</td></tr><tr><td><span class="term"><i><tt>ch</tt></i>�:</span></td><td> a xmlChar string 338</td></tr><tr><td><span class="term"><i><tt>len</tt></i>�:</span></td><td> the number of xmlChar 339</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="processingInstruction"></a>processingInstruction ()</h3><pre class="programlisting">void processingInstruction (void *ctx, 340 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *target, 341 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *data);</pre><p> 342A processing instruction has been parsed.</p><p> 343 344</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 345</td></tr><tr><td><span class="term"><i><tt>target</tt></i>�:</span></td><td> the target name 346</td></tr><tr><td><span class="term"><i><tt>data</tt></i>�:</span></td><td> the PI data's 347</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="globalNamespace"></a>globalNamespace ()</h3><pre class="programlisting">void globalNamespace (void *ctx, 348 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *href, 349 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *prefix);</pre><p> 350An old global namespace has been parsed.</p><p> 351 352</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 353</td></tr><tr><td><span class="term"><i><tt>href</tt></i>�:</span></td><td> the namespace associated URN 354</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>�:</span></td><td> the namespace prefix 355</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="setNamespace"></a>setNamespace ()</h3><pre class="programlisting">void setNamespace (void *ctx, 356 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> 357Set the current element namespace.</p><p> 358 359</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 360</td></tr><tr><td><span class="term"><i><tt>name</tt></i>�:</span></td><td> the namespace prefix 361</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="getNamespace"></a>getNamespace ()</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> getNamespace (void *ctx);</pre><p> 362Get the current element namespace.</p><p> 363 364</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 365</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the xmlNsPtr or NULL if none 366</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="checkNamespace"></a>checkNamespace ()</h3><pre class="programlisting">int checkNamespace (void *ctx, 367 <a href="libxml-tree.html#xmlChar">xmlChar</a> *nameSpace);</pre><p> 368Check that the current element namespace is the same as the 369one read upon parsing.</p><p> 370 371</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 372</td></tr><tr><td><span class="term"><i><tt>nameSpace</tt></i>�:</span></td><td> the namespace to check against 373</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 if true 0 otherwise 374</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="namespaceDecl"></a>namespaceDecl ()</h3><pre class="programlisting">void namespaceDecl (void *ctx, 375 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *href, 376 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *prefix);</pre><p> 377A namespace has been parsed.</p><p> 378 379</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 380</td></tr><tr><td><span class="term"><i><tt>href</tt></i>�:</span></td><td> the namespace associated URN 381</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>�:</span></td><td> the namespace prefix 382</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="comment"></a>comment ()</h3><pre class="programlisting">void comment (void *ctx, 383 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value);</pre><p> 384A comment has been parsed.</p><p> 385 386</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 387</td></tr><tr><td><span class="term"><i><tt>value</tt></i>�:</span></td><td> the comment content 388</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="cdataBlock"></a>cdataBlock ()</h3><pre class="programlisting">void cdataBlock (void *ctx, 389 const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value, 390 int len);</pre><p> 391called when a pcdata block has been parsed</p><p> 392 393</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>�:</span></td><td> the user data (XML parser context) 394</td></tr><tr><td><span class="term"><i><tt>value</tt></i>�:</span></td><td> The pcdata content 395</td></tr><tr><td><span class="term"><i><tt>len</tt></i>�:</span></td><td> the block length 396</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="initxmlDefaultSAXHandler"></a>initxmlDefaultSAXHandler ()</h3><pre class="programlisting">void initxmlDefaultSAXHandler (<a href="libxml-parser.html#xmlSAXHandler">xmlSAXHandler</a> *hdlr, 397 int warning);</pre><p> 398Initialize the default XML SAX handler</p><p> 399 400</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>hdlr</tt></i>�:</span></td><td> the SAX handler 401</td></tr><tr><td><span class="term"><i><tt>warning</tt></i>�:</span></td><td> flag if non-zero sets the handler warning procedure 402</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="inithtmlDefaultSAXHandler"></a>inithtmlDefaultSAXHandler ()</h3><pre class="programlisting">void inithtmlDefaultSAXHandler (<a href="libxml-parser.html#xmlSAXHandler">xmlSAXHandler</a> *hdlr);</pre><p> 403Initialize the default HTML SAX handler</p><p> 404 405</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>hdlr</tt></i>�:</span></td><td> the SAX handler 406</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="initdocbDefaultSAXHandler"></a>initdocbDefaultSAXHandler ()</h3><pre class="programlisting">void initdocbDefaultSAXHandler (<a href="libxml-parser.html#xmlSAXHandler">xmlSAXHandler</a> *hdlr);</pre><p> 407Initialize the default DocBook SAX handler</p><p> 408 409</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>hdlr</tt></i>�:</span></td><td> the SAX handler 410</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlDefaultSAXHandlerInit"></a>xmlDefaultSAXHandlerInit ()</h3><pre class="programlisting">void xmlDefaultSAXHandlerInit (void);</pre><p> 411Initialize the default SAX handler</p><p> 412 413</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="htmlDefaultSAXHandlerInit"></a>htmlDefaultSAXHandlerInit ()</h3><pre class="programlisting">void htmlDefaultSAXHandlerInit (void);</pre><p> 414Initialize the default SAX handler</p><p> 415 416</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="docbDefaultSAXHandlerInit"></a>docbDefaultSAXHandlerInit ()</h3><pre class="programlisting">void docbDefaultSAXHandlerInit (void);</pre><p> 417Initialize the default SAX handler</p><p> 418 419</p></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-xmlreader.html"><b><<�xmlreader</b></a></td><td align="right"><a accesskey="n" href="libxml-tree.html"><b>tree�>></b></a></td></tr></table></body></html> 420