[cl-xmpp-devel] start-sax-document
David Lichteblau
david at lichteblau.com
Wed Apr 26 17:03:33 UTC 2006
Quoting Joel Reymont (joelr1 at gmail.com):
> Any particular reason for using DOM on top of SAX instead of just SAX?
That is a question for Erik, but I think the rationale is the other way
around:
He used DOM because he wanted to.
And the explicit mucking around with the SAX layer got introduced only
because CXML is a push-based (SAX-like) parser as opposed to pull-pased
(StAX-like). (Like all other currently available XML parsers written in
Lisp that I'm aware of.)
But since CL-XMPP wants to read from the stream (which is technically
one huge XML document) not in one step but rather stanza-by-stanza,
parsing needs to be stopped and restarted after each stanza, and that
was relatively easy to accomplish by intercepting the SAX events before
handing them to the DOM builder for the current stanza.
More information about the cl-xmpp-devel
mailing list