0
通常使用时...使用jar文件xmlparserv2.jar时,如果文件路径有空格,则转换a不起作用。我怎样才能解决这个问题?
Transformer t = TransformerFactory.newInstance().newTransformer();
t.transform(source,result);
(不xmlparserv2.jar文件)的文件未发现异常看起来是这样的。
Exception in thread "main" java.io.FileNotFoundException: C:\Documents and Settings\username\nonExistentFile.xml (The system cannot find the file specified)
当包括xmlparserv2.jar,异常变成这个
Caused by: java.io.FileNotFoundException: C:\Documents%20and%20Settings\username\existingFile.xml (The system cannot find the path specified)
的文件实际上是有(变换方法找到它时,我不包括JAR),但是当我包括jar,由于为空格插入%20,转换方法无法找到它。有人能告诉我如何解决这个问题吗?