As far as I can see it is possible, but deprecated, to read
environment variables from java. An environment variable to
define the parser (or the configuration file in which the
parser is named) would be the obvious and traditional
solution.
It would be possible, I think, for the user to integrate a
SAX application with a SAX parser using some kind of
javabeans mechanism, but only if he has development tools on
his machine. I'm not expert with javabeans, perhaps someone
can correct me on this. Equally, there are CORBA mechanisms
but this seems over the top.
There are actually two challenges. One is the simple one of
the application picking up the name of a parser from a
"well-known place". The other is to implement some kind of
"parser manager" akin to the ODBC Driver Manager that
provides a registry of which parsers are installed on the
machine and enables them to be selected by a short name,
etc.
I suggest, unless anyone can come up with anything better,
that in SAX 2 we provide a ParserManager class which
maintains a configuration file akin to the one in SAXON;
this class should have interfaces that:
* allow a parser to register itself, supplying both the java
class name and a "brand name" which the user will recognise
* allow the user to see which parsers are installed and
select a preferred one
* allow the application to instantiate the user's preferred
parser, or to offer a menu of choices based on the "brand
names" of the parsers that have been registered
Of course there is the dreadful prospect that more than one
implementation of ParserManager exists, in which case we
need to allow the user/application to choose which one to
use. If I go on much longer I shall reinvent the CORBA
trader.
Mike Kay