Details
Description
hi,
The behaviour of the code snippet below is different depending on whether you use XalanJ 2.7.0 or the inbuilt equivalent in Sun Java 5.
If you construct a StreamResult with a java.io.File containing spaces in the name, then a wrapped FileNotFoundException is thrown because it looks for a filename with the spaces encoded as "%20"
We hit this as part of the Eclipse CDT 4.0 project:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=194359
thanks,
Andrew
------------- Snippet
import java.io.File;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
public class Main {
public static void main(String[] args) throws Exception {
try
catch(TransformerException te) {
if(te.getMessage().indexOf("%20")!=-1)
else
{ System.out.println("Ok"); // assuming "C:/A B/" does not exist } }
}
}
Attachments
Issue Links
- blocks
-
HARMONY-4297 Tracker for https://issues.apache.org/jira/browse/XALANJ-2386
- Open