Lines Matching +full:reference +full:- +full:div +full:- +full:factor
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
6 <!--
15 Copyright (c) 2000-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
16 Copyright (c) 2002-2012 Karl Waclawek <karl@waclawek.net>
17 Copyright (c) 2017-2025 Sebastian Pipping <sebastian@pipping.org>
20 Copyright (c) 2021 Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
44 -->
47 <meta http-equiv="Content-Style-Type" content="text/css" />
52 <div>
57 </div>
58 <div class="content">
63 other open-source XML parsers.</p>
66 groff (an nroff look-alike), Jade (an implementation of ISO's DSSSL
90 <li><a href="#reference">Reference</a>
156 <a href="#attack-protection">Attack Protection</a>
197 <p>Expat is a stream-oriented parser. You register callback (or
229 href="#reference">reference</a> part of this document. The reference
269 Depth--;
324 cmake -G"Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=RelWithDebInfo .
328 contains the "expat.h" include file and a pre-built DLL.</p>
346 only one we'll mention here is the <code>--prefix</code> option. You
348 the <code>--help</code> option.</p>
353 give the option, <code>--prefix=/home/me/mystuff</code>, then the
358 <h3>Configuring Expat Using the Pre-Processor</h3>
361 pre-processor definitions. The symbols are:</p>
363 <dl class="cpp-symbols">
368 <a href="https://www.w3.org/TR/2006/REC-xml-20060816/#sec-physical-struct">general entities</a>
369 (syntax <code>&e1;</code> to reference and
384 (except the <a href="https://www.w3.org/TR/2006/REC-xml-20060816/#sec-predefined-ent">predefined five</a>:
386 with a self-reference:
392 <dd>Include support for using and reporting DTD-based content. If
406 "https://www.w3.org/TR/REC-xml-names/" >Namespaces in XML</a></cite>
411 encoded in UTF-16 using wide characters of the type
463 usually be done with the <code>-lexpat</code> argument. Otherwise,
469 <p>On a Unix-based system, here's what a Makefile might look like when
475 LIBS= -lexpat
477 $(CC) $(LDFLAGS) -o xmlapp xmlapp.o $(LIBS)
485 CFLAGS= -I/home/me/mystuff/include
487 LIBS= -L/home/me/mystuff/lib -lexpat
489 $(CC) $(LDFLAGS) -o xmlapp xmlapp.o $(LIBS)
506 constructing a parser for a top-level document. The object returned
548 info->skip = 0;
549 info->depth = 1;
557 if (! inf->skip) {
559 inf->skip = inf->depth;
565 inf->depth++;
572 inf->depth--;
574 if (! inf->skip)
577 if (inf->skip == inf->depth)
578 inf->skip = 0;
599 argument received by most handlers. In the <a href="#reference"
600 >reference section</a>, an argument to a callback function is named
612 common first-time mistake with any of the event-oriented interfaces to
621 <!-- XXX example needed here -->
627 the value of the <code>version</code> pseudo-attribute in the XML
683 are not well-formed when namespace processing is enabled, and will
689 >XML_SetReturnNSTriplet</a></code> has been called with a non-zero
715 to recognized UTF-8 and UTF-16 (1 and 2 byte encodings of Unicode),
720 <?xml version="1.0" encoding="ISO-8859-2"?>
734 <p><a name="builtin_encodings"></a>There are four built-in encodings
737 <li>UTF-8</li>
738 <li>UTF-16</li>
739 <li>ISO-8859-1</li>
740 <li>US-ASCII</li>
758 <li>Every ASCII character that can appear in a well-formed XML document
763 equal to 65535 (0xFFFF)<em>This does not apply to the built-in support
764 for UTF-16 and UTF-8</em></li>
773 array. A -1 in this array indicates a malformed byte. If the value is
774 -2, -3, or -4, then the byte is the beginning of a 2, 3, or 4 byte
775 sequence respectively. Multi-byte sequences are sent to the convert
777 function should return the Unicode scalar value for the sequence or -1
782 it passes to the handlers are always encoded in UTF-8 or UTF-16
822 entity reference handler as described above.</p>
824 <h3 id="stop-resume">Temporarily Stopping Parsing</h3>
843 if an application-domain error is found in the XML being parsed or if
855 the rough structure (in pseudo-code):</p>
880 function mentioned in the pseudo-code above:</p>
887 been an error), or the parse is stopped. Return non-zero when
931 non-zero when the parse is suspended.
951 <p>Now that we've seen what a mess the top-level parsing loop can
964 <!-- XXX really need more here -->
968 <!-- ================================================================ -->
970 <h2><a name="reference">Expat Reference</a></h2>
979 <div class="fcndef">
981 Construct a new parser. If encoding is non-<code>NULL</code>, it specifies a
983 encoding declaration. There are four built-in encodings:
986 <li>US-ASCII</li>
987 <li>UTF-8</li>
988 <li>UTF-16</li>
989 <li>ISO-8859-1</li>
994 </div>
1002 <div class="fcndef">
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
1012 the local part will be concatenated without any separator - this is intended
1014 with <a href= "#XML_SetReturnNSTriplet">namespace triplets</a>.</div>
1021 be ready to receive namespace URIs containing non-URI characters.
1038 <div class="fcndef">
1042 non-<code>NULL</code>, then namespace processing is enabled in the created parser
1045 </div>
1054 <div class="fcndef">
1062 </div>
1069 <div class="fcndef">
1072 </div>
1080 <div class="fcndef">
1085 state is re-initialized except for the values of ns and ns_triplets.
1091 </div>
1133 <div class="fcndef">
1138 that <code>s</code> doesn't have to be null-terminated. It also means that
1180 </div>
1189 <div class="fcndef">
1201 </div>
1209 <div class="fcndef">
1238 </div>
1246 <div class="fcndef">
1251 call-back handler, except when aborting (when <code>resumable</code>
1253 call-backs may still follow because they would otherwise get
1261 while making multiple call-backs on a contiguous chunk of characters,</li>
1266 call-backs, except when parsing an external parameter entity and
1287 not being handled appropriately; see <a href= "#stop-resume"
1303 external entity reference handler returns. It is up to the
1312 </div>
1319 <div class="fcndef">
1322 within a handler call-back. Returns same status codes as <code><a
1338 </div>
1359 <div class="fcndef">
1366 </div>
1385 The former implies UTF-8 encoding, the latter two imply UTF-16 encoding.
1389 <div class="handler">
1409 </div>
1411 <div class="handler">
1425 </div>
1427 <div class="handler">
1436 </div>
1438 <div class="handler">
1452 is <em>NOT null-terminated</em>. You have to use the length argument
1457 may <em>NOT immediately</em> terminate call-backs if the parser is currently
1458 processing such a single block of contiguous markup-free text, as the parser
1460 </div>
1462 <div class="handler">
1479 </div>
1481 <div class="handler">
1495 </div>
1497 <div class="handler">
1509 </div>
1511 <div class="handler">
1523 </div>
1525 <div class="handler">
1534 </div>
1536 <div class="handler">
1555 that they will be encoded in UTF-8 or UTF-16. Line boundaries are not
1566 </div>
1568 <div class="handler">
1582 internal entity references. The entity reference will not be passed
1587 </div>
1589 <div class="handler">
1604 <p>Set an external entity reference handler. This handler is also
1628 handling of the external entity reference. Returning
1634 receives the parser that encountered the entity reference. This, along
1642 </div>
1650 <div class="fcndef">
1668 </div>
1670 <div class="handler">
1685 <li>An entity reference is encountered for which no declaration
1687 <li>An internal entity reference is read, but not expanded, because
1691 <p>The <code>is_parameter_entity</code> argument will be non-zero for
1696 </div>
1698 <div class="handler">
1734 value is -1, then that byte is invalid as the initial byte in a sequence.
1735 If the value is -n, where n is an integer > 1, then n is the number of
1737 call to the function pointed at by convert. This function may return -1
1741 string s is <em>NOT</em> null-terminated and points at the sequence of
1746 </div>
1748 <div class="handler">
1765 </div>
1767 <div class="handler">
1783 </div>
1785 <div class="handler">
1794 </div>
1796 <div class="handler">
1815 contain -1, 0, or 1 indicating respectively that there was no
1818 </div>
1820 <div class="handler">
1838 will be non-zero if the DOCTYPE declaration has an internal subset.</p>
1839 </div>
1841 <div class="handler">
1854 </div>
1856 <div class="handler">
1865 </div>
1867 <div class="handler">
1939 </div>
1941 <div class="handler">
1971 <code>isrequired</code>, but they will have the non-<code>NULL</code> fixed value
1973 </div>
1975 <div class="handler">
1995 The <code>is_parameter_entity</code> argument will be non-zero in the
1999 <code>value</code> will be non-<code>NULL</code> and <code>systemId</code>,
2001 The value string is <em>not</em> null-terminated; the length is
2004 legal to have zero-length values. Instead check for whether or not
2006 argument will have a non-<code>NULL</code> value only for unparsed entity
2008 </div>
2010 <div class="handler">
2029 <div id="eg"><pre>
2031 </pre></div>
2035 </div>
2037 <div class="handler">
2053 </div>
2055 <div class="handler">
2067 This happens when there is an external subset or a reference to a
2072 </div>
2097 <div class="fcndef">
2099 </div>
2106 <div class="fcndef">
2110 </div>
2117 <div class="fcndef">
2122 </div>
2129 <div class="fcndef">
2132 </div>
2139 <div class="fcndef">
2142 </div>
2149 <div class="fcndef">
2151 <code>0</code> if the event is inside a reference to an internal
2152 entity and for the end-tag event for empty element tags (the later can
2153 be used to distinguish empty-element tags from empty elements using
2155 </div>
2164 <div class="fcndef">
2182 </div>
2184 <h3><a name="attack-protection">Attack Protection</a><a name="billion-laughs"></a></h3>
2193 <div class="fcndef">
2195 Sets the maximum tolerated amplification factor
2205 the amplification factor is calculated as ..
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>
2222 If you ever need to increase this value for non-attack payload,
2229 of factor 15,000 for the entire payload and
2230 of factor 30,000 in the middle of parsing
2237 </div>
2246 <div class="fcndef">
2258 <li>parser <code>p</code> must be a non-<code>NULL</code> root parser (without any parent parsers).</li>
2263 If you ever need to increase this value for non-attack payload,
2273 </div>
2282 <div class="fcndef">
2284 Sets the maximum tolerated amplification factor
2325 the amplification factor is calculated as ..
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>
2342 If you ever need to increase this value for non-attack payload,
2355 </div>
2364 <div class="fcndef">
2382 <li>parser <code>p</code> must be a non-<code>NULL</code> root parser (without any parent parsers).</li>
2387 If you ever need to increase this value for non-attack payload,
2390 </div>
2398 <div class="fcndef">
2411 </div>
2424 <div class="fcndef">
2432 </div>
2439 <div class="fcndef">
2442 </div>
2449 <div class="fcndef">
2454 </div>
2462 <div class="fcndef">
2467 </div>
2474 <div class="fcndef">
2476 </div>
2483 <div class="fcndef">
2493 </div>
2500 <div class="fcndef">
2503 >XML_StartElementHandler</a></code>, or -1 if there is no ID
2506 </div>
2521 <div class="fcndef">
2525 in the start-tag rather than defaulted. Each attribute/value pair counts
2528 </div>
2536 <div class="fcndef">
2538 passing a non-<code>NULL</code> encoding argument to the parser creation functions.
2544 </div>
2552 <div class="fcndef">
2565 </div>
2573 <div class="fcndef">
2579 <p><b>Note:</b> This call is optional, as the parser will auto-generate
2585 </div>
2592 <div class="fcndef">
2596 external subset in their DOCTYPE declaration, the application-provided
2599 application-provided subset will be parsed, but the
2606 <p>The application-provided external subset is read by calling the
2607 external entity reference handler set via <code><a href=
2622 the external entity reference handler returns without action.</p>
2623 </div>
2631 <div class="fcndef">
2638 non-zero, then afterwards namespace qualified names (that is qualified
2646 </div>
2653 <div class="fcndef">
2661 </div>
2668 <div class="fcndef">
2670 </div>
2684 <div class="fcndef">
2686 Some macros are also defined that support compile-time tests of the
2695 </div>
2722 <div class="fcndef">
2732 identifying the feature-test macros Expat was compiled with. Since an
2757 </div>
2764 <div class="fcndef">
2769 </div>
2773 is especially useful for third-party libraries that interact with a
2784 <div class="fcndef">
2790 </div>
2797 <div class="fcndef">
2810 </div>
2817 <div class="fcndef">
2821 </div>
2825 <div class="footer">
2828 </div>
2830 </div>