You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Gregor J. Rothfuss (JIRA)" <xa...@xml.apache.org> on 2005/05/25 06:05:54 UTC

[jira] Commented: (XALANJ-1978) Using StreamResult with File argument throws exception

     [ http://issues.apache.org/jira/browse/XALANJ-1978?page=comments#action_66233 ]
     
Gregor J. Rothfuss commented on XALANJ-1978:
--------------------------------------------

this bug is the only thing standing between lenya and full jdk 1.5 support. it is very important for the lenya community, and we would appreciate if this could be fixed asap. we have a lot of releases coming in the near future that we'd really like to ship jdk 1.5-enabled.

http://wiki.apache.org/lenya/ProjectReleasePlan

thanks!

> Using StreamResult with File argument throws exception
> ------------------------------------------------------
>
>          Key: XALANJ-1978
>          URL: http://issues.apache.org/jira/browse/XALANJ-1978
>      Project: XalanJ2
>         Type: Bug
>   Components: JAXP, Xalan-interpretive
>     Versions: 2.6
>  Environment: Windows 2000
> Java 1.5
>     Reporter: Thomas Mathis
>     Assignee: Henry Zongaro

>
> Source-Code:
> ============
> import java.io.*;
> import org.w3c.dom.Document;
> import javax.xml.parsers.DocumentBuilderFactory;
> import javax.xml.transform.TransformerFactory;
> import javax.xml.transform.stream.StreamResult;
> import javax.xml.transform.Source;
> import javax.xml.transform.dom.DOMSource;
> import javax.xml.transform.Result;
> import javax.xml.transform.Transformer;
> public class JDK5Test {
>     public JDK5Test() {
>     }
>     public static void main(String[] args) {
>         JDK5Test test = new JDK5Test();
>         try {
>             test.test1();
>         } catch (Exception ex) {
>             ex.printStackTrace();
>         }
>     }
>     protected void test1()
>         throws Exception
>     {
>         File destFile = new File("test.xml");
>         destFile.delete();
>         Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
>         Source source = new DOMSource( doc );
>         Result result = new StreamResult( destFile );
>         TransformerFactory tf = TransformerFactory.newInstance();
>         Transformer transformer = tf.newTransformer();
>         transformer.transform(source, result);
>         System.out.println("length=" + destFile.length() );
>         Thread.sleep(3000);
>         System.out.println("length=" + destFile.length() );
>     }
> }
> StackTrace:
> ===========
> javax.xml.transform.TransformerException: java.io.FileNotFoundException: file:\C:\JDK5Test\test.xml (Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch)
> 	at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:245)
> 	at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:278)
> 	at JDK5Test.test1(JDK5Test.java:43)
> 	at JDK5Test.main(JDK5Test.java:19)
> Caused by: java.io.FileNotFoundException: file:\E:\jbprojectX\JDK5Test\test.xml (Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch)
> 	at java.io.FileOutputStream.open(Native Method)
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
> 	at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:235)
> 	... 3 more
> ---------
> java.io.FileNotFoundException: file:\C:\JDK5Test\test.xml (Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch)
> 	at java.io.FileOutputStream.open(Native Method)
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
> 	at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:235)
> 	at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:278)
> 	at JDK5Test.test1(JDK5Test.java:43)
> 	at JDK5Test.main(JDK5Test.java:19)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org