Lines Matching full:code

62 <code>XML::Parser</code>, Python's <code>xml.parsers.expat</code>, and
211 <dt><code><a href= "#XML_ParserCreate"
212 >XML_ParserCreate</a></code></dt>
215 <dt><code><a href= "#XML_SetElementHandler"
216 >XML_SetElementHandler</a></code></dt>
219 <dt><code><a href= "#XML_SetCharacterDataHandler"
220 >XML_SetCharacterDataHandler</a></code></dt>
223 <dt><code><a href= "#XML_Parse"
224 >XML_Parse</a></code></dt>
240 information. Finally it increments the global <code>Depth</code>
265 <code>Depth</code>.</p>
273 <p>Note the <code>XMLCALL</code> annotation used for the callbacks.
276 itself and the client code are different. Expat tries not to care
279 For code which uses Expat, however, the calling convention is
280 specified by the <code>XMLCALL</code> annotation on most platforms;
283 <p>The <code>XMLCALL</code> annotation was added in Expat 1.95.7, but
322 you can use CMake to generate a <code>.sln</code> file, e.g.
323 <code>
325 </code>, and build Expat using <code>msbuild /m expat.sln</code> after.</p>
346 only one we'll mention here is the <code>--prefix</code> option. You
348 the <code>--help</code> option.</p>
351 gets installed in <code>/usr/local/lib</code> and the associated
352 header file in <code>/usr/local/include</code>. But if you were to
353 give the option, <code>--prefix=/home/me/mystuff</code>, then the
355 <code>/home/me/mystuff/lib</code> and
356 <code>/home/me/mystuff/include</code> respectively.</p>
369 (syntax <code>&amp;e1;</code> to reference and
370 syntax <code>&lt;!ENTITY e1 'value1'&gt;</code> (an internal general entity) or
371 <code>&lt;!ENTITY e2 SYSTEM 'file2'&gt;</code> (an external general entity) to declare).
372 With <code>XML_GE</code> enabled, general entities will be replaced by their declared replacement text;
374 <code><a href="#XML_SetExternalEntityRefHandler">XML_ExternalEntityRefHandler</a></code> must be set using
375 <code><a href="#XML_SetExternalEntityRefHandler">XML_SetExternalEntityRefHandler</a></code>.
376 Also, enabling <code>XML_GE</code> makes
377 the functions <code><a href="#XML_SetBillionLaughsAttackProtectionMaximumAmplification">
378 XML_SetBillionLaughsAttackProtectionMaximumAmplification</a></code> and <code>
380 XML_SetBillionLaughsAttackProtectionActivationThreshold</a></code> available.
382 With <code>XML_GE</code> disabled, Expat has a smaller memory footprint and can be faster, but will
385 <code>amp</code>, <code>apos</code>, <code>gt</code>, <code>lt</code>, <code>quot</code>)
387 for example, referencing an entity <code>e1</code> via <code>&amp;e1;</code> will be replaced
388 by text <code>&amp;e1;</code>.
398 the functions <code><a
400 XML_SetBillionLaughsAttackProtectionMaximumAmplification</a></code> and <code>
402 XML_SetBillionLaughsAttackProtectionActivationThreshold</a></code> available.</dd>
412 <code>XML_Char</code>. This is implied if
413 <code>XML_UNICODE_WCHAR_T</code> is defined.</dd>
416 <dd>If defined, causes the <code>XML_Char</code> character type to be
417 defined using the <code>wchar_t</code> type; otherwise, <code>unsigned
418 short</code> is used. Defining this implies
419 <code>XML_UNICODE</code>.</dd>
422 <dd>If defined, causes the <code>XML_Size</code> and <code>XML_Index</code>
425 <code><a href="#XML_GetCurrentByteIndex" >XML_GetCurrentByteIndex</a></code>,
426 <code><a href="#XML_GetCurrentLineNumber" >XML_GetCurrentLineNumber</a></code> and
427 <code><a href="#XML_GetCurrentColumnNumber" >XML_GetCurrentColumnNumber</a></code>
433 ensure are available for reporting via <code><a href=
434 "#XML_GetInputContext" >XML_GetInputContext</a></code>. This is
436 If this is set to zero, the input context will not be available and <code><a
437 href= "#XML_GetInputContext" >XML_GetInputContext</a></code> will
438 always report <code>NULL</code>. Without this, Expat has a smaller memory
443 statically with the code that calls it; this is required to get all
448 <dd>If defined, makes the additional function <code><a href=
449 "#XML_GetAttributeInfo" >XML_GetAttributeInfo</a></code> available
460 is to include the Expat header (<code>#include &lt;expat.h&gt;</code>)
463 usually be done with the <code>-lexpat</code> argument. Otherwise,
480 <p>If you installed Expat in, say, <code>/home/me/mystuff</code>, then
493 <code>LD_LIBRARY_PATH</code> to <code>/home/me/mystuff/lib</code> (or
494 to <code>${LD_LIBRARY_PATH}:/home/me/mystuff/lib</code> if
503 parser object. However, only two of these (<code><a href=
504 "#XML_ParserCreate" >XML_ParserCreate</a></code> and <code><a href=
505 "#XML_ParserCreateNS" >XML_ParserCreateNS</a></code>) can be used for
509 memory associated with this object you must call <code><a href=
510 "#XML_ParserFree" >XML_ParserFree</a></code>. Note that if you have
513 calling <code>XML_ParserFree</code>.</p>
586 incremented depth <em>after</em> the main body of start tag code, then
596 the shared variables. You can then tell Expat (with the <code><a href=
597 "#XML_SetUserData" >XML_SetUserData</a></code> function) to pass a
601 <code>userData</code> and have type <code>void *</code> if the user
602 data is passed; it will have the type <code>XML_Parser</code> if the
604 be retrieved using <code><a href="#XML_GetUserData"
605 >XML_GetUserData</a></code>.</p>
609 content passed to the character data handler (set by <code><a href=
611 >XML_SetCharacterDataHandler</a></code>) needs to be accumulated. A
627 the value of the <code>version</code> pseudo-attribute in the XML
631 alternate processing), it should use the <code><a href=
632 "#XML_SetXmlDeclHandler" >XML_SetXmlDeclHandler</a></code> function to
635 version number of <code>"1.0"</code> is accepted:</p>
666 <p>When the parser is created using the <code><a href=
667 "#XML_ParserCreateNS" >XML_ParserCreateNS</a></code>, function, Expat
669 consumes <code>xmlns</code> and <code>xmlns:...</code> attributes,
675 ><code>XML_SetNamespaceDeclHandler</code></a>.</p>
680 separator character (which is the 2nd argument to <code><a href=
681 "#XML_ParserCreateNS" >XML_ParserCreateNS</a></code>), and the local
688 <p>However if <code><a href= "#XML_SetReturnNSTriplet"
689 >XML_SetReturnNSTriplet</a></code> has been called with a non-zero
690 <code>do_nst</code> parameter, then the expanded form for names with
695 for the end of a scope of a declaration with the <code><a href=
696 "#XML_SetNamespaceDeclHandler" >XML_SetNamespaceDeclHandler</a></code>
702 <code>NULL</code>.
703 The URI will be <code>NULL</code> for the case where the default namespace is being
745 to the <code>UnknownEncodingHandler</code>. This handler gets passed
746 the encoding name and a pointer to an <code>XML_Encoding</code> data
748 <code>XML_STATUS_OK</code> if it knows how to deal with the
750 <code>XML_STATUS_ERROR</code>. The handler also gets passed a pointer
755 support by filling in the <code>XML_Encoding</code> structure.
769 <p><code>XML_Encoding</code> contains an array of integers that
776 function pointed at in the <code>XML_Encoding</code> structure. This
790 set no <code>ExternalEntityRefHandler</code>, then external entity
795 it is responsible for creating a subsidiary parser with <code><a href=
797 >XML_ExternalEntityParserCreate</a></code> that will do the job. This
798 returns an instance of <code>XML_Parser</code> that has handlers and
800 use <code><a href= "#XML_Parse" >XML_Parse</a></code> or <code><a
801 href= "#XML_ParseBuffer">XML_ParseBuffer</a></code> calls against this
808 you must call <code><a href= "#XML_SetParamEntityParsing"
809 >XML_SetParamEntityParsing</a></code> with one of the following
812 <dt><code>XML_PARAM_ENTITY_PARSING_NEVER</code></dt>
814 <dt><code>XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE</code></dt>
816 <code>standalone</code> was set to "yes" in the XML declaration.</dd>
817 <dt><code>XML_PARAM_ENTITY_PARSING_ALWAYS</code></dt>
855 the rough structure (in pseudo-code):</p>
879 <p>This C function could be used for the <code>parse_xml</code>
880 function mentioned in the pseudo-code above:</p>
922 <p>The corresponding <code>continue_parsing</code> function is
923 somewhat simpler, since it only need deal with the return code from
924 <code><a href= "#XML_ResumeParser">XML_ResumeParser</a></code>; it can
925 delegate the input handling to the <code>parse_xml</code>
952 become, what have we gained? Very simply, we can now use the <code><a
953 href= "#XML_StopParser" >XML_StopParser</a></code> function to stop
959 <p>To stop parsing from a handler function, use the <code><a href=
960 "#XML_StopParser" >XML_StopParser</a></code> function. This function
981 Construct a new parser. If encoding is non-<code>NULL</code>, it specifies a
1009 in XML. For instance, <code>'\xFF'</code> is not legal in UTF-8, and
1010 <code>'\xFFFF'</code> is not legal in UTF-16. There is a special case when
1011 <em>sep</em> is the null character <code>'\0'</code>: the namespace URI and
1040 specified in <code>ms</code>. If <code>ms</code> is <code>NULL</code>, then use the
1041 standard set of memory management functions. If <code>sep</code> is
1042 non-<code>NULL</code>, then namespace processing is enabled in the created parser
1055 Construct a new <code>XML_Parser</code> object for parsing an external
1082 be used again. After this has been called, <code>parser</code> is
1086 This function may not be used on a parser created using <code><a href=
1088 ></code>; it will return <code>XML_FALSE</code> in that case. Returns
1089 <code>XML_TRUE</code> on success. Your application is responsible for
1095 <p>To state the obvious: the three parsing functions <code><a href=
1096 "#XML_Parse" >XML_Parse</a></code>, <code><a href= "#XML_ParseBuffer">
1097 XML_ParseBuffer</a></code> and <code><a href= "#XML_GetBuffer">
1098 XML_GetBuffer</a></code> must not be called from within a handler
1101 functions from within an <code>XML_ExternalEntityRefHandler</code>,
1103 <code><a href= "#XML_ExternalEntityParserCreate"
1104 >XML_ExternalEntityParserCreate</a></code>.</p>
1106 <p>Note: The <code>len</code> argument passed to these functions
1115 <code><a href="#XML_Parse">XML_Parse</a></code> or
1116 <code><a href="#XML_ParseBuffer">XML_ParseBuffer</a></code> call
1117 with <code>isFinal</code> set to <code>XML_TRUE</code>.</p>
1135 Parse some more of the document. The string <code>s</code> is a buffer
1137 that are part of the document is indicated by <code>len</code>. This means
1138 that <code>s</code> doesn't have to be null-terminated. It also means that
1139 if <code>len</code> is larger than the number of bytes in the block of
1140 memory that <code>s</code> points at, then a memory fault is likely.
1141 Negative values for <code>len</code> are rejected since Expat 2.2.1.
1143 <code>isFinal</code> parameter informs the parser that this is the last
1145 <code>len</code> is zero.)
1149 If a parse error occurred, it returns <code>XML_STATUS_ERROR</code>.
1150 Otherwise it returns <code>XML_STATUS_OK</code> value.
1158 Simplified, <code>XML_Parse</code> can be considered a convenience wrapper
1160 to <code><a href="#XML_GetBuffer">XML_GetBuffer</a></code>
1161 and <code><a href="#XML_ParseBuffer">XML_ParseBuffer</a></code>
1162 (when Expat is built with macro <code>XML_CONTEXT_BYTES</code>
1164 <code>XML_Parse</code> is then functionally equivalent to calling
1165 <code><a href="#XML_GetBuffer">XML_GetBuffer</a></code>,
1166 <code>memcpy</code>, and
1167 <code><a href="#XML_ParseBuffer">XML_ParseBuffer</a></code>.
1172 <code><a href="#XML_GetBuffer">XML_GetBuffer</a></code> and
1173 <code><a href="#XML_ParseBuffer">XML_ParseBuffer</a></code> is advised
1175 if you're using <code>read</code> or similar functionality to fill your
1177 <code><a href="#XML_GetBuffer">XML_GetBuffer</a></code>,
1178 then parse with <code><a href="#XML_ParseBuffer">XML_ParseBuffer</a></code>.
1191 This is just like <code><a href= "#XML_Parse" >XML_Parse</a></code>,
1193 buffer from Expat with the <code><a href= "#XML_GetBuffer"
1194 >XML_GetBuffer</a></code> function, the application can avoid double
1199 Negative values for <code>len</code> are rejected since Expat 2.6.3.
1210 Obtain a buffer of size <code>len</code> to read a piece of the document
1211 into. A <code>NULL</code> value is returned if Expat can't allocate enough memory for
1212 this buffer. A <code>NULL</code> value may also be returned if <code>len</code> is zero.
1214 <code><a href= "#XML_ParseBuffer" >XML_ParseBuffer</a></code>. A
1248 <p>Stops parsing, causing <code><a href= "#XML_Parse"
1249 >XML_Parse</a></code> or <code><a href= "#XML_ParseBuffer"
1250 >XML_ParseBuffer</a></code> to return. Must be called from within a
1251 call-back handler, except when aborting (when <code>resumable</code>
1252 is <code>XML_FALSE</code>) an already suspended parser. Some
1267 <code>resumable</code> is <code>XML_TRUE</code>. Returns
1268 <code>XML_STATUS_OK</code> when successful,
1269 <code>XML_STATUS_ERROR</code> otherwise. The possible error codes
1272 <dt><code>XML_ERROR_NOT_STARTED</code></dt>
1277 <dt><code>XML_ERROR_SUSPENDED</code></dt>
1279 <dt><code>XML_ERROR_FINISHED</code></dt>
1281 <dt><code>XML_ERROR_SUSPEND_PE</code></dt>
1290 <p>When <code>resumable</code> is <code>XML_TRUE</code> then parsing
1291 is <em>suspended</em>, that is, <code><a href= "#XML_Parse"
1292 >XML_Parse</a></code> and <code><a href= "#XML_ParseBuffer"
1293 >XML_ParseBuffer</a></code> return <code>XML_STATUS_SUSPENDED</code>.
1294 Otherwise, parsing is <em>aborted</em>, that is, <code><a href=
1295 "#XML_Parse" >XML_Parse</a></code> and <code><a href=
1296 "#XML_ParseBuffer" >XML_ParseBuffer</a></code> return
1297 <code>XML_STATUS_ERROR</code> with error code
1298 <code>XML_ERROR_ABORTED</code>.</p>
1304 implementation of that handler to call <code><a href=
1305 "#XML_StopParser" >XML_StopParser</a></code> on the parent parser
1308 <p>When suspended, parsing can be resumed by calling <code><a href=
1309 "#XML_ResumeParser" >XML_ResumeParser</a></code>.</p>
1320 <p>Resumes parsing after it has been suspended with <code><a href=
1321 "#XML_StopParser" >XML_StopParser</a></code>. Must not be called from
1322 within a handler call-back. Returns same status codes as <code><a
1323 href= "#XML_Parse">XML_Parse</a></code> or <code><a href=
1324 "#XML_ParseBuffer" >XML_ParseBuffer</a></code>. An additional error
1325 code, <code>XML_ERROR_NOT_SUSPENDED</code>, will be returned if the
1333 and it is up to the application to call <code><a href=
1334 "#XML_ResumeParser" >XML_ResumeParser</a></code> on it at the
1362 processed. The <code>status</code> parameter <em>must not</em> be
1363 <code>NULL</code>.</p>
1374 to ignore all text not descended from a <code>para</code> element. One
1378 <p>A handler may be <em>unset</em> by providing a <code>NULL</code> pointer to the
1383 <code>XML_Char</code>. This type is conditionally defined in expat.h as
1384 either <code>char</code>, <code>wchar_t</code> or <code>unsigned short</code>.
1406 by a <code>NULL</code> pointer.</p>
1456 be split across calls to this handler. Note: Setting this handler to <code>NULL</code>
1564 <p>See also <code><a
1565 href="#XML_DefaultCurrent">XML_DefaultCurrent</a></code>.</p>
1585 <p>See also <code><a
1586 href="#XML_DefaultCurrent">XML_DefaultCurrent</a></code>.</p>
1607 <code>XML_SetParamEntityParsing</code></a>.)</p>
1609 <p>The <code>context</code> parameter specifies the parsing context in
1610 the format expected by the <code>context</code> argument to <code><a
1612 >XML_ExternalEntityParserCreate</a></code>. <code>code</code> is
1614 to be parsed later, it must be copied. <code>context</code> is <code>NULL</code>
1618 <p>The <code>base</code> parameter is the base to use for relative
1619 system identifiers. It is set by <code><a
1620 href="#XML_SetBase">XML_SetBase</a></code> and may be <code>NULL</code>. The
1621 <code>publicId</code> parameter is the public id given in the entity
1622 declaration and may be <code>NULL</code>. <code>systemId</code> is the system
1623 identifier specified in the entity declaration and is never <code>NULL</code>.</p>
1627 integer). <code>XML_STATUS_OK</code> should be returned for successful
1629 <code>XML_STATUS_ERROR</code> indicates failure, and causes the
1631 <code>XML_ERROR_EXTERNAL_ENTITY_HANDLING</code> error.</p>
1636 <code><a href= "#XML_ExternalEntityParserCreate"
1637 >XML_ExternalEntityParserCreate</a></code>. Using the returned
1652 <code>arg</code> is not <code>NULL</code>, it is the new value passed to the
1653 handler set using <code><a href="#XML_SetExternalEntityRefHandler"
1654 >XML_SetExternalEntityRefHandler</a></code>; if <code>arg</code> is
1655 <code>NULL</code>, the argument passed to the handler function will be the parser
1659 The type of <code>arg</code> and the type of the first argument to the
1661 <code>void *</code> to be passed to the handler, while the handler
1662 accepts an <code>XML_Parser</code>. This is a historical accident,
1664 causing compiler warnings for code that's known to work with this
1665 API. It is the responsibility of the application code to know the
1688 <a href="#XML_SetDefaultHandler"><code>XML_SetDefaultHandler</code></a>
1691 <p>The <code>is_parameter_entity</code> argument will be non-zero for
1721 <code><a href= "#XML_Parse" >XML_Parse</a></code> or <code><a href=
1722 "#XML_ParseBuffer" >XML_ParseBuffer</a></code> have been called on the
1724 with the given name, it should fill in the <code>info</code> data
1725 structure and return <code>XML_STATUS_OK</code>. Otherwise it
1726 should return <code>XML_STATUS_ERROR</code>. The handler will be called
1728 data pointer <code>encodingHandlerData</code> will be passed back to
1738 if the sequence itself is invalid. The convert pointer may be <code>NULL</code> if
1740 function is the data pointer from <code>XML_Encoding</code>. The
1744 <p>The function pointed at by <code>release</code> is called by the
1745 parser when it is finished with the encoding. It may be <code>NULL</code>.</p>
1812 distinguish is that the <code>version</code> parameter will be <code>NULL</code>
1813 for text declarations. The <code>encoding</code> parameter may be <code>NULL</code>
1814 for an XML declaration. The <code>standalone</code> argument will
1836 before any external or internal subset is parsed. Both <code>sysid</code>
1837 and <code>pubid</code> may be <code>NULL</code>. The <code>has_internal_subset</code>
1909 to a structure that contains the element model. It's the user code's
1910 responsibility to free model when finished with via a call to <code>
1911 <a href="#XML_FreeContentModel">XML_FreeContentModel</a></code>.
1915 <p>The <code>model</code> argument is the root of a tree of
1916 <code>XML_Content</code> nodes. If <code>type</code> equals
1917 <code>XML_CTYPE_EMPTY</code> or <code>XML_CTYPE_ANY</code>, then
1918 <code>quant</code> will be <code>XML_CQUANT_NONE</code>, and the other
1919 fields will be zero or <code>NULL</code>. If <code>type</code> is
1920 <code>XML_CTYPE_MIXED</code>, then <code>quant</code> will be
1921 <code>XML_CQUANT_NONE</code> or <code>XML_CQUANT_REP</code> and
1922 <code>numchildren</code> will contain the number of elements that are
1923 allowed to be mixed in and <code>children</code> points to an array of
1924 <code>XML_Content</code> structures that will all have type
1926 <code>XML_CTYPE_EMPTY</code>, <code>XML_CTYPE_ANY</code>, or
1927 <code>XML_CTYPE_MIXED</code>.</p>
1929 <p>For type <code>XML_CTYPE_NAME</code>, the <code>name</code> field
1930 points to the name and the <code>numchildren</code> and
1931 <code>children</code> fields will be zero and <code>NULL</code>. The
1932 <code>quant</code> field will indicate any quantifiers placed on the
1935 <p>Types <code>XML_CTYPE_CHOICE</code> and <code>XML_CTYPE_SEQ</code>
1937 <code>numchildren</code> field indicates how many nodes in the choice
1938 or sequence and <code>children</code> points to the nodes.</p>
1960 handler. The <code>elname</code> parameter returns the name of the
1962 is in the <code>attname</code> parameter. The attribute type is in the
1963 <code>att_type</code> parameter. It is the string representing the
1966 <p>The <code>dflt</code> parameter holds the default value. It will be
1967 <code>NULL</code> in the case of "#IMPLIED" or "#REQUIRED" attributes. You can
1968 distinguish these two cases by checking the <code>isrequired</code>
1971 <code>isrequired</code>, but they will have the non-<code>NULL</code> fixed value
1972 in the <code>dflt</code> parameter.</p>
1995 The <code>is_parameter_entity</code> argument will be non-zero in the
1998 <p>For internal entities (<code>&lt;!ENTITY foo "bar"&gt;</code>),
1999 <code>value</code> will be non-<code>NULL</code> and <code>systemId</code>,
2000 <code>publicId</code>, and <code>notationName</code> will all be <code>NULL</code>.
2002 provided in the <code>value_length</code> parameter. Do not use
2003 <code>value_length</code> to test for internal entities, since it is
2005 <code>value</code> is <code>NULL</code>.</p> <p>The <code>notationName</code>
2006 argument will have a non-<code>NULL</code> value only for unparsed entity
2069 declaration. If this handler returns <code>XML_STATUS_ERROR</code>,
2070 then the parser will throw an <code>XML_ERROR_NOT_STANDALONE</code>
2077 functions return <code>XML_STATUS_ERROR</code> (a parse error has
2082 the parse functions to return <code>XML_STATUS_ERROR</code>.) The
2104 XML_ErrorString(enum XML_Error code);
2107 Return a string describing the error corresponding to code.
2108 The code should be one of the enums that can be returned from
2109 <code><a href= "#XML_GetErrorCode" >XML_GetErrorCode</a></code>.
2119 the values returned by <code><a href= "#XML_GetCurrentLineNumber"
2120 >XML_GetCurrentLineNumber</a></code> and <code><a href=
2121 "#XML_GetCurrentColumnNumber" >XML_GetCurrentColumnNumber</a></code>.
2131 <code>1</code>.
2141 the position. The first column is reported as <code>0</code>.
2151 <code>0</code> if the event is inside a reference to an internal
2167 <code>offset</code> to the offset within this buffer of the current
2168 parse position, and set the integer pointed at by <code>size</code> to
2180 <p>If <code>XML_CONTEXT_BYTES</code> is zero, this will always
2181 return <code>NULL</code>.</p>
2198 (default: <code>100.0</code>)
2199 of parser <code>p</code> to <code>maximumAmplificationFactor</code>, and
2200 returns <code>XML_TRUE</code> upon success and <code>XML_FALSE</code> upon error.
2210 <code>direct</code> is the number of bytes read from the primary document in parsing and
2211 <code>indirect</code> is the number of bytes added by expanding entities and reading of external DTD files, combined.
2214 <p>For a call to <code>XML_SetBillionLaughsAttackProtectionMaximumAmplification</code> to succeed:</p>
2216 <li>parser <code>p</code> must be a non-<code>NULL</code> root parser (without any parent parsers) and</li>
2217 <li><code>maximumAmplificationFactor</code> must be non-<code>NaN</code> and greater than or equal to <code>1.0</code>.</li>
2251 (default: <code>8 MiB</code>)
2252 of parser <code>p</code> to <code>activationThresholdBytes</code>, and
2253 returns <code>XML_TRUE</code> upon success and <code>XML_FALSE</code> upon error.
2256 <p>For a call to <code>XML_SetBillionLaughsAttackProtectionActivationThreshold</code> to succeed:</p>
2258 <li>parser <code>p</code> must be a non-<code>NULL</code> root parser (without any parent parsers).</li>
2286 (default: <code>100.0</code>)
2287 of parser <code>p</code> to <code>maximumAmplificationFactor</code>, and
2288 returns <code>XML_TRUE</code> upon success and <code>XML_FALSE</code> upon error.
2298 <code><a href="#XML_MemMalloc">XML_MemMalloc</a></code>
2300 <code><a href="#XML_MemRealloc">XML_MemRealloc</a></code>
2308 <code><a href="#XML_GetBuffer">XML_GetBuffer</a></code>
2310 <code><a href="#XML_ParseBuffer">XML_ParseBuffer</a></code>
2312 <code><a href="#XML_Parse">XML_Parse</a></code>), and
2319 <code><a href="#XML_FreeContentModel">XML_FreeContentModel</a></code>).
2330 <code>direct</code> is the number of bytes read from the primary document in parsing and
2331 <code>allocated</code> is the number of bytes of dynamic memory allocated in the parser hierarchy.
2334 <p>For a call to <code>XML_SetAllocTrackerMaximumAmplification</code> to succeed:</p>
2336 <li>parser <code>p</code> must be a non-<code>NULL</code> root parser (without any parent parsers) and</li>
2337 <li><code>maximumAmplificationFactor</code> must be non-<code>NaN</code> and greater than or equal to <code>1.0</code>.</li>
2348 Amplifications factors greater than <code>100.0</code> can been observed near the start of parsing
2368 (default: <code>64 MiB</code>)
2369 of parser <code>p</code> to <code>activationThresholdBytes</code>, and
2370 returns <code>XML_TRUE</code> upon success and <code>XML_FALSE</code> upon error.
2376 <code><a href="#XML_SetAllocTrackerMaximumAmplification">XML_SetAllocTrackerMaximumAmplification</a></code>
2380 <p>For a call to <code>XML_SetAllocTrackerActivationThreshold</code> to succeed:</p>
2382 <li>parser <code>p</code> must be a non-<code>NULL</code> root parser (without any parent parsers).</li>
2406 The <code>enabled</code> argument should be <code>XML_TRUE</code> or <code>XML_FALSE</code>.
2409 Returns <code>XML_TRUE</code> on success, and <code>XML_FALSE</code> on error.
2428 <code>userData</code> when it is finished with the parser. So if you
2451 <code>userData</code> arguments. The user data can still be obtained
2452 using the <code><a href= "#XML_GetUserData"
2453 >XML_GetUserData</a></code> function.
2464 identifiers. The return value is <code>XML_STATUS_ERROR</code> if
2466 <code>XML_STATUS_OK</code>.
2489 <code>atts</code> array passed to the start tag handler of the first
2502 last call to <code><a href= "#XML_StartElementHandler"
2503 >XML_StartElementHandler</a></code>, or -1 if there is no ID
2522 Returns an array of <code>XML_AttrInfo</code> structures for the
2524 <code>XML_StartElementHandler</code> that were specified
2527 <code>XML_GetSpecifiedAttributeCount(parser) / 2</code>.
2538 passing a non-<code>NULL</code> encoding argument to the parser creation functions.
2539 It must not be called after <code><a href= "#XML_Parse"
2540 >XML_Parse</a></code> or <code><a href= "#XML_ParseBuffer"
2541 >XML_ParseBuffer</a></code> have been called on the given parser.
2542 Returns <code>XML_STATUS_OK</code> on success or
2543 <code>XML_STATUS_ERROR</code> on error.
2550 enum XML_ParamEntityParsing code);
2555 <code>code</code>.
2556 The choices for <code>code</code> are:
2558 <li><code>XML_PARAM_ENTITY_PARSING_NEVER</code></li>
2559 <li><code>XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE</code></li>
2560 <li><code>XML_PARAM_ENTITY_PARSING_ALWAYS</code></li>
2562 <b>Note:</b> If <code>XML_SetParamEntityParsing</code> is called after
2563 <code>XML_Parse</code> or <code>XML_ParseBuffer</code>, then it has
2578 after <code>XML_Parse</code> or <code>XML_ParseBuffer</code>.
2581 <p><b>Note:</b> One should not call <code>XML_SetHashSalt</code> with a
2583 that <code>XML_SetHashSalt</code> has <b>not</b> been called. Consequently
2598 declaration at all and <code>useDTD</code> is true, the
2600 <code>startDoctypeDeclHandler</code> and
2601 <code>endDoctypeDeclHandler</code> functions, if set, will not be
2603 <code><a href= "#XML_SetParamEntityParsing"
2604 >XML_SetParamEntityParsing</a></code>, will be honored.</p>
2607 external entity reference handler set via <code><a href=
2609 >XML_SetExternalEntityRefHandler</a></code> with both
2610 <code>publicId</code> and <code>systemId</code> set to <code>NULL</code>.</p>
2613 <code>XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING</code> and ignores
2614 <code>useDTD</code>. If called when Expat has been compiled without
2616 <code>XML_ERROR_FEATURE_REQUIRES_XML_DTD</code>. Otherwise, it
2617 returns <code>XML_ERROR_NONE</code>.</p>
2620 <code>useDTD == XML_TRUE</code> will make the parser behave as if
2634 <code><a href= "#XML_ParserCreateNS" >XML_ParserCreateNS</a></code>,
2635 i.e. when namespace processing is in effect. The <code>do_nst</code>
2637 namespace prefix. If this function is called with <code>do_nst</code>
2643 <code>do_nst</code> is zero, then namespaces are reported in the
2656 markup to be passed to the default handler set by <code><a
2657 href="#XML_SetDefaultHandler" >XML_SetDefaultHandler</a></code> or
2658 <code><a href="#XML_SetDefaultHandlerExpand"
2659 >XML_SetDefaultHandlerExpand</a></code>. It does nothing if there is
2669 Return the library version as a string (e.g. <code>"expat_1.95.1"</code>).
2689 <li><code>XML_MAJOR_VERSION</code></li>
2690 <li><code>XML_MINOR_VERSION</code></li>
2691 <li><code>XML_MICRO_VERSION</code></li>
2726 available from Expat. This function allows code that does need to
2729 <p>The return value is an array of <code>XML_Feature</code>,
2730 terminated by a record with a <code>feature</code> of
2731 <code>XML_FEATURE_END</code> and <code>name</code> of <code>NULL</code>,
2734 the type of character the <code>name</code> points to, records for the
2735 <code>XML_FEATURE_SIZEOF_XML_CHAR</code> and
2736 <code>XML_FEATURE_SIZEOF_XML_LCHAR</code> will be located at the
2737 beginning of the list, followed by <code>XML_FEATURE_UNICODE</code>
2738 and <code>XML_FEATURE_UNICODE_WCHAR_T</code>, if they are present at
2742 associated value, the <code>value</code> field is set to 0. At this
2746 <dt><code>XML_FEATURE_SIZEOF_XML_CHAR</code></dt>
2747 <dd>The number of bytes occupied by one <code>XML_Char</code>
2749 <dt><code>XML_FEATURE_SIZEOF_XML_LCHAR</code></dt>
2750 <dd>The number of bytes occupied by one <code>XML_LChar</code>
2752 <dt><code>XML_FEATURE_CONTEXT_BYTES</code></dt>
2754 reported by <code><a href= "#XML_GetInputContext"
2755 >XML_GetInputContext</a></code>.</dd>
2765 Function to deallocate the <code>model</code> argument passed to the
2766 <code>XML_ElementDeclHandler</code> callback set using <code><a
2767 href="#XML_SetElementDeclHandler" >XML_ElementDeclHandler</a></code>.
2771 <p>The following functions allow external code to share the memory
2772 allocator an <code>XML_Parser</code> has been configured to use. This
2774 parser object created by application code, or heavily layered
2785 Allocate <code>size</code> bytes of memory using the allocator the
2786 <code>parser</code> object has been configured to use. Returns a
2787 pointer to the memory or <code>NULL</code> on failure. Memory allocated in this
2788 way must be freed using <code><a href="#XML_MemFree"
2789 >XML_MemFree</a></code>.
2798 Allocate <code>size</code> bytes of memory using the allocator the
2799 <code>parser</code> object has been configured to use.
2800 <code>ptr</code> must point to a block of memory allocated by <code><a
2801 href="#XML_MemMalloc" >XML_MemMalloc</a></code> or
2802 <code>XML_MemRealloc</code>, or be <code>NULL</code>. This function tries to
2803 expand the block pointed to by <code>ptr</code> if possible. Returns
2804 a pointer to the memory or <code>NULL</code> on failure. On success, the original
2808 <code><a href="#XML_MemFree"
2809 >XML_MemFree</a></code>.
2818 Free a block of memory pointed to by <code>ptr</code>. The block must
2819 have been allocated by <code><a href="#XML_MemMalloc"
2820 >XML_MemMalloc</a></code> or <code>XML_MemRealloc</code>, or be <code>NULL</code>.