[XML-SIG] SAX 2.0 resolution?

Ken MacLeod ken@bitsko.slc.ut.us
31 Jul 2000 16:07:56 -0500


Lars Marius Garshol <larsga@garshol.priv.no> writes:

> This is my proposal for the solution of the namespace-related SAX 2.0
> design problems.
> 
> 
> The startElement and endElement methods are split into
> startElement(name, attrs) / startElementNS(name, qname, attrs) and 
> endElement(name, attrs) / endElementNS(name, qname, attrs). 
> 
> I feel that this solution is better than the two alternatives,
> because it avoids dummy arguments, weird argument encoding and also
> because it makes the dual mode operation of SAX clearer than do the
> alternatives.  Another benefit is that it is consistent with the DOM
> and it also seems easier to explain to people.
> 
> The only disadvantages I see are that this may cost an extra method
> call per callback for some generic filters and that it does not make
> it clear that it is not allowed to mix the namespace and
> non-namespace methods in a single document.

How does this affect down-line filters?  what happens when a
non-NS-using filter precedes an NS-using filter or handler?

With the startElement(namespaceURI, localName, qName, attrs) model,
you'd expect upline filters to pass all the parameters whether or not
they themselves used it.  (And, of course, you wouldn't be expected to
mix SAX1 and SAX2 filters.)

  -- Ken