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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: Why SAX needs namespace support

[ Lists Home | Date Index | Thread Index ]
  • From: <david@megginson.com>
  • To: "XML Developers' List" <xml-dev@ic.ac.uk>
  • Date: Tue, 26 Jan 1999 12:06:51 -0500 (EST)

Simon St.Laurent writes:

 > I'd like to see namespace support in SAX; however, I'd prefer not
 > to implement it by piling that functionality into parsers, creating
 > yet another monolith.  While the monoliths survive, I think we can
 > do better.

Perl's motto is "there's more than one way to do it"; SAX's should be
"we'll try to let you do it any way you want."  Many XML parsers
either provide or are about to provide native namespace processing, so
it would not make sense to force namespace processing to be a separate
filter layer; other parsers probably will not provide namespace
processing natively, so it makes sense to allow namespace processing
to exist in a filter layer.

Try this on.  First, we create a new exception:

  public class SAXUnsupportedFeatureException extends SAXException

then we add some fun new methods to the extended Parser class

  public void setNamespaceProcessing (boolean flag)
    throws SAXUnsupportedFeatureException;

  public void setValidation (boolean flag)
    throws SAXUnsupportedFeatureException;

  public void setEntityExpansion (boolean flag)
    throws SAXUnsupportedFeatureException;

There is no default for any of these -- some SAX drivers may validate
or expand entities by default, while others may not -- and drivers are 
free to throw a SAXUnsupportedFeatureException for any call to any of
these.  If an application needs to be certain that it is or isn't
validating, that it is or isn't getting namespace processing, or that
it is or isn't getting external entity expansion, it has to call one
of these methods explicitly; if it doesn't care, then it can take
whatever the parser wants to give it (the status quo for SAX 1.0).


All the best,


David

-- 
David Megginson                 david@megginson.com
           http://www.megginson.com/

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