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