File expatfaq.html of Package expat
101
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
2
"http://www.w3.org/TR/REC-html40/loose.dtd">
3
4
<!--
5
Note for SuSE package maintainers: this file was taken
6
verbatim from http://www.jclark.com/xml/expatfaq.html
7
and has since has obsolete information removed.
8
-->
9
10
<HTML>
11
12
<TITLE>expat FAQ</TITLE>
13
14
<BODY>
15
16
<H1>Frequently Asked Questions about Expat</H1>
17
18
<H4>Where can I get help in using expat?</H4>
19
20
<p>Try the xml-dev mailing list (subscribe by mailing to <a
21
href="mailto:majordomo@xml.org&BODY=subscribe%20xml-dev">majordomo@xml.org</a>
22
with the message <code>subscribe xml-dev</code>). Alternatively try
23
the mailing lists hosted by <A
24
href="http://expat.sourceforge.net">sourceforge.net</A>.</P>
25
26
<H4>Where is expat's API documented?</H4>
27
28
<p>In <code>xmlparse/xmlparse.h</code>. There's also an advanced,
29
low-level API you can use which is documented in
30
<code>xmltok/xmltok.h</code>.</p>
31
32
<p>There's also an excellent <a
33
href="http://www.xml.com/pub/1999/09/expat/index.html">article</a>
34
about expat on XML.com by Clark Cooper.</p>
35
36
<H4>Is there a simple example of using expat's API?</H4>
37
38
<p>See <code>sample/elements.c</code></p>
39
40
<H4>How can I get expat to deal with non-ASCII characters?</H4>
41
42
<P>By default, expat assumes that documents are encoded in UTF-8. In
43
UTF-8, ASCII characters are represented by a single byte as they would
44
be in ASCII, but non-ASCII characters are represented by a sequence of
45
two or more bytes all with the 8th bit set. The encoding most widely
46
used for European languages is ISO 8859-1 which is not compatible with
47
UTF-8. To use this encoding, expat must be told either by supplying
48
an argument of <code>"iso-8859-1"</code> to
49
<code>XML_ParserCreate</code>, or by starting the document with
50
<code><?xml version="1.0" encoding="iso-8859-1"?></code>.</P>
51
52
<H4>What encodings does expat support?</H4>
53
54
<P>expat has built in support for the following encodings:</P>
55
56
<ul>
57
<li><code>utf-8</code></li>
58
<li><code>utf-16</code></li>
59
<li><code>iso-8859-1</code></li>
60
<li><code>us-ascii</code></li>
61
</ul>
62
63
<P>Additional encodings can be supported by using
64
<code>XML_SetUnknownEncodingHandler</code>.</P>
65
66
<H4>How can I get expat to validate my XML documents?</H4>
67
68
<p>You can't. expat is not a validating parser.</p>
69
70
<H4>How can I get expat to read my DTD?</H4>
71
72
<p>Compile with <code>-DXML_DTD</code> and call
73
<code>XML_SetParamEntityParsing</code>.</p>
74
75
<H4>How can I get expat to recover from errors?</H4>
76
77
<p>You can't. All well-formedness errors stop processing. Note that
78
the XML Recommendation does not permit conforming XML processors to
79
continue normal processing after a fatal error.</p>
80
81
<H4>How do I get at the characters between tags?</H4>
82
83
<p>Use <code>XML_SetCharacterDataHandler</code>.</p>
84
85
<H4>How can I minimize the size of expat?</H4>
86
87
<p>Compile with <code>-DXML_MIN_SIZE</code>. With Visual C++, use the
88
<code>Win32 MinSize</code> configuration: this creates an
89
<code>xmlparse.dll</code> that does not require
90
<code>xmltok.dll</code>.</p>
91
92
<ADDRESS>
93
94
<A HREF="mailto:jjc@jclark.com">James Clark</A>
95
96
</ADDRESS>
97
98
</BODY>
99
100
</HTML>
101