John Cowan's view on SAX extensions for ns drafts

David Rosenborg David.Rosenborg at xsse.se
Thu Aug 13 11:01:25 BST 1998


John Cowan wrote:
> 
> David Rosenborg wrote:
> 
> > Is it really necessary for the parser to deal with namespaces at
> > all (if we don't consider namespace aware validation for the moment)?
> 
> Depends what you think "the parser" is.  My design was for something
> that a parser could implement if it wanted to, but could also be
> layered over a ns-blind parser.
> 

Yes, sorry, my question was irrelevant.

Still I think that the NamespaceResolver should not be part of
the event. One reason, as I said, is that it could easily
live as a utility on the application side and it would then
better match the other events in style. A second, and more important
reason I think, is that as it is specified now, it introduces a
new kind of state. This state is transient just as the state of
AttributeLists. The difference is that it lives beyond the
method handling the event and is terminated at some time later.
I think this adds an unnecessary complexity to SAX.

Instead you could provide a helper interface and even an
NamespaceEnabledHandlerBase that implemented that interface
together with the namespace handler interface.

Then you could write, without worrying about namespace scope
and state at all:

class Foo extends NamespaceEnabledHandlerBase
{
  public void startElement (String name, AttributeList attributes)
    throws SAXException
  {
    UniversalName uname = resolveElementName (name);
    ...
  }
}

</David>

______________________________________________________________________
David.Rosenborg at xsse.se                       Stockholm Stock Exchange

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list