Re: [PATCH]: A couple fixes to org/xml/sax/package.html
Michael Glavassevich <[email protected]> Wed, 21 Apr 2004 11:03:48 -0400
| Newsgroups | gmane.text.xml.sax.devel |
|---|---|
| Message-ID | <OF8CD9E889.320090AF-ON85256E7D.00506A41-85256E7D.0052BE24@ca.ibm.com> |
"Karl Waclawek" <[email protected]> wrote on 04/21/2004 09:12:51 AM: > > > 2) Specify that the use-entity-resolver2 is read-write with a default > > value of true, instead of read-only with no default value. The description > > of EntityResolver2 in CVS says: "If a SAX application requires the > > customized handling which this interface defines for external entities, it > > must ensure that it uses an XMLReader with the > > http://xml.org/sax/features/use-entity-resolver2 feature flag set to true > > (which is its default value when the feature is recognized). If that flag > > is unrecognized, or its value is false, or the resolver does not implement > > this interface, then only the EntityResolver method will be used." > > Therefore this feature has a default value of true (when it is > > recognized). Since the default value is true, the value of the feature > > could only ever be false if it were read-write. Parsers which do not > > support setting this feature to false would throw a > > SAXNotSupportedException. > > Alternatively, you could fix the description of EntityResolver2 > with the attached patch and leave it read-only. It's certainly a change but I'm not sure it's a fix since it looks like it was always intended that the user have control over which resolver behaviour is used when they register an instance of EntityResolver2 with the parser. For instance, Aelfred2 [1][2] which supports SAX2 Extensions 1.1 allows the entity-resolver2 feature to be set to true and false. When set to false, this parser doesn't call any of the EntityResolver2 methods. [1] http://www.gnu.org/software/classpathx/jaxp/ [2] http://www.gnu.org/software/classpathx/jaxp/apidoc/gnu/xml/aelfred2/SAXDriver.html > Karl Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [email protected] E-mail: [email protected]