OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: John Cowan's view on SAX extensions for ns drafts

[ Lists Home | Date Index | Thread Index ]
  • From: David Rosenborg <David.Rosenborg@xsse.se>
  • To: XML Dev <xml-dev@ic.ac.uk>
  • Date: Thu, 13 Aug 1998 09:58:58 +0100

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.Rosenborg@xsse.se                       Stockholm Stock Exchange

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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS