On Wed, 2 Jun 2021 18:17:43 GMT, Joe Wang <jo...@openjdk.org> wrote: > Special characters are different in File and URI. Treat File input as File > using FileInputStream instead of converting to an URI, but fall back to URI > in case of error for compatibility (in error handling).
I tried, but getRawPath returned output/%23/dom.xml, that in turn resulted in java.io.FileNotFoundException later. For StreamResult, when a String-form systemId is in File protocol, a FileOutputStream will eventually get created. Since StreamResult accepts OutputStream, there's no need for the File -> URI -> <file protocal> systemId -> URL -> File conversion (as did in TransformerImpl). I think it's better to create a FileOutputStream right from the File input. ------------- PR: https://git.openjdk.java.net/jdk/pull/4318