It would be useful to have a constructor in
org.xml.sax.InputSource which takes a java.io.File
argument. I guess the easiest way to implement it is
to immediately convert it into a systemId (a file:
Logged In: YES
I could see this being useful; lots of folk seem to
have problems understanding that filenames are not
the same as the fully qualified URIs that need to
be provided to SAX.
I'll call this a candidate for a SAX 2.1 release.
It's an API addition, with no complications for
backwards compatibility. I'd write it up as two
- constructor: public InputSource (java.io.File f)
- setter: public void setSystemId (java.io.File f)
Both would set the SYSTEM id to the fully qualified
file: URL for that file. Implementation would use
only JDK 1.1 methods (not File.toURL from JDK 1.2),
and specification would stipulate that the method
does not need to be provided (!) in environments
that do not support java.io.File ... some of the
smaller Java profiles (PJava and successors) don't
require that class.
Log in to post a comment.