[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

  • From: David Rosenborg <David.Rosenborg@x...>
  • To: XML Dev <xml-dev@i...>
  • Date: Thu, 13 Aug 1998 09:58:58 +0100

Re: John Cowan's view on SAX extensions for ns drafts
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@x...                       Stockholm Stock Exchange

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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.