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 Lisps using full 21 bit code points as characters are now fully
81 supported (including SBCL and Clozure CL) addition to the
82 existing support for 16 bit characters using UTF-16 (including
83 Allegro and LispWorks). The feature <tt>rune-is-utf-16</tt> is
84 now set on 16 bit Lisps. Make sure to update and
85 recompile both cxml and closure-common when upgrading.
88 New sink slot sink-omit-xml-declaration-p; functions cxml:unescaped
92 Added XPath support to the XMLS compatibility model.
95 Fixed various DTD serialization bugs. Fixed xmls compatibility
96 bugs. Fixed variable names in with-source. Fixed klacks-error
97 export. Consistently use strings as base URIs. Fixed PARSE for
98 non-file-streams. Added support for the UTF-8 "BOM", thanks to
103 <div style="background-color: #f7f7f7;
105 border: solid #9c0000;
106 margin: 0em 2pt 1em 2em;
108 Runes have been moved into a <b>separate project</b>,
109 named <b>closure-common</b>. Releases will be available
110 as <b>separate tarballs</b> in the download directory. Please
111 refer to the <a href="installation.html#download"> installation
112 instructions</a> for details.
114 <p class="nomargin"><tt>rel-2007-10-21</tt></p>
115 <ul class="nomargin">
117 Moved runes into a separate project.
120 Incompatible SAX changes: Added new classes
121 sax:abstract-handler, sax:content-handler, sax:default-handler.
122 Implementations of SAX handlers should now subclass one of
126 fixed make-source :buffering nil, thanks to Magnus Henoch for
130 fixed time and space usage in cases where entity references
131 follow each other (thanks to Ivan Shvedunov for the report)
134 In the DOM builder, grow a buffer for string normalization
135 exponentially, fixing a long-standing speed issue.
138 <p class="nomargin"><tt>rel-2007-08-05</tt></p>
139 <ul class="nomargin">
140 <li>Various DTD serialization fixes</li>
141 <li>UTF-8 fix, thanks to Francis Leboutte</li>
143 <p class="nomargin"><tt>rel-2007-07-07</tt></p>
144 <ul class="nomargin">
146 Fixed build on non-Unicode lisps. Fixed parsing on
147 non-Unicode lisps. Fixed Unicode detection on OpenMCL.
149 <li>New function <tt>cxml:parse</tt>.</li>
150 <li>Serialization no longer defaults to canonical form.</li>
151 <li>Fixed octet array argument to make-source.</li>
153 XMLS compatibility is not <i>bug-for-bug</i>-compatible with
154 XMLS any more. There is now a mode using pairs of local name
155 and namespace URI, and a second mode using qualified names
156 only. The old behaviour using pairs of prefix and local names
157 was removed. (Thanks to Douglas Crosher.)
160 SCL support (thanks to Douglas Crosher). Includes support for
161 implementations where URIs are valid namestrings, and a mode
162 where normal streams are used instead of xstreams and ystreams
163 (albeit both SCL-specific at this point).
165 <li>new convenience serialization function cxml:doctype. Various
166 DTD serialization fixes.</li>
168 <p class="nomargin"><tt>rel-2007-05-26</tt></p>
169 <ul class="nomargin">
170 <li>cxml.asd has been split up into <tt>cxml.asd</tt> for the
171 XML parser and <tt>runes.asd</tt> for the runes package, in
172 preparation of a complete split of the two systems. Future CXML
173 releases will use separate tarballs for <tt>runes</tt>
174 and <tt>cxml</tt>.</li>
175 <li>xml:base support (SAX and Klacks only, not yet used in DOM).
176 See documentation <a href="sax.html#saxparser">here</a> and <a
177 href="klacks.html#locator">here</a>.</li>
178 <li>New class <tt>broadcast-handler</tt> as a generalization
179 of the older <tt>sax-proxy</tt>.</li>
180 <li>New class <tt>tapping-source</tt>, a klacks source that
181 relays events from an upstream klacks source unchanged, while also
182 emitting them as SAX events to a user-specified handler at the
184 <li>Changed attributes to carry an lname even when occurring
185 without a namespace. Added new functions attribute*,
186 unparse-attribute, and macro with-element*, with-namespace* to
187 the SAX generation wrapper API.</li>
188 <li>Klacks improvements: Incompatibly changed
189 klacks:find-element and find-event to consider the current event
190 as a result. Added klacks-error, klacks:expect, klacks:skip,
191 klacks:expecting-element. Fixed serialize-event to generate
192 start-prefix-mapping and end-prefix-mapping events. New function
193 map-current-namespace-declarations.</li>
194 <li>fixed build with common-lisp-controller</li>
196 <p class="nomargin"><tt>rel-2007-02-18</tt></p>
197 <ul class="nomargin">
198 <li>New StAX-like parser interface.</li>
199 <li>Serialization fixes (thanks to Nathan Bird, Donavon Keithley).</li>
200 <li>characters.lisp cleanup (thanks to Nathan Bird).</li>
201 <li>Namespace normalizer bugfixes.</li>
202 <li>Minor changes: clone-node on document as an extension. DOM
203 class hierarchy reworked. New function parse-empty-document.
204 Fixed the DOM serializer to not throw away local names.
205 Fixed a long-standing bug in the parser for documents without a
206 doctype. ANSI conformance fixes.</li>
208 <p class="nomargin"><tt>rel-2006-01-05</tt></p>
209 <ul class="nomargin">
210 <li>Implemented DOM 2 Core.</li>
211 <li>Error handling overhaul.</li>
212 <li>UTF-8 string support in DOM on Lisps without Unicode characters.</li>
213 <li>Sink API has been changed.</li>
214 <li>Support internal subset serialization.</li>
215 <li>Whitespace normalizer.</li>
216 <li>Gilbert Baumann has clarified the license as Lisp-LGPL.</li>
217 <li>Use trivial-gray-streams.</li>
219 <p class="nomargin"><tt>rel-2005-06-25</tt></p>
220 <ul class="nomargin">
221 <li>Port to OpenMCL (thanks to Rudi Schlatte).</li>
222 <li>Port to LispWorks (thanks to Edi Weitz).</li>
223 <li>Minor new features: <tt>include-default-values</tt> argument to
224 <tt>make-xmls-builder</tt>; <tt>handler</tt> argument
225 to <tt>parse-dtd-stream</tt>; SAX proxy class</li>
226 <li>Various bugfixes.</li>
228 <p class="nomargin"><tt>patch-357</tt> (2004-10-10)</p>
229 <ul class="nomargin">
230 <li>Auto-detect unicode support for better asdf-installability.</li>
231 <li>Use the puri library for Sys-ID handling.</li>
232 <li>Semi-automatic caching of DTD instances.</li>
233 <li>Support user-defined entity resolvers.</li>
234 <li>Support for Oasis XML Catalogs.</li>
235 <li>xhtmlgen version of Franz htmlgen.</li>
236 <li>Fixes for SBCL's unicode support.</li>
238 <p class="nomargin"><tt>patch-306</tt> (2004-09-03)</p>
239 <ul class="nomargin">
240 <li>Event-based serialization which does not require DOM documents</li>
241 <li>XMLS compatiblity</li>
242 <li>minor bugfixes (thread safety; should work on clisp again)</li>
244 <p class="nomargin"><tt>patch-279</tt> (2004-05-11)</p>
245 <ul class="nomargin">
247 <li>bugfixes; XHTML DTD parses again; corrected SAX entity handling</li>
249 <p class="nomargin"><tt>patch-204</tt></p>
250 <ul class="nomargin">
251 <li>Renamed package <tt>XML</tt> to <tt>CXML</tt>.</li>
252 <li>The unparse functions support non-canonical output now.</li>
254 <p class="nomargin"><tt>patch-191</tt> (2004-03-18)</p>
255 <ul class="nomargin">
256 <li>Initial release.</li>