[Snow-users-list] SXML/SSAX (second try)
joolean at gmail.com
Fri Jul 13 15:28:23 EDT 2007
Woah, woah, woah. Slow down. I want to be clear here -- I'm in favor
of porting Oleg Kiselyov's SSAX/SXML package
(http://okmij.org/ftp/Scheme/xml.html) to Snow. Yes, I realize XML
parsing correctness / efficiency / functionality is very important,
and that SSAX isn't going to suit the needs of every last-20-percenter
out there. But: SSAX is already a very good XML parsing package, and
it already works. I don't see any reason it doesn't belong in Snow,
especially given that it is kind of the de facto Scheme XML parsing
And it (or nearby packages) already does a lot of the last-20-percent
stuff -- to address a few of the items on Tom Lord's wish list:
* SSAX has a pretty streamy API already, and I've written a DOMish API
that goes on top of that (SDOM: http://www.nongnu.org/sdom/).
* SSAX's default namespace handling, while a little frustrating, is
* SSAX's parser is also, I believe, pretty adherent as far as
correctness goes. SDOM includes an implementation of the Load/Save
DOM recommendation (including doing pretty-prints), though it's not
quite complete yet.
* SSAX doesn't come with DTD support, but SDOM contains a partial
* There are Scheme implementations for things like XPATH and XQUERY
floating around in SSAX's orbit -- see Oleg's site for links.
* For permissive HTML parsing, there's always Neil Van Dyke's HtmlPrag
(http://www.neilvandyke.org/htmlprag/), which is SXML-compatible.
I am *way* not arguing for "custom" XML parsers or any kind of
standards shear -- those SSAX customization features I was requesting
to be present in a Snow port are already features of SSAX's
implementation. As I mentioned earlier, it's not just an XML parser,
it's also kind of an example of how to build your own parser. The
make-parser syntax, if exported, lets users (like me) implement useful
(but not technically mandated) things that are lacking in the SSAX
distribution, such as DTD parsing and more flexible namespace
management, and then plug them into SSAX's vanilla parser.
I actually think we're on the same page here -- unless you seriously
object to having SSAX as Snow's go-to XML parser. At the same time,
given that, by virtue of the nature of SSAX's codebase, any effort to
get it into Snow is going to require some decisions to be made about
what parts of it to include, I think it's worth discussing some
Furthermore, I can't speak for the Snow maintainers, but I suspect
that since XML parsing is such a core feature of a code repository
like Snow -- which is primarily useful in that it presents a closed
system of library dependencies -- that it doesn't make a whole lot of
sense to have a bunch of competing implementations in there, each
likely to have different syntax, etc.
On 7/13/07, Dominique Boucher <dominique.boucher at nuecho.com> wrote:
> Well said! And I'd go a step further: do it for a single implementation
> first (your favorite one, or Gambit-C if you don't have one ;-), with an eye
> on portability.
> Perhaps my serious suggestion is: don't worry so much. Just
> get a package out there that does any damn thing that might
> be useful and then go from there. Separate concerns: a snowball
> for XML processing that happens to have some mud in it is a
> good place to start -- then separately, start making that snowball
> really top-notch. Don't make "getting XML in Scheme perfect"
> a pre-condition for "here's a snowball for XML processors".
More information about the Snow-users-list