cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <>
Subject Re: Cocoon 2.0: proposed battleplan
Date Sun, 16 Apr 2000 23:26:20 GMT
On Mon, 17 Apr 2000, Paul Russell wrote:

> On Mon, Apr 17, 2000 at 12:59:25AM +0200, Stefano Mazzocchi wrote:
> > > But doing it before, the XML parser gets to do it internally. Doing it
> > > after, we have to construct the DOM from SAX events. I reckon the former
> > > would be faster... should I do some tests?
> > 
> > It seems to me Donald has a point here.
> It's possible I'm missing the point here, but it's it true that any
> parsing activity is fundamentally event based? If so, is SAX not
> close to optimal?
> I've written parsers for a number of projects in C (using yacc/bison)
> and admittedly they've always ended up OO, but I suspect XML is possibly
> the exception to this. We're talking about something that gets
> arbitarily deep very very easily, and does not suffer from the complexity
> problems that plague other language grammers.
> I don't know, I could be completely wrong, but I don't see us obtaining
> more than an extra one to two percent performance increase in not using
> SAX. Personally, I'd rather have the flexibility of working with event
> streams, if the application allows.

I think you might be missing the point - I'd prefer to use SAX
exclusively, that is the default behavior for coocon2, no questions asked.
However, when I need to apply an XPath expression to an XML document, I
must resort to DOM (right now anyway, until Xalan becomes more SAXized).
Since I must resort to DOM, I reckon it's faster for the XML parser to
hand me the DOM object itself rather than build my own DOM object from its
SAX events.

However, I just wrote code that builds the DOM from SAX events using
Pier's library code anyway so even if I can't convince Pier, no big deal.
I _am_ a little worried about doing namespace prefix mapping properly
though, must go test...

- donald

View raw message