Re: SAX: finalising org.sax.xml.Parser

Juergen Modre (jmodre@edu.uni-klu.ac.at)
Wed, 04 Mar 1998 15:31:44 +0000


James Clark wrote:
> The following seem the reasonable combinations to me:
>
1.)
> - Validate and process all external entities (if you're validating
> you've got to process all external entities).
>
2.)
> - Don't validate and process external DTD and parameter entitities
> depending on the setting of standalone.
>
3.)
> - Don't validate and process external DTD and parameter entities
> (irrespective of the setting of standalone).
>
4.)
> - Don't validate and don't process external DTD and parameter entities
> (irrespective of the setting of standalone).

What about to have two methods
- setValidate(boolean validate)
- setStandalone(boolean standalone)
(and the corresponding getValidate, getStandalone methods as well)

Where the setStandalone _overrides_ the setting in the xml-document
itself, _if_ set.
If _not_ set
a.) standalone setting in the xml document itself
-> use this setting
b.) no standalone setting in the xml document itself
-> defaults to the default setting of
the parser (= to 'no' like 2.9 in the XML spec says).

It should be possible to achieve the same combinations as above.

This would give the following combinations for the examples above:
[Default is for an XML processor: validate=false/standalone=no]

setValidate setStandalone
1.) true setting has no effect, will always go into external DTD &
PE
2.) defaults or set to false not set -> doesn't change setting of standalone in xml doc
3.) defaults or set to false set to false -> overrides to standalone 'no'
4.) defaults or set to false set to true -> overrides to standalone 'yes'

Hope I got the table right :)

All the best
Juergen

-----------------------------------------------
JUERGEN MODRE
Reisdorf 6
A-9371 Brueckl
Austria (Europe)

Phone: ++43 4214 2320
Mobile: ++43 664 233 22 22
E-mail: jmodre@edu.uni-klu.ac.at
WWW: http://www.edu.uni-klu.ac.at/~jmodre
-----------------------------------------------