[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Why SAX needs namespace support
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@m... http://www.megginson.com/ 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|