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-2024 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>
195 <p>Expat is a stream-oriented parser. You register callback (or
227 href="#reference">reference</a> part of this document. The reference
267 Depth--;
322 cmake -G"Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=RelWithDebInfo .
326 contains the "expat.h" include file and a pre-built DLL.</p>
344 only one we'll mention here is the <code>--prefix</code> option. You
346 the <code>--help</code> option.</p>
351 give the option, <code>--prefix=/home/me/mystuff</code>, then the
356 <h3>Configuring Expat Using the Pre-Processor</h3>
359 pre-processor definitions. The symbols are:</p>
361 <dl class="cpp-symbols">
366 <a href="https://www.w3.org/TR/2006/REC-xml-20060816/#sec-physical-struct">general entities</a>
367 (syntax <code>&amp;e1;</code> to reference and
382 (except the <a href="https://www.w3.org/TR/2006/REC-xml-20060816/#sec-predefined-ent">predefined five</a>:
384 with a self-reference:
390 <dd>Include support for using and reporting DTD-based content. If
404 "https://www.w3.org/TR/REC-xml-names/" >Namespaces in XML</a></cite>
409 encoded in UTF-16 using wide characters of the type
461 usually be done with the <code>-lexpat</code> argument. Otherwise,
467 <p>On a Unix-based system, here's what a Makefile might look like when
473 LIBS= -lexpat
475 $(CC) $(LDFLAGS) -o xmlapp xmlapp.o $(LIBS)
483 CFLAGS= -I/home/me/mystuff/include
485 LIBS= -L/home/me/mystuff/lib -lexpat
487 $(CC) $(LDFLAGS) -o xmlapp xmlapp.o $(LIBS)
504 constructing a parser for a top-level document. The object returned
546 info->skip = 0;
547 info->depth = 1;
555 if (! inf->skip) {
557 inf->skip = inf->depth;
563 inf->depth++;
570 inf->depth--;
572 if (! inf->skip)
575 if (inf->skip == inf->depth)
576 inf->skip = 0;
597 argument received by most handlers. In the <a href="#reference"
598 >reference section</a>, an argument to a callback function is named
610 common first-time mistake with any of the event-oriented interfaces to
619 <!-- XXX example needed here -->
625 the value of the <code>version</code> pseudo-attribute in the XML
681 are not well-formed when namespace processing is enabled, and will
687 >XML_SetReturnNSTriplet</a></code> has been called with a non-zero
713 to recognized UTF-8 and UTF-16 (1 and 2 byte encodings of Unicode),
718 &lt;?xml version="1.0" encoding="ISO-8859-2"?&gt;
732 <p><a name="builtin_encodings"></a>There are four built-in encodings
735 <li>UTF-8</li>
736 <li>UTF-16</li>
737 <li>ISO-8859-1</li>
738 <li>US-ASCII</li>
756 <li>Every ASCII character that can appear in a well-formed XML document
761 equal to 65535 (0xFFFF)<em>This does not apply to the built-in support
762 for UTF-16 and UTF-8</em></li>
771 array. A -1 in this array indicates a malformed byte. If the value is
772 -2, -3, or -4, then the byte is the beginning of a 2, 3, or 4 byte
773 sequence respectively. Multi-byte sequences are sent to the convert
775 function should return the Unicode scalar value for the sequence or -1
780 it passes to the handlers are always encoded in UTF-8 or UTF-16
820 entity reference handler as described above.</p>
822 <h3 id="stop-resume">Temporarily Stopping Parsing</h3>
841 if an application-domain error is found in the XML being parsed or if
853 the rough structure (in pseudo-code):</p>
878 function mentioned in the pseudo-code above:</p>
885 been an error), or the parse is stopped. Return non-zero when
929 non-zero when the parse is suspended.
949 <p>Now that we've seen what a mess the top-level parsing loop can
962 <!-- XXX really need more here -->
966 <!-- ================================================================ -->
968 <h2><a name="reference">Expat Reference</a></h2>
977 <div class="fcndef">
979 Construct a new parser. If encoding is non-<code>NULL</code>, it specifies a
981 encoding declaration. There are four built-in encodings:
984 <li>US-ASCII</li>
985 <li>UTF-8</li>
986 <li>UTF-16</li>
987 <li>ISO-8859-1</li>
992 </div>
1000 <div class="fcndef">
1007 in XML. For instance, <code>'\xFF'</code> is not legal in UTF-8, and
1008 <code>'\xFFFF'</code> is not legal in UTF-16. There is a special case when
1010 the local part will be concatenated without any separator - this is intended
1012 with <a href= "#XML_SetReturnNSTriplet">namespace triplets</a>.</div>
1019 be ready to receive namespace URIs containing non-URI characters.
1036 <div class="fcndef">
1040 non-<code>NULL</code>, then namespace processing is enabled in the created parser
1043 </div>
1052 <div class="fcndef">
1060 </div>
1067 <div class="fcndef">
1070 </div>
1078 <div class="fcndef">
1083 state is re-initialized except for the values of ns and ns_triplets.
1089 </div>
1131 <div class="fcndef">
1136 that <code>s</code> doesn't have to be null-terminated. It also means that
1178 </div>
1187 <div class="fcndef">
1199 </div>
1207 <div class="fcndef">
1236 </div>
1244 <div class="fcndef">
1249 call-back handler, except when aborting (when <code>resumable</code>
1251 call-backs may still follow because they would otherwise get
1259 while making multiple call-backs on a contiguous chunk of characters,</li>
1264 call-backs, except when parsing an external parameter entity and
1280 not being handled appropriately; see <a href= "#stop-resume"
1296 external entity reference handler returns. It is up to the
1305 </div>
1312 <div class="fcndef">
1315 within a handler call-back. Returns same status codes as <code><a
1331 </div>
1352 <div class="fcndef">
1359 </div>
1378 The former implies UTF-8 encoding, the latter two imply UTF-16 encoding.
1382 <div class="handler">
1402 </div>
1404 <div class="handler">
1418 </div>
1420 <div class="handler">
1429 </div>
1431 <div class="handler">
1445 is <em>NOT null-terminated</em>. You have to use the length argument
1450 may <em>NOT immediately</em> terminate call-backs if the parser is currently
1451 processing such a single block of contiguous markup-free text, as the parser
1453 </div>
1455 <div class="handler">
1472 </div>
1474 <div class="handler">
1488 </div>
1490 <div class="handler">
1502 </div>
1504 <div class="handler">
1516 </div>
1518 <div class="handler">
1527 </div>
1529 <div class="handler">
1548 that they will be encoded in UTF-8 or UTF-16. Line boundaries are not
1559 </div>
1561 <div class="handler">
1575 internal entity references. The entity reference will not be passed
1580 </div>
1582 <div class="handler">
1597 <p>Set an external entity reference handler. This handler is also
1621 handling of the external entity reference. Returning
1627 receives the parser that encountered the entity reference. This, along
1635 </div>
1643 <div class="fcndef">
1661 </div>
1663 <div class="handler">
1678 <li>An entity reference is encountered for which no declaration
1680 <li>An internal entity reference is read, but not expanded, because
1684 <p>The <code>is_parameter_entity</code> argument will be non-zero for
1689 </div>
1691 <div class="handler">
1727 value is -1, then that byte is invalid as the initial byte in a sequence.
1728 If the value is -n, where n is an integer &gt; 1, then n is the number of
1730 call to the function pointed at by convert. This function may return -1
1734 string s is <em>NOT</em> null-terminated and points at the sequence of
1739 </div>
1741 <div class="handler">
1758 </div>
1760 <div class="handler">
1776 </div>
1778 <div class="handler">
1787 </div>
1789 <div class="handler">
1808 contain -1, 0, or 1 indicating respectively that there was no
1811 </div>
1813 <div class="handler">
1831 will be non-zero if the DOCTYPE declaration has an internal subset.</p>
1832 </div>
1834 <div class="handler">
1847 </div>
1849 <div class="handler">
1858 </div>
1860 <div class="handler">
1932 </div>
1934 <div class="handler">
1964 <code>isrequired</code>, but they will have the non-<code>NULL</code> fixed value
1966 </div>
1968 <div class="handler">
1988 The <code>is_parameter_entity</code> argument will be non-zero in the
1992 <code>value</code> will be non-<code>NULL</code> and <code>systemId</code>,
1994 The value string is <em>not</em> null-terminated; the length is
1997 legal to have zero-length values. Instead check for whether or not
1999 argument will have a non-<code>NULL</code> value only for unparsed entity
2001 </div>
2003 <div class="handler">
2022 <div id="eg"><pre>
2024 </pre></div>
2028 </div>
2030 <div class="handler">
2046 </div>
2048 <div class="handler">
2060 This happens when there is an external subset or a reference to a
2065 </div>
2090 <div class="fcndef">
2092 </div>
2099 <div class="fcndef">
2103 </div>
2110 <div class="fcndef">
2115 </div>
2122 <div class="fcndef">
2125 </div>
2132 <div class="fcndef">
2135 </div>
2142 <div class="fcndef">
2144 <code>0</code> if the event is inside a reference to an internal
2145 entity and for the end-tag event for empty element tags (the later can
2146 be used to distinguish empty-element tags from empty elements using
2148 </div>
2157 <div class="fcndef">
2175 </div>
2177 <h3><a name="attack-protection">Attack Protection</a><a name="billion-laughs"></a></h3>
2186 <div class="fcndef">
2188 Sets the maximum tolerated amplification factor
2196 The amplification factor is calculated as ..
2206 <li>parser <code>p</code> must be a non-<code>NULL</code> root parser (without any parent parsers) and</li>
2207 <li><code>maximumAmplificationFactor</code> must be non-<code>NaN</code> and greater than or equal to <code>1.0</code>.</li>
2212 If you ever need to increase this value for non-attack payload,
2219 of factor 15,000 for the entire payload and
2220 of factor 30,000 in the middle of parsing
2227 </div>
2236 <div class="fcndef">
2248 <li>parser <code>p</code> must be a non-<code>NULL</code> root parser (without any parent parsers).</li>
2253 If you ever need to increase this value for non-attack payload,
2263 </div>
2271 <div class="fcndef">
2284 </div>
2297 <div class="fcndef">
2305 </div>
2312 <div class="fcndef">
2315 </div>
2322 <div class="fcndef">
2327 </div>
2335 <div class="fcndef">
2340 </div>
2347 <div class="fcndef">
2349 </div>
2356 <div class="fcndef">
2366 </div>
2373 <div class="fcndef">
2376 >XML_StartElementHandler</a></code>, or -1 if there is no ID
2379 </div>
2394 <div class="fcndef">
2398 in the start-tag rather than defaulted. Each attribute/value pair counts
2401 </div>
2409 <div class="fcndef">
2411 passing a non-<code>NULL</code> encoding argument to the parser creation functions.
2417 </div>
2425 <div class="fcndef">
2438 </div>
2446 <div class="fcndef">
2452 <p><b>Note:</b> This call is optional, as the parser will auto-generate
2458 </div>
2465 <div class="fcndef">
2469 external subset in their DOCTYPE declaration, the application-provided
2472 application-provided subset will be parsed, but the
2479 <p>The application-provided external subset is read by calling the
2480 external entity reference handler set via <code><a href=
2495 the external entity reference handler returns without action.</p>
2496 </div>
2504 <div class="fcndef">
2511 non-zero, then afterwards namespace qualified names (that is qualified
2519 </div>
2526 <div class="fcndef">
2534 </div>
2541 <div class="fcndef">
2543 </div>
2557 <div class="fcndef">
2559 Some macros are also defined that support compile-time tests of the
2568 </div>
2595 <div class="fcndef">
2605 identifying the feature-test macros Expat was compiled with. Since an
2630 </div>
2637 <div class="fcndef">
2642 </div>
2646 is especially useful for third-party libraries that interact with a
2657 <div class="fcndef">
2663 </div>
2670 <div class="fcndef">
2683 </div>
2690 <div class="fcndef">
2694 </div>
2698 <div class="footer">
2701 </div>
2703 </div>