RE: adding addressing capabilities to the DOM

> > SAX events (I'm really unclear about how a query interface for SAX
would
> > work--sounds more like a filter than a query), etc.
> >
> parser.parse("/descendant::invoice/lineitem[@price > 50]");
>
> ...and the processor only calls back into your application on the
> information items that match the expression. This would greatly simplify
> processing at the application level in SAX.

In other words, yes, it is like a filter. But that's the only kind of
querying one can meaningfully apply to a stream. If you want to apply more
than one query, you need to either run through the stream again, or build a
persistant model of some sort. See the DOM FAQ's entry on tradeoffs between
DOM and SAX.

Remember, one could feed the output of a SAX query/filter into a DOM tree
builder, or the output of a DOM query into a SAX stream generator. (Modulo
any remaining impedence mismatches between the two representations.) It
doesn't necessarily have to be an either-or choice.

______________________________________
Joe Kesselman  / IBM Research

Received on Monday, 24 April 2000 12:42:23 UTC