1 <documentation title="Closure XML">
2 <h1>Closure XML Parser</h1>
4 <p>An XML parser written in Common Lisp.</p>
7 Closure XML was written
8 by <a href="http://www.stud.uni-karlsruhe.de/~unk6/">Gilbert
9 Baumann</a> as part of the Closure web browser and is now
11 <a href="mailto:david@lichteblau.com">David Lichteblau</a>.
12 It is licensed under Lisp-LGPL.
17 href="http://www.w3.org/TR/REC-xml-names/">namespace-aware</a>,
19 href="http://www.w3.org/TR/2000/REC-xml-20001006">XML 1.0</a>
20 parser as well as the <a
21 href="http://www.w3.org/TR/DOM-Level-2-Core/">DOM Level 2 Core</a>
22 interfaces. Two parser interfaces are offered, one SAX-like, the
23 other similar to StAX.
27 Send bug reports to <a
28 href="mailto:cxml-devel@common-lisp.net">cxml-devel@common-lisp.net</a>
30 href="http://common-lisp.net/cgi-bin/mailman/listinfo/cxml-devel">list
34 <h3>Add-on features</h3>
36 The following libraries are available as separate downloads:
38 <ul style="list-style-type: square">
40 <a href="http://www.lichteblau.com/cxml-rng/">cxml-rng</a>:
44 <a href="http://www.lichteblau.com/cxml-stp/">cxml-stp</a>:
45 STP, an alternative to DOM
48 <a href="http://common-lisp.net/project/plexippus-xpath/">Plexippus</a>:
52 <a href="http://common-lisp.net/project/xuriella/">Xuriella</a>:
56 <a href="http://common-lisp.net/project/closure/closure-html/">Closure
58 parse HTML 4; convert between HTML and XHTML
63 <h3>Recent Changes</h3>
64 <div style="background-color: #f7f7f7;
66 border: solid #9c0000;
67 margin: 0em 2pt 1em 2em;
69 cxml and closure-common are now available from <b>git</b> instead of CVS.
70 Please refer to the <a href="installation.html#download">
71 installation instructions</a> for details.
73 <p class="nomargin"><tt>rel-2008-xx-yy</tt></p>
76 Support for user-specified output encodings
77 using <a href="http://common-lisp.net/project/babel/">Babel</a>.
80 More support for input encodings, thanks to Pierre Mai.
83 Lisps using full 21 bit code points as characters are now fully
84 supported (including SBCL and Clozure CL) addition to the
85 existing support for 16 bit characters using UTF-16 (including
86 Allegro and LispWorks). The feature <tt>rune-is-utf-16</tt> is
87 now set on 16 bit Lisps. Make sure to update and
88 recompile both cxml and closure-common when upgrading.
91 New sink slot sink-omit-xml-declaration-p; functions cxml:unescaped
95 Added XPath support to the XMLS compatibility model.
98 Fixed various DTD serialization bugs. Fixed xmls compatibility
99 bugs. Fixed variable names in with-source. Fixed klacks-error
100 export. Consistently use strings as base URIs. Fixed PARSE for
101 non-file-streams. Added support for the UTF-8 "BOM", thanks to
106 <div style="background-color: #f7f7f7;
108 border: solid #9c0000;
109 margin: 0em 2pt 1em 2em;
111 Runes have been moved into a <b>separate project</b>,
112 named <b>closure-common</b>. Releases will be available
113 as <b>separate tarballs</b> in the download directory. Please
114 refer to the <a href="installation.html#download"> installation
115 instructions</a> for details.
117 <p class="nomargin"><tt>rel-2007-10-21</tt></p>
118 <ul class="nomargin">
120 Moved runes into a separate project.
123 Incompatible SAX changes: Added new classes
124 sax:abstract-handler, sax:content-handler, sax:default-handler.
125 Implementations of SAX handlers should now subclass one of
129 fixed make-source :buffering nil, thanks to Magnus Henoch for
133 fixed time and space usage in cases where entity references
134 follow each other (thanks to Ivan Shvedunov for the report)
137 In the DOM builder, grow a buffer for string normalization
138 exponentially, fixing a long-standing speed issue.
141 <p class="nomargin"><tt>rel-2007-08-05</tt></p>
142 <ul class="nomargin">
143 <li>Various DTD serialization fixes</li>
144 <li>UTF-8 fix, thanks to Francis Leboutte</li>
146 <p class="nomargin"><tt>rel-2007-07-07</tt></p>
147 <ul class="nomargin">
149 Fixed build on non-Unicode lisps. Fixed parsing on
150 non-Unicode lisps. Fixed Unicode detection on OpenMCL.
152 <li>New function <tt>cxml:parse</tt>.</li>
153 <li>Serialization no longer defaults to canonical form.</li>
154 <li>Fixed octet array argument to make-source.</li>
156 XMLS compatibility is not <i>bug-for-bug</i>-compatible with
157 XMLS any more. There is now a mode using pairs of local name
158 and namespace URI, and a second mode using qualified names
159 only. The old behaviour using pairs of prefix and local names
160 was removed. (Thanks to Douglas Crosher.)
163 SCL support (thanks to Douglas Crosher). Includes support for
164 implementations where URIs are valid namestrings, and a mode
165 where normal streams are used instead of xstreams and ystreams
166 (albeit both SCL-specific at this point).
168 <li>new convenience serialization function cxml:doctype. Various
169 DTD serialization fixes.</li>
171 <p class="nomargin"><tt>rel-2007-05-26</tt></p>
172 <ul class="nomargin">
173 <li>cxml.asd has been split up into <tt>cxml.asd</tt> for the
174 XML parser and <tt>runes.asd</tt> for the runes package, in
175 preparation of a complete split of the two systems. Future CXML
176 releases will use separate tarballs for <tt>runes</tt>
177 and <tt>cxml</tt>.</li>
178 <li>xml:base support (SAX and Klacks only, not yet used in DOM).
179 See documentation <a href="sax.html#saxparser">here</a> and <a
180 href="klacks.html#locator">here</a>.</li>
181 <li>New class <tt>broadcast-handler</tt> as a generalization
182 of the older <tt>sax-proxy</tt>.</li>
183 <li>New class <tt>tapping-source</tt>, a klacks source that
184 relays events from an upstream klacks source unchanged, while also
185 emitting them as SAX events to a user-specified handler at the
187 <li>Changed attributes to carry an lname even when occurring
188 without a namespace. Added new functions attribute*,
189 unparse-attribute, and macro with-element*, with-namespace* to
190 the SAX generation wrapper API.</li>
191 <li>Klacks improvements: Incompatibly changed
192 klacks:find-element and find-event to consider the current event
193 as a result. Added klacks-error, klacks:expect, klacks:skip,
194 klacks:expecting-element. Fixed serialize-event to generate
195 start-prefix-mapping and end-prefix-mapping events. New function
196 map-current-namespace-declarations.</li>
197 <li>fixed build with common-lisp-controller</li>
199 <p class="nomargin"><tt>rel-2007-02-18</tt></p>
200 <ul class="nomargin">
201 <li>New StAX-like parser interface.</li>
202 <li>Serialization fixes (thanks to Nathan Bird, Donavon Keithley).</li>
203 <li>characters.lisp cleanup (thanks to Nathan Bird).</li>
204 <li>Namespace normalizer bugfixes.</li>
205 <li>Minor changes: clone-node on document as an extension. DOM
206 class hierarchy reworked. New function parse-empty-document.
207 Fixed the DOM serializer to not throw away local names.
208 Fixed a long-standing bug in the parser for documents without a
209 doctype. ANSI conformance fixes.</li>
211 <p class="nomargin"><tt>rel-2006-01-05</tt></p>
212 <ul class="nomargin">
213 <li>Implemented DOM 2 Core.</li>
214 <li>Error handling overhaul.</li>
215 <li>UTF-8 string support in DOM on Lisps without Unicode characters.</li>
216 <li>Sink API has been changed.</li>
217 <li>Support internal subset serialization.</li>
218 <li>Whitespace normalizer.</li>
219 <li>Gilbert Baumann has clarified the license as Lisp-LGPL.</li>
220 <li>Use trivial-gray-streams.</li>
222 <p class="nomargin"><tt>rel-2005-06-25</tt></p>
223 <ul class="nomargin">
224 <li>Port to OpenMCL (thanks to Rudi Schlatte).</li>
225 <li>Port to LispWorks (thanks to Edi Weitz).</li>
226 <li>Minor new features: <tt>include-default-values</tt> argument to
227 <tt>make-xmls-builder</tt>; <tt>handler</tt> argument
228 to <tt>parse-dtd-stream</tt>; SAX proxy class</li>
229 <li>Various bugfixes.</li>
231 <p class="nomargin"><tt>patch-357</tt> (2004-10-10)</p>
232 <ul class="nomargin">
233 <li>Auto-detect unicode support for better asdf-installability.</li>
234 <li>Use the puri library for Sys-ID handling.</li>
235 <li>Semi-automatic caching of DTD instances.</li>
236 <li>Support user-defined entity resolvers.</li>
237 <li>Support for Oasis XML Catalogs.</li>
238 <li>xhtmlgen version of Franz htmlgen.</li>
239 <li>Fixes for SBCL's unicode support.</li>
241 <p class="nomargin"><tt>patch-306</tt> (2004-09-03)</p>
242 <ul class="nomargin">
243 <li>Event-based serialization which does not require DOM documents</li>
244 <li>XMLS compatiblity</li>
245 <li>minor bugfixes (thread safety; should work on clisp again)</li>
247 <p class="nomargin"><tt>patch-279</tt> (2004-05-11)</p>
248 <ul class="nomargin">
250 <li>bugfixes; XHTML DTD parses again; corrected SAX entity handling</li>
252 <p class="nomargin"><tt>patch-204</tt></p>
253 <ul class="nomargin">
254 <li>Renamed package <tt>XML</tt> to <tt>CXML</tt>.</li>
255 <li>The unparse functions support non-canonical output now.</li>
257 <p class="nomargin"><tt>patch-191</tt> (2004-03-18)</p>
258 <ul class="nomargin">
259 <li>Initial release.</li>