</pre><p>DEPRECATED: This function will be made private. Call <ahref="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. Initialize the default SAX handler</p>
</pre><p>DEPRECATED: This function will be made private. Call <ahref="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. Initialize the default SAX2 handler</p>
</pre><p>An <ahref="libxml2-SAX.html#attribute">attribute</a> definition has been parsed</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>elem</tt></i>:</span></td><td>the name of the element</td></tr><tr><td><spanclass="term"><i><tt>fullname</tt></i>:</span></td><td>the <ahref="libxml2-SAX.html#attribute">attribute</a> name</td></tr><tr><td><spanclass="term"><i><tt>type</tt></i>:</span></td><td>the <ahref="libxml2-SAX.html#attribute">attribute</a> type</td></tr><tr><td><spanclass="term"><i><tt>def</tt></i>:</span></td><td>the type of default value</td></tr><tr><td><spanclass="term"><i><tt>defaultValue</tt></i>:</span></td><td>the <ahref="libxml2-SAX.html#attribute">attribute</a> default value</td></tr><tr><td><spanclass="term"><i><tt>tree</tt></i>:</span></td><td>the tree of enumerated value set</td></tr></tbody></table></div></div>
</pre><p>called when a pcdata block has been parsed</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>value</tt></i>:</span></td><td>The pcdata content</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the block length</td></tr></tbody></table></div></div>
</pre><p>receiving some chars from the parser.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>ch</tt></i>:</span></td><td>a <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> string</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the number of <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a></td></tr></tbody></table></div></div>
</pre><p>A <ahref="libxml2-SAX2.html#xmlSAX2Comment">xmlSAX2Comment</a> has been parsed.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>value</tt></i>:</span></td><td>the <ahref="libxml2-SAX2.html#xmlSAX2Comment">xmlSAX2Comment</a> content</td></tr></tbody></table></div></div>
</pre><p>An element definition has been parsed</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>name</tt></i>:</span></td><td>the element name</td></tr><tr><td><spanclass="term"><i><tt>type</tt></i>:</span></td><td>the element type</td></tr><tr><td><spanclass="term"><i><tt>content</tt></i>:</span></td><td>the element value tree</td></tr></tbody></table></div></div>
</pre><p>called when the document end has been detected.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div></div>
</pre><p>called when the end of an element has been detected.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>name</tt></i>:</span></td><td>The element name</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><spanclass="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><spanclass="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>name</tt></i>:</span></td><td>the entity name</td></tr><tr><td><spanclass="term"><i><tt>type</tt></i>:</span></td><td>the entity type</td></tr><tr><td><spanclass="term"><i><tt>publicId</tt></i>:</span></td><td>The public ID of the entity</td></tr><tr><td><spanclass="term"><i><tt>systemId</tt></i>:</span></td><td>The system ID of the entity</td></tr><tr><td><spanclass="term"><i><tt>content</tt></i>:</span></td><td>the entity value (without processing).</td></tr></tbody></table></div></div>
</pre><p>Callback on external subset declaration.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>name</tt></i>:</span></td><td>the root element name</td></tr><tr><td><spanclass="term"><i><tt>ExternalID</tt></i>:</span></td><td>the external ID</td></tr><tr><td><spanclass="term"><i><tt>SystemID</tt></i>:</span></td><td>the SYSTEM ID (e.g. filename or URL)</td></tr></tbody></table></div></div>
</pre><p>Provide the column number of the current parsing point.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>an int</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>name</tt></i>:</span></td><td>The entity name</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the <ahref="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> if found.</td></tr></tbody></table></div></div>
</pre><p>Provide the line number of the current parsing point.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>an int</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>name</tt></i>:</span></td><td>The entity name</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the <ahref="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> if found.</td></tr></tbody></table></div></div>
</pre><p>Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>a <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr></tbody></table></div></div>
</pre><p>Provides the system ID, basically URL or filename e.g. http://www.sgmlsource.com/dtds/memo.dtd</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>a <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr></tbody></table></div></div>
</pre><p>Does this document has an external subset</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>1 if true</td></tr></tbody></table></div></div>
</pre><p>Does this document has an internal subset</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>1 if true</td></tr></tbody></table></div></div>
</pre><p>receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use <ahref="libxml2-SAX2.html#xmlSAX2Characters">xmlSAX2Characters</a></p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>ch</tt></i>:</span></td><td>a <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> string</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the number of <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a></td></tr></tbody></table></div></div>
<hr/>
<divclass="refsect2"lang="en"><h3><aname="xmlSAX2InitDefaultSAXHandler"/>xmlSAX2InitDefaultSAXHandler ()</h3><preclass="programlisting">void xmlSAX2InitDefaultSAXHandler (<ahref="libxml2-tree.html#xmlSAXHandler">xmlSAXHandler</a> * hdlr, <br/> int warning)<br/>
</pre><p>Initialize the default XML SAX2 handler</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>hdlr</tt></i>:</span></td><td>the SAX handler</td></tr><tr><td><spanclass="term"><i><tt>warning</tt></i>:</span></td><td>flag if non-zero sets the handler warning procedure</td></tr></tbody></table></div></div>
</pre><p>Callback on internal subset declaration.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>name</tt></i>:</span></td><td>the root element name</td></tr><tr><td><spanclass="term"><i><tt>ExternalID</tt></i>:</span></td><td>the external ID</td></tr><tr><td><spanclass="term"><i><tt>SystemID</tt></i>:</span></td><td>the SYSTEM ID (e.g. filename or URL)</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>1 if true</td></tr></tbody></table></div></div>
</pre><p>What to do when a notation declaration has been parsed.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>name</tt></i>:</span></td><td>The name of the notation</td></tr><tr><td><spanclass="term"><i><tt>publicId</tt></i>:</span></td><td>The public ID of the entity</td></tr><tr><td><spanclass="term"><i><tt>systemId</tt></i>:</span></td><td>The system ID of the entity</td></tr></tbody></table></div></div>
</pre><p>A processing instruction has been parsed.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>target</tt></i>:</span></td><td>the target name</td></tr><tr><td><spanclass="term"><i><tt>data</tt></i>:</span></td><td>the PI data's</td></tr></tbody></table></div></div>
</pre><p>called when an entity <ahref="libxml2-SAX2.html#xmlSAX2Reference">xmlSAX2Reference</a> is detected.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>name</tt></i>:</span></td><td>The entity name</td></tr></tbody></table></div></div>
</pre><p>The entity loader, to control the loading of external entities, the application can either: - override this xmlSAX2ResolveEntity() callback in the SAX block - or better use the xmlSetExternalEntityLoader() function to set up it's own entity resolution routine</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>publicId</tt></i>:</span></td><td>The public ID of the entity</td></tr><tr><td><spanclass="term"><i><tt>systemId</tt></i>:</span></td><td>The system ID of the entity</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the <ahref="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> if inlined or NULL for DOM behaviour.</td></tr></tbody></table></div></div>
</pre><p>Receive the document locator at startup, actually <ahref="libxml2-globals.html#xmlDefaultSAXLocator">xmlDefaultSAXLocator</a> Everything is available on the context, so this is useless in our case.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>loc</tt></i>:</span></td><td>A SAX Locator</td></tr></tbody></table></div></div>
</pre><p>called when the document start being processed.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div></div>
</pre><p>called when an opening tag has been processed.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>fullname</tt></i>:</span></td><td>The element name, including namespace prefix</td></tr><tr><td><spanclass="term"><i><tt>atts</tt></i>:</span></td><td>An array of name/value attributes pairs, NULL terminated</td></tr></tbody></table></div></div>
</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><spanclass="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><spanclass="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr><tr><td><spanclass="term"><i><tt>nb_namespaces</tt></i>:</span></td><td>number of namespace definitions on that node</td></tr><tr><td><spanclass="term"><i><tt>namespaces</tt></i>:</span></td><td>pointer to the array of prefix/URI pairs namespace definitions</td></tr><tr><td><spanclass="term"><i><tt>nb_attributes</tt></i>:</span></td><td>the number of attributes on that node</td></tr><tr><td><spanclass="term"><i><tt>nb_defaulted</tt></i>:</span></td><td>the number of defaulted attributes.</td></tr><tr><td><spanclass="term"><i><tt>attributes</tt></i>:</span></td><td>pointer to the array of (localname/prefix/URI/value/end) <ahref="libxml2-SAX.html#attribute">attribute</a> values.</td></tr></tbody></table></div></div>
</pre><p>What to do when an unparsed entity declaration is parsed</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><spanclass="term"><i><tt>name</tt></i>:</span></td><td>The name of the entity</td></tr><tr><td><spanclass="term"><i><tt>publicId</tt></i>:</span></td><td>The public ID of the entity</td></tr><tr><td><spanclass="term"><i><tt>systemId</tt></i>:</span></td><td>The system ID of the entity</td></tr><tr><td><spanclass="term"><i><tt>notationName</tt></i>:</span></td><td>the name of the notation</td></tr></tbody></table></div></div>
</pre><p>Set the default version of SAX used globally by the library. By default, during initialization the default is set to 2. Note that it is generally a better coding style to use xmlSAXVersion() to set up the version explicitly for a given parsing context.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>version</tt></i>:</span></td><td>the version, 1 or 2</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the previous value in case of success and -1 in case of error.</td></tr></tbody></table></div></div>
<hr/>
<divclass="refsect2"lang="en"><h3><aname="xmlSAXVersion"/>xmlSAXVersion ()</h3><preclass="programlisting">int xmlSAXVersion (<ahref="libxml2-tree.html#xmlSAXHandler">xmlSAXHandler</a> * hdlr, <br/> int version)<br/>
</pre><p>Initialize the default XML SAX handler according to the version</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>hdlr</tt></i>:</span></td><td>the SAX handler</td></tr><tr><td><spanclass="term"><i><tt>version</tt></i>:</span></td><td>the version, 1 or 2</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of error.</td></tr></tbody></table></div></div>