Closure XML Parser
An XML parser written in Common Lisp.
Closure XML was written
Baumann as part of the Closure web browser and is now
It is licensed under Lisp-LGPL.
CXML implements a namespace-aware,
validating XML 1.0
parser as well as the DOM Level 2 Core
interfaces. Two parser interfaces are offered, one SAX-like, the
other similar to StAX.
Send bug reports to firstname.lastname@example.org
The following libraries are available as separate downloads:
cxml and closure-common are now available from git
instead of CVS.
Please refer to the
Support for user-specified output encodings
More support for input encodings, thanks to Pierre Mai.
Lisps using full 21 bit code points as characters are now fully
supported (including SBCL and Clozure CL) addition to the
existing support for 16 bit characters using UTF-16 (including
Allegro and LispWorks). The feature rune-is-utf-16 is
now set on 16 bit Lisps. Make sure to update and
recompile both cxml and closure-common when upgrading.
New sink slot sink-omit-xml-declaration-p; functions cxml:unescaped
Added XPath support to the XMLS compatibility model.
Fixed various DTD serialization bugs. Fixed xmls compatibility
bugs. Fixed variable names in with-source. Fixed klacks-error
export. Consistently use strings as base URIs. Fixed PARSE for
non-file-streams. Added support for the UTF-8 "BOM", thanks to
Runes have been moved into a separate project
. Releases will be available
as separate tarballs
in the download directory. Please
refer to the installation
Moved runes into a separate project.
Incompatible SAX changes: Added new classes
sax:abstract-handler, sax:content-handler, sax:default-handler.
Implementations of SAX handlers should now subclass one of
fixed make-source :buffering nil, thanks to Magnus Henoch for
fixed time and space usage in cases where entity references
follow each other (thanks to Ivan Shvedunov for the report)
In the DOM builder, grow a buffer for string normalization
exponentially, fixing a long-standing speed issue.
- Various DTD serialization fixes
- UTF-8 fix, thanks to Francis Leboutte
Fixed build on non-Unicode lisps. Fixed parsing on
non-Unicode lisps. Fixed Unicode detection on OpenMCL.
- New function cxml:parse.
- Serialization no longer defaults to canonical form.
- Fixed octet array argument to make-source.
XMLS compatibility is not bug-for-bug-compatible with
XMLS any more. There is now a mode using pairs of local name
and namespace URI, and a second mode using qualified names
only. The old behaviour using pairs of prefix and local names
was removed. (Thanks to Douglas Crosher.)
SCL support (thanks to Douglas Crosher). Includes support for
implementations where URIs are valid namestrings, and a mode
where normal streams are used instead of xstreams and ystreams
(albeit both SCL-specific at this point).
- new convenience serialization function cxml:doctype. Various
DTD serialization fixes.
- cxml.asd has been split up into cxml.asd for the
XML parser and runes.asd for the runes package, in
preparation of a complete split of the two systems. Future CXML
releases will use separate tarballs for runes
- xml:base support (SAX and Klacks only, not yet used in DOM).
See documentation here and here.
- New class broadcast-handler as a generalization
of the older sax-proxy.
- New class tapping-source, a klacks source that
relays events from an upstream klacks source unchanged, while also
emitting them as SAX events to a user-specified handler at the
- Changed attributes to carry an lname even when occurring
without a namespace. Added new functions attribute*,
unparse-attribute, and macro with-element*, with-namespace* to
the SAX generation wrapper API.
- Klacks improvements: Incompatibly changed
klacks:find-element and find-event to consider the current event
as a result. Added klacks-error, klacks:expect, klacks:skip,
klacks:expecting-element. Fixed serialize-event to generate
start-prefix-mapping and end-prefix-mapping events. New function
- fixed build with common-lisp-controller
- New StAX-like parser interface.
- Serialization fixes (thanks to Nathan Bird, Donavon Keithley).
- characters.lisp cleanup (thanks to Nathan Bird).
- Namespace normalizer bugfixes.
- Minor changes: clone-node on document as an extension. DOM
class hierarchy reworked. New function parse-empty-document.
Fixed the DOM serializer to not throw away local names.
Fixed a long-standing bug in the parser for documents without a
doctype. ANSI conformance fixes.
- Implemented DOM 2 Core.
- Error handling overhaul.
- UTF-8 string support in DOM on Lisps without Unicode characters.
- Sink API has been changed.
- Support internal subset serialization.
- Whitespace normalizer.
- Gilbert Baumann has clarified the license as Lisp-LGPL.
- Use trivial-gray-streams.
- Port to OpenMCL (thanks to Rudi Schlatte).
- Port to LispWorks (thanks to Edi Weitz).
- Minor new features: include-default-values argument to
make-xmls-builder; handler argument
to parse-dtd-stream; SAX proxy class
- Various bugfixes.
- Auto-detect unicode support for better asdf-installability.
- Use the puri library for Sys-ID handling.
- Semi-automatic caching of DTD instances.
- Support user-defined entity resolvers.
- Support for Oasis XML Catalogs.
- xhtmlgen version of Franz htmlgen.
- Fixes for SBCL's unicode support.
- Event-based serialization which does not require DOM documents
- XMLS compatiblity
- minor bugfixes (thread safety; should work on clisp again)
- bugfixes; XHTML DTD parses again; corrected SAX entity handling
- Renamed package XML to CXML.
- The unparse functions support non-canonical output now.