| <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"> |
| .synopsis, .classsynopsis { |
| background: #eeeeee; |
| border: solid 1px #aaaaaa; |
| padding: 0.5em; |
| } |
| .programlisting { |
| background: #eeeeff; |
| border: solid 1px #aaaaff; |
| padding: 0.5em; |
| } |
| .variablelist { |
| padding: 4px; |
| margin-left: 3em; |
| } |
| .navigation { |
| background: #ffeeee; |
| border: solid 1px #ffaaaa; |
| margin-top: 0.5em; |
| margin-bottom: 0.5em; |
| } |
| .navigation a { |
| color: #770000; |
| } |
| .navigation a:visited { |
| color: #550000; |
| } |
| .navigation .title { |
| font-size: 200%; |
| } |
| </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"> |
| |
| |
| |
| #define <a href="libxml-parser.html#XML-DEFAULT-VERSION-CAPS">XML_DEFAULT_VERSION</a> |
| void (<a href="libxml-parser.html#xmlParserInputDeallocate">*xmlParserInputDeallocate</a>) (<a href="libxml-tree.html#xmlChar">xmlChar</a> *str); |
| struct <a href="libxml-parser.html#xmlParserInput">xmlParserInput</a>; |
| struct <a href="libxml-parser.html#xmlParserNodeInfo">xmlParserNodeInfo</a>; |
| typedef <a href="libxml-parser.html#xmlParserNodeInfoPtr">xmlParserNodeInfoPtr</a>; |
| struct <a href="libxml-parser.html#xmlParserNodeInfoSeq">xmlParserNodeInfoSeq</a>; |
| typedef <a href="libxml-parser.html#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a>; |
| enum <a href="libxml-parser.html#xmlParserInputState">xmlParserInputState</a>; |
| #define <a href="libxml-parser.html#XML-DETECT-IDS-CAPS">XML_DETECT_IDS</a> |
| #define <a href="libxml-parser.html#XML-COMPLETE-ATTRS-CAPS">XML_COMPLETE_ATTRS</a> |
| #define <a href="libxml-parser.html#XML-SKIP-IDS-CAPS">XML_SKIP_IDS</a> |
| struct <a href="libxml-parser.html#xmlParserCtxt">xmlParserCtxt</a>; |
| struct <a href="libxml-parser.html#xmlSAXLocator">xmlSAXLocator</a>; |
| <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> (<a href="libxml-parser.html#resolveEntitySAXFunc">*resolveEntitySAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId); |
| void (<a href="libxml-parser.html#internalSubsetSAXFunc">*internalSubsetSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID); |
| void (<a href="libxml-parser.html#externalSubsetSAXFunc">*externalSubsetSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID); |
| <a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> (<a href="libxml-parser.html#getEntitySAXFunc">*getEntitySAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name); |
| <a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> (<a href="libxml-parser.html#getParameterEntitySAXFunc">*getParameterEntitySAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name); |
| void (<a href="libxml-parser.html#entityDeclSAXFunc">*entityDeclSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| int type, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId, |
| <a href="libxml-tree.html#xmlChar">xmlChar</a> *content); |
| void (<a href="libxml-parser.html#notationDeclSAXFunc">*notationDeclSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId); |
| void (<a href="libxml-parser.html#attributeDeclSAXFunc">*attributeDeclSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *elem, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *fullname, |
| int type, |
| int def, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *defaultValue, |
| <a href="libxml-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree); |
| void (<a href="libxml-parser.html#elementDeclSAXFunc">*elementDeclSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| int type, |
| <a href="libxml-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> content); |
| void (<a href="libxml-parser.html#unparsedEntityDeclSAXFunc">*unparsedEntityDeclSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *notationName); |
| void (<a href="libxml-parser.html#setDocumentLocatorSAXFunc">*setDocumentLocatorSAXFunc</a>) (void *ctx, |
| <a href="libxml-tree.html#xmlSAXLocatorPtr">xmlSAXLocatorPtr</a> loc); |
| void (<a href="libxml-parser.html#startDocumentSAXFunc">*startDocumentSAXFunc</a>) (void *ctx); |
| void (<a href="libxml-parser.html#endDocumentSAXFunc">*endDocumentSAXFunc</a>) (void *ctx); |
| void (<a href="libxml-parser.html#startElementSAXFunc">*startElementSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> **atts); |
| void (<a href="libxml-parser.html#endElementSAXFunc">*endElementSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name); |
| void (<a href="libxml-parser.html#attributeSAXFunc">*attributeSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value); |
| void (<a href="libxml-parser.html#referenceSAXFunc">*referenceSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name); |
| void (<a href="libxml-parser.html#charactersSAXFunc">*charactersSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch, |
| int len); |
| void (<a href="libxml-parser.html#ignorableWhitespaceSAXFunc">*ignorableWhitespaceSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch, |
| int len); |
| void (<a href="libxml-parser.html#processingInstructionSAXFunc">*processingInstructionSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *target, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *data); |
| void (<a href="libxml-parser.html#commentSAXFunc">*commentSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value); |
| void (<a href="libxml-parser.html#cdataBlockSAXFunc">*cdataBlockSAXFunc</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value, |
| int len); |
| void (<a href="libxml-parser.html#warningSAXFunc">*warningSAXFunc</a>) (void *ctx, |
| const char *msg, |
| ...); |
| void (<a href="libxml-parser.html#errorSAXFunc">*errorSAXFunc</a>) (void *ctx, |
| const char *msg, |
| ...); |
| void (<a href="libxml-parser.html#fatalErrorSAXFunc">*fatalErrorSAXFunc</a>) (void *ctx, |
| const char *msg, |
| ...); |
| int (<a href="libxml-parser.html#isStandaloneSAXFunc">*isStandaloneSAXFunc</a>) (void *ctx); |
| int (<a href="libxml-parser.html#hasInternalSubsetSAXFunc">*hasInternalSubsetSAXFunc</a>) (void *ctx); |
| int (<a href="libxml-parser.html#hasExternalSubsetSAXFunc">*hasExternalSubsetSAXFunc</a>) (void *ctx); |
| #define <a href="libxml-parser.html#XML-SAX2-MAGIC-CAPS">XML_SAX2_MAGIC</a> |
| void (<a href="libxml-parser.html#startElementNsSAX2Func">*startElementNsSAX2Func</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *localname, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *prefix, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *URI, |
| int nb_namespaces, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> **namespaces, |
| int nb_attributes, |
| int nb_defaulted, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> **attributes); |
| void (<a href="libxml-parser.html#endElementNsSAX2Func">*endElementNsSAX2Func</a>) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *localname, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *prefix, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *URI); |
| struct <a href="libxml-parser.html#xmlSAXHandler">xmlSAXHandler</a>; |
| struct <a href="libxml-parser.html#xmlSAXHandlerV1">xmlSAXHandlerV1</a>; |
| typedef <a href="libxml-parser.html#xmlSAXHandlerV1Ptr">xmlSAXHandlerV1Ptr</a>; |
| <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> (<a href="libxml-parser.html#xmlExternalEntityLoader">*xmlExternalEntityLoader</a>) |
| (const char *URL, |
| const char *ID, |
| <a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> context); |
| enum <a href="libxml-parser.html#xmlParserOption">xmlParserOption</a>; |
| </pre></div><div class="refsect1"><h2>Description</h2><p> |
| |
| </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" |
| </pre><p> |
| The default version of XML used: 1.0</p><p> |
| |
| </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> |
| Callback for freeing some parser input allocations.</p><p> |
| |
| </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 |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlParserInput"></a>struct xmlParserInput</h3><pre class="programlisting">struct xmlParserInput { |
| |
| /* Input buffer */ |
| xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */ |
| |
| const char *filename; /* The file analyzed, if any */ |
| const char *directory; /* the directory/base of the file */ |
| const xmlChar *base; /* Base of the array to parse */ |
| const xmlChar *cur; /* Current char being parsed */ |
| const xmlChar *end; /* end of the array to parse */ |
| int length; /* length if known */ |
| int line; /* Current line */ |
| int col; /* Current column */ |
| /* |
| * NOTE: consumed is only tested for equality in the parser code, |
| * so even if there is an overflow this should not give troubles |
| * for parsing very large instances. |
| */ |
| unsigned long consumed; /* How many xmlChars already consumed */ |
| xmlParserInputDeallocate free; /* function to deallocate the base */ |
| const xmlChar *encoding; /* the encoding string for entity */ |
| const xmlChar *version; /* the version string for entity */ |
| int standalone; /* Was that entity marked standalone */ |
| int id; /* an unique identifier for the entity */ |
| }; |
| </pre><p> |
| An xmlParserInput is an input flow for the XML processor. |
| Each entity parsed is associated an xmlParserInput (except the |
| few predefined ones). This is the case both for internal entities |
| - in which case the flow is already completely in memory - or |
| external entities - in which case we use the buf structure for |
| progressive reading and I18N conversions to the internal UTF-8 format.</p><p> |
| |
| </p></div><hr><div class="refsect2"><h3><a name="xmlParserNodeInfo"></a>struct xmlParserNodeInfo</h3><pre class="programlisting">struct xmlParserNodeInfo { |
| |
| const struct _xmlNode* node; |
| /* Position & line # that text that created the node begins & ends on */ |
| unsigned long begin_pos; |
| unsigned long begin_line; |
| unsigned long end_pos; |
| unsigned long end_line; |
| }; |
| </pre><p> |
| The parser can be asked to collect Node informations, i.e. at what |
| place in the file they were detected. |
| NOTE: This is off by default and not very well tested.</p><p> |
| |
| </p></div><hr><div class="refsect2"><h3><a name="xmlParserNodeInfoPtr"></a>xmlParserNodeInfoPtr</h3><pre class="programlisting">typedef xmlParserNodeInfo *xmlParserNodeInfoPtr; |
| </pre><p> |
| |
| </p></div><hr><div class="refsect2"><h3><a name="xmlParserNodeInfoSeq"></a>struct xmlParserNodeInfoSeq</h3><pre class="programlisting">struct xmlParserNodeInfoSeq { |
| |
| unsigned long maximum; |
| unsigned long length; |
| xmlParserNodeInfo* buffer; |
| }; |
| </pre><p> |
| |
| </p></div><hr><div class="refsect2"><h3><a name="xmlParserNodeInfoSeqPtr"></a>xmlParserNodeInfoSeqPtr</h3><pre class="programlisting">typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr; |
| </pre><p> |
| |
| </p></div><hr><div class="refsect2"><h3><a name="xmlParserInputState"></a>enum xmlParserInputState</h3><pre class="programlisting">typedef enum { |
| XML_PARSER_EOF = -1, /* nothing is to be parsed */ |
| XML_PARSER_START = 0, /* nothing has been parsed */ |
| XML_PARSER_MISC, /* Misc* before int subset */ |
| XML_PARSER_PI, /* Within a processing instruction */ |
| XML_PARSER_DTD, /* within some DTD content */ |
| XML_PARSER_PROLOG, /* Misc* after internal subset */ |
| XML_PARSER_COMMENT, /* within a comment */ |
| XML_PARSER_START_TAG, /* within a start tag */ |
| XML_PARSER_CONTENT, /* within the content */ |
| XML_PARSER_CDATA_SECTION, /* within a CDATA section */ |
| XML_PARSER_END_TAG, /* within a closing tag */ |
| XML_PARSER_ENTITY_DECL, /* within an entity declaration */ |
| XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */ |
| XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */ |
| XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */ |
| XML_PARSER_EPILOG, /* the Misc* after the last end tag */ |
| XML_PARSER_IGNORE, /* within an IGNORED section */ |
| XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */ |
| } xmlParserInputState; |
| </pre><p> |
| The parser is now working also as a state based parser. |
| The recursive one use the state info for entities processing.</p><p> |
| |
| </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 |
| </pre><p> |
| Bit in the loadsubset context field to tell to do ID/REFs lookups. |
| Use it to initialize xmlLoadExtDtdDefaultValue.</p><p> |
| |
| </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 |
| </pre><p> |
| Bit in the loadsubset context field to tell to do complete the |
| elements attributes lists with the ones defaulted from the DTDs. |
| Use it to initialize xmlLoadExtDtdDefaultValue.</p><p> |
| |
| </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 |
| </pre><p> |
| Bit in the loadsubset context field to tell to not do ID/REFs registration. |
| Used to initialize xmlLoadExtDtdDefaultValue in some special cases.</p><p> |
| |
| </p></div><hr><div class="refsect2"><h3><a name="xmlParserCtxt"></a>struct xmlParserCtxt</h3><pre class="programlisting">struct xmlParserCtxt { |
| |
| struct _xmlSAXHandler *sax; /* The SAX handler */ |
| void *userData; /* For SAX interface only, used by DOM build */ |
| xmlDocPtr myDoc; /* the document being built */ |
| int wellFormed; /* is the document well formed */ |
| int replaceEntities; /* shall we replace entities ? */ |
| const xmlChar *version; /* the XML version string */ |
| const xmlChar *encoding; /* the declared encoding, if any */ |
| int standalone; /* standalone document */ |
| int html; /* an HTML(1)/Docbook(2) document */ |
| |
| /* Input stream stack */ |
| xmlParserInputPtr input; /* Current input stream */ |
| int inputNr; /* Number of current input streams */ |
| int inputMax; /* Max number of input streams */ |
| xmlParserInputPtr *inputTab; /* stack of inputs */ |
| |
| /* Node analysis stack only used for DOM building */ |
| xmlNodePtr node; /* Current parsed Node */ |
| int nodeNr; /* Depth of the parsing stack */ |
| int nodeMax; /* Max depth of the parsing stack */ |
| xmlNodePtr *nodeTab; /* array of nodes */ |
| |
| int record_info; /* Whether node info should be kept */ |
| xmlParserNodeInfoSeq node_seq; /* info about each node parsed */ |
| |
| int errNo; /* error code */ |
| |
| int hasExternalSubset; /* reference and external subset */ |
| int hasPErefs; /* the internal subset has PE refs */ |
| int external; /* are we parsing an external entity */ |
| |
| int valid; /* is the document valid */ |
| int validate; /* shall we try to validate ? */ |
| xmlValidCtxt vctxt; /* The validity context */ |
| |
| xmlParserInputState instate; /* current type of input */ |
| int token; /* next char look-ahead */ |
| |
| char *directory; /* the data directory */ |
| |
| /* Node name stack */ |
| const xmlChar *name; /* Current parsed Node */ |
| int nameNr; /* Depth of the parsing stack */ |
| int nameMax; /* Max depth of the parsing stack */ |
| const xmlChar * *nameTab; /* array of nodes */ |
| |
| long nbChars; /* number of xmlChar processed */ |
| long checkIndex; /* used by progressive parsing lookup */ |
| int keepBlanks; /* ugly but ... */ |
| int disableSAX; /* SAX callbacks are disabled */ |
| int inSubset; /* Parsing is in int 1/ext 2 subset */ |
| const xmlChar * intSubName; /* name of subset */ |
| xmlChar * extSubURI; /* URI of external subset */ |
| xmlChar * extSubSystem; /* SYSTEM ID of external subset */ |
| |
| /* xml:space values */ |
| int * space; /* Should the parser preserve spaces */ |
| int spaceNr; /* Depth of the parsing stack */ |
| int spaceMax; /* Max depth of the parsing stack */ |
| int * spaceTab; /* array of space infos */ |
| |
| int depth; /* to prevent entity substitution loops */ |
| xmlParserInputPtr entity; /* used to check entities boundaries */ |
| int charset; /* encoding of the in-memory content |
| actually an xmlCharEncoding */ |
| int nodelen; /* Those two fields are there to */ |
| int nodemem; /* Speed up large node parsing */ |
| int pedantic; /* signal pedantic warnings */ |
| void *_private; /* For user data, libxml won't touch it */ |
| |
| int loadsubset; /* should the external subset be loaded */ |
| int linenumbers; /* set line number in element content */ |
| void *catalogs; /* document's own catalog */ |
| int recovery; /* run in recovery mode */ |
| int progressive; /* is this a progressive parsing */ |
| xmlDictPtr dict; /* dictionnary for the parser */ |
| const xmlChar * *atts; /* array for the attributes callbacks */ |
| int maxatts; /* the size of the array */ |
| int docdict; /* use strings from dict to build tree */ |
| |
| /* |
| * pre-interned strings |
| */ |
| const xmlChar *str_xml; |
| const xmlChar *str_xmlns; |
| const xmlChar *str_xml_ns; |
| |
| /* |
| * Everything below is used only by the new SAX mode |
| */ |
| int sax2; /* operating in the new SAX mode */ |
| int nsNr; /* the number of inherited namespaces */ |
| int nsMax; /* the size of the arrays */ |
| const xmlChar * *nsTab; /* the array of prefix/namespace name */ |
| int *attallocs; /* which attribute were allocated */ |
| void * *pushTab; /* array of data for push */ |
| xmlHashTablePtr attsDefault; /* defaulted attributes if any */ |
| xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */ |
| int nsWellFormed; /* is the document XML Nanespace okay */ |
| int options; /* Extra options */ |
| |
| /* |
| * Those fields are needed only for treaming parsing so far |
| */ |
| int dictNames; /* Use dictionary names for the tree */ |
| int freeElemsNr; /* number of freed element nodes */ |
| xmlNodePtr freeElems; /* List of freed element nodes */ |
| int freeAttrsNr; /* number of freed attributes nodes */ |
| xmlAttrPtr freeAttrs; /* List of freed attributes nodes */ |
| |
| /* |
| * the complete error informations for the last error. |
| */ |
| xmlError lastError; |
| }; |
| </pre><p> |
| The parser context. |
| NOTE This doesn't completely define the parser state, the (current ?) |
| design of the parser uses recursive function calls since this allow |
| and easy mapping from the production rules of the specification |
| to the actual code. The drawback is that the actual function call |
| also reflect the parser state. However most of the parsing routines |
| takes as the only argument the parser context pointer, so migrating |
| to a state based parser for progressive parsing shouldn't be too hard.</p><p> |
| |
| </p></div><hr><div class="refsect2"><h3><a name="xmlSAXLocator"></a>struct xmlSAXLocator</h3><pre class="programlisting">struct xmlSAXLocator { |
| |
| const xmlChar *(*getPublicId)(void *ctx); |
| const xmlChar *(*getSystemId)(void *ctx); |
| int (*getLineNumber)(void *ctx); |
| int (*getColumnNumber)(void *ctx); |
| }; |
| </pre><p> |
| A SAX Locator.</p><p> |
| |
| </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, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId);</pre><p> |
| Callback: |
| The entity loader, to control the loading of external entities, |
| the application can either: |
| - override this <GTKDOCLINK HREF="resolveEntity">resolveEntity</GTKDOCLINK>() callback in the SAX block |
| - or better use the <GTKDOCLINK HREF="xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</GTKDOCLINK>() function to |
| set up it's own entity resolution routine</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>:</span></td><td> The public ID of the entity |
| </td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>:</span></td><td> The system ID of the entity |
| </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. |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="internalSubsetSAXFunc"></a>internalSubsetSAXFunc ()</h3><pre class="programlisting">void (*internalSubsetSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);</pre><p> |
| Callback on internal subset declaration.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> the root element name |
| </td></tr><tr><td><span class="term"><i><tt>ExternalID</tt></i>:</span></td><td> the external ID |
| </td></tr><tr><td><span class="term"><i><tt>SystemID</tt></i>:</span></td><td> the SYSTEM ID (e.g. filename or URL) |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="externalSubsetSAXFunc"></a>externalSubsetSAXFunc ()</h3><pre class="programlisting">void (*externalSubsetSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ExternalID, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *SystemID);</pre><p> |
| Callback on external subset declaration.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> the root element name |
| </td></tr><tr><td><span class="term"><i><tt>ExternalID</tt></i>:</span></td><td> the external ID |
| </td></tr><tr><td><span class="term"><i><tt>SystemID</tt></i>:</span></td><td> the SYSTEM ID (e.g. filename or URL) |
| </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, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> |
| Get an entity by name.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The entity name |
| </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>the xmlEntityPtr if found. |
| </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, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> |
| Get a parameter entity by name.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The entity name |
| </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>the xmlEntityPtr if found. |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="entityDeclSAXFunc"></a>entityDeclSAXFunc ()</h3><pre class="programlisting">void (*entityDeclSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| int type, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId, |
| <a href="libxml-tree.html#xmlChar">xmlChar</a> *content);</pre><p> |
| An entity definition has been parsed.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> the entity name |
| </td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td> the entity type |
| </td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>:</span></td><td> The public ID of the entity |
| </td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>:</span></td><td> The system ID of the entity |
| </td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td> the entity value (without processing). |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="notationDeclSAXFunc"></a>notationDeclSAXFunc ()</h3><pre class="programlisting">void (*notationDeclSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId);</pre><p> |
| What to do when a notation declaration has been parsed.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The name of the notation |
| </td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>:</span></td><td> The public ID of the entity |
| </td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>:</span></td><td> The system ID of the entity |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="attributeDeclSAXFunc"></a>attributeDeclSAXFunc ()</h3><pre class="programlisting">void (*attributeDeclSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *elem, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *fullname, |
| int type, |
| int def, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *defaultValue, |
| <a href="libxml-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree);</pre><p> |
| An attribute definition has been parsed.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td> the name of the element |
| </td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>:</span></td><td> the attribute name |
| </td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td> the attribute type |
| </td></tr><tr><td><span class="term"><i><tt>def</tt></i>:</span></td><td> the type of default value |
| </td></tr><tr><td><span class="term"><i><tt>defaultValue</tt></i>:</span></td><td> the attribute default value |
| </td></tr><tr><td><span class="term"><i><tt>tree</tt></i>:</span></td><td> the tree of enumerated value set |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="elementDeclSAXFunc"></a>elementDeclSAXFunc ()</h3><pre class="programlisting">void (*elementDeclSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| int type, |
| <a href="libxml-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> content);</pre><p> |
| An element definition has been parsed.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> the element name |
| </td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td> the element type |
| </td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td> the element value tree |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="unparsedEntityDeclSAXFunc"></a>unparsedEntityDeclSAXFunc ()</h3><pre class="programlisting">void (*unparsedEntityDeclSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *publicId, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *systemId, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *notationName);</pre><p> |
| What to do when an unparsed entity declaration is parsed.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The name of the entity |
| </td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>:</span></td><td> The public ID of the entity |
| </td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>:</span></td><td> The system ID of the entity |
| </td></tr><tr><td><span class="term"><i><tt>notationName</tt></i>:</span></td><td> the name of the notation |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="setDocumentLocatorSAXFunc"></a>setDocumentLocatorSAXFunc ()</h3><pre class="programlisting">void (*setDocumentLocatorSAXFunc) (void *ctx, |
| <a href="libxml-tree.html#xmlSAXLocatorPtr">xmlSAXLocatorPtr</a> loc);</pre><p> |
| Receive the document locator at startup, actually xmlDefaultSAXLocator. |
| Everything is available on the context, so this is useless in our case.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>loc</tt></i>:</span></td><td> A SAX Locator |
| </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> |
| Called when the document start being processed.</p><p> |
| |
| </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) |
| </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> |
| Called when the document end has been detected.</p><p> |
| |
| </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) |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="startElementSAXFunc"></a>startElementSAXFunc ()</h3><pre class="programlisting">void (*startElementSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> **atts);</pre><p> |
| Called when an opening tag has been processed.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The element name, including namespace prefix |
| </td></tr><tr><td><span class="term"><i><tt>atts</tt></i>:</span></td><td> An array of name/value attributes pairs, NULL terminated |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="endElementSAXFunc"></a>endElementSAXFunc ()</h3><pre class="programlisting">void (*endElementSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> |
| Called when the end of an element has been detected.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The element name |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="attributeSAXFunc"></a>attributeSAXFunc ()</h3><pre class="programlisting">void (*attributeSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value);</pre><p> |
| Handle an attribute that has been read by the parser. |
| The default handling is to convert the attribute into an |
| DOM subtree and past it in a new xmlAttr element added to |
| the element.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The attribute name, including namespace prefix |
| </td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td> The attribute value |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="referenceSAXFunc"></a>referenceSAXFunc ()</h3><pre class="programlisting">void (*referenceSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *name);</pre><p> |
| Called when an entity reference is detected.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td> The entity name |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="charactersSAXFunc"></a>charactersSAXFunc ()</h3><pre class="programlisting">void (*charactersSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch, |
| int len);</pre><p> |
| Receiving some chars from the parser.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>ch</tt></i>:</span></td><td> a xmlChar string |
| </td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td> the number of xmlChar |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="ignorableWhitespaceSAXFunc"></a>ignorableWhitespaceSAXFunc ()</h3><pre class="programlisting">void (*ignorableWhitespaceSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *ch, |
| int len);</pre><p> |
| Receiving some ignorable whitespaces from the parser. |
| UNUSED: by default the DOM building will use characters.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>ch</tt></i>:</span></td><td> a xmlChar string |
| </td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td> the number of xmlChar |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="processingInstructionSAXFunc"></a>processingInstructionSAXFunc ()</h3><pre class="programlisting">void (*processingInstructionSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *target, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *data);</pre><p> |
| A processing instruction has been parsed.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>target</tt></i>:</span></td><td> the target name |
| </td></tr><tr><td><span class="term"><i><tt>data</tt></i>:</span></td><td> the PI data's |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="commentSAXFunc"></a>commentSAXFunc ()</h3><pre class="programlisting">void (*commentSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value);</pre><p> |
| A comment has been parsed.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td> the comment content |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="cdataBlockSAXFunc"></a>cdataBlockSAXFunc ()</h3><pre class="programlisting">void (*cdataBlockSAXFunc) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *value, |
| int len);</pre><p> |
| Called when a pcdata block has been parsed.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td> The pcdata content |
| </td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td> the block length |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="warningSAXFunc"></a>warningSAXFunc ()</h3><pre class="programlisting">void (*warningSAXFunc) (void *ctx, |
| const char *msg, |
| ...);</pre><p> |
| Display and format a warning messages, callback.</p><p> |
| |
| </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 |
| </td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td> the message to display/transmit |
| </td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td> extra parameters for the message display |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="errorSAXFunc"></a>errorSAXFunc ()</h3><pre class="programlisting">void (*errorSAXFunc) (void *ctx, |
| const char *msg, |
| ...);</pre><p> |
| Display and format an error messages, callback.</p><p> |
| |
| </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 |
| </td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td> the message to display/transmit |
| </td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td> extra parameters for the message display |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="fatalErrorSAXFunc"></a>fatalErrorSAXFunc ()</h3><pre class="programlisting">void (*fatalErrorSAXFunc) (void *ctx, |
| const char *msg, |
| ...);</pre><p> |
| Display and format fatal error messages, callback. |
| Note: so far <GTKDOCLINK HREF="fatalError">fatalError</GTKDOCLINK>() SAX callbacks are not used, <GTKDOCLINK HREF="error">error</GTKDOCLINK>() |
| get all the callbacks for errors.</p><p> |
| |
| </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 |
| </td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td> the message to display/transmit |
| </td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td> extra parameters for the message display |
| </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> |
| Is this document tagged standalone?</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>1 if true |
| </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> |
| Does this document has an internal subset.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>1 if true |
| </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> |
| Does this document has an external subset?</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>1 if true |
| </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 |
| </pre><p> |
| Special constant found in SAX2 blocks initialized fields</p><p> |
| |
| </p></div><hr><div class="refsect2"><h3><a name="startElementNsSAX2Func"></a>startElementNsSAX2Func ()</h3><pre class="programlisting">void (*startElementNsSAX2Func) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *localname, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *prefix, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *URI, |
| int nb_namespaces, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> **namespaces, |
| int nb_attributes, |
| int nb_defaulted, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> **attributes);</pre><p> |
| SAX2 callback when an element start has been detected by the parser. |
| It provides the namespace informations for the element, as well as |
| the new namespace declarations on the element.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td> the local name of the element |
| </td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td> the element namespace prefix if available |
| </td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td> the element namespace name if available |
| </td></tr><tr><td><span class="term"><i><tt>nb_namespaces</tt></i>:</span></td><td> number of namespace definitions on that node |
| </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 |
| </td></tr><tr><td><span class="term"><i><tt>nb_attributes</tt></i>:</span></td><td> the number of attributes on that node |
| </td></tr><tr><td><span class="term"><i><tt>nb_defaulted</tt></i>:</span></td><td> the number of defaulted attributes. The defaulted |
| ones are at the end of the array |
| </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) |
| attribute values. |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="endElementNsSAX2Func"></a>endElementNsSAX2Func ()</h3><pre class="programlisting">void (*endElementNsSAX2Func) (void *ctx, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *localname, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *prefix, |
| const <a href="libxml-tree.html#xmlChar">xmlChar</a> *URI);</pre><p> |
| SAX2 callback when an element end has been detected by the parser. |
| It provides the namespace informations for the element.</p><p> |
| |
| </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) |
| </td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td> the local name of the element |
| </td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td> the element namespace prefix if available |
| </td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td> the element namespace name if available |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlSAXHandler"></a>struct xmlSAXHandler</h3><pre class="programlisting">struct xmlSAXHandler { |
| |
| internalSubsetSAXFunc internalSubset; |
| isStandaloneSAXFunc isStandalone; |
| hasInternalSubsetSAXFunc hasInternalSubset; |
| hasExternalSubsetSAXFunc hasExternalSubset; |
| resolveEntitySAXFunc resolveEntity; |
| getEntitySAXFunc getEntity; |
| entityDeclSAXFunc entityDecl; |
| notationDeclSAXFunc notationDecl; |
| attributeDeclSAXFunc attributeDecl; |
| elementDeclSAXFunc elementDecl; |
| unparsedEntityDeclSAXFunc unparsedEntityDecl; |
| setDocumentLocatorSAXFunc setDocumentLocator; |
| startDocumentSAXFunc startDocument; |
| endDocumentSAXFunc endDocument; |
| startElementSAXFunc startElement; |
| endElementSAXFunc endElement; |
| referenceSAXFunc reference; |
| charactersSAXFunc characters; |
| ignorableWhitespaceSAXFunc ignorableWhitespace; |
| processingInstructionSAXFunc processingInstruction; |
| commentSAXFunc comment; |
| warningSAXFunc warning; |
| errorSAXFunc error; |
| fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ |
| getParameterEntitySAXFunc getParameterEntity; |
| cdataBlockSAXFunc cdataBlock; |
| externalSubsetSAXFunc externalSubset; |
| unsigned int initialized; |
| /* The following fields are extensions available only on version 2 */ |
| void *_private; |
| startElementNsSAX2Func startElementNs; |
| endElementNsSAX2Func endElementNs; |
| xmlStructuredErrorFunc serror; |
| }; |
| </pre><p> |
| A SAX handler is bunch of callbacks called by the parser when processing |
| of the input generate data or structure informations.</p><p> |
| |
| </p></div><hr><div class="refsect2"><h3><a name="xmlSAXHandlerV1"></a>struct xmlSAXHandlerV1</h3><pre class="programlisting">struct xmlSAXHandlerV1 { |
| |
| internalSubsetSAXFunc internalSubset; |
| isStandaloneSAXFunc isStandalone; |
| hasInternalSubsetSAXFunc hasInternalSubset; |
| hasExternalSubsetSAXFunc hasExternalSubset; |
| resolveEntitySAXFunc resolveEntity; |
| getEntitySAXFunc getEntity; |
| entityDeclSAXFunc entityDecl; |
| notationDeclSAXFunc notationDecl; |
| attributeDeclSAXFunc attributeDecl; |
| elementDeclSAXFunc elementDecl; |
| unparsedEntityDeclSAXFunc unparsedEntityDecl; |
| setDocumentLocatorSAXFunc setDocumentLocator; |
| startDocumentSAXFunc startDocument; |
| endDocumentSAXFunc endDocument; |
| startElementSAXFunc startElement; |
| endElementSAXFunc endElement; |
| referenceSAXFunc reference; |
| charactersSAXFunc characters; |
| ignorableWhitespaceSAXFunc ignorableWhitespace; |
| processingInstructionSAXFunc processingInstruction; |
| commentSAXFunc comment; |
| warningSAXFunc warning; |
| errorSAXFunc error; |
| fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ |
| getParameterEntitySAXFunc getParameterEntity; |
| cdataBlockSAXFunc cdataBlock; |
| externalSubsetSAXFunc externalSubset; |
| unsigned int initialized; |
| }; |
| </pre><p> |
| |
| </p></div><hr><div class="refsect2"><h3><a name="xmlSAXHandlerV1Ptr"></a>xmlSAXHandlerV1Ptr</h3><pre class="programlisting">typedef xmlSAXHandlerV1 *xmlSAXHandlerV1Ptr; |
| </pre><p> |
| |
| </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) |
| (const char *URL, |
| const char *ID, |
| <a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> context);</pre><p> |
| External entity loaders types.</p><p> |
| |
| </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 |
| </td></tr><tr><td><span class="term"><i><tt>ID</tt></i>:</span></td><td> The Public ID of the resource requested |
| </td></tr><tr><td><span class="term"><i><tt>context</tt></i>:</span></td><td> the XML parser context |
| </td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>the entity input parser. |
| </td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlParserOption"></a>enum xmlParserOption</h3><pre class="programlisting">typedef enum { |
| XML_PARSE_RECOVER = 1<<0, /* recover on errors */ |
| XML_PARSE_NOENT = 1<<1, /* substitute entities */ |
| XML_PARSE_DTDLOAD = 1<<2, /* load the external subset */ |
| XML_PARSE_DTDATTR = 1<<3, /* default DTD attributes */ |
| XML_PARSE_DTDVALID = 1<<4, /* validate with the DTD */ |
| XML_PARSE_NOERROR = 1<<5, /* suppress error reports */ |
| XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */ |
| XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ |
| XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ |
| XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */ |
| XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitition */ |
| XML_PARSE_NONET = 1<<11,/* Forbid network access */ |
| XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionnary */ |
| XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */ |
| XML_PARSE_NOCDATA = 1<<14 /* merge CDATA as text nodes */ |
| } xmlParserOption; |
| </pre><p> |
| This is the set of XML parser options that can be passed down |
| to the <GTKDOCLINK HREF="xmlReadDoc">xmlReadDoc</GTKDOCLINK>() and similar calls.</p><p> |
| |
| </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> |