http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2394

*** shadow/2394 Fri Jun 29 04:12:54 2001
--- shadow/2394.tmp.28305       Fri Jun 29 04:12:54 2001
***************
*** 0 ****
--- 1,45 ----
+ +============================================================================+
+ | StreamResult on file:/// does not work                                     |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 2394                        Product: XalanJ2                 |
+ |       Status: NEW                         Version: 2.1.0                   |
+ |   Resolution:                            Platform: Sun                     |
+ |     Severity: Blocker                  OS/Version: Other                   |
+ |     Priority: Other                     Component: javax.xml               |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: [EMAIL PROTECTED]                                     |
+ |  Reported By: [EMAIL PROTECTED]                                                  |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ Code below fails if we call writeToFile(someDocument,"file:///<somePathAndFile>"
+  on Solaris 7, JRE 1.3.0, Xerces 1.4.0 and Xalan 2.1.0.
+ 
+ Code works fine on Windows 2000 with same combination of JRE, Xerces, Xalan. 
+ Code also works fine on Solaris with same combination of JRE, Xerces but with 
+ Xalan 2.0.1. 
+ 
+ We think the root / gets removed somewhere in the process of transformation. 
+ (Unfortunately I cannot include an exception trace at this moment.)
+ 
+ 
+       public static void writeToFile(Document document, String fileName) {
+               StreamResult streamResult = new StreamResult(new File
+ (fileName));
+               DocumentUtils.writeToStreamResult(document, streamResult);
+       }
+ 
+ 
+       public static void writeToStreamResult(Document document, StreamResult 
+ streamResult) {
+               TransformerFactory tfactory = TransformerFactory.newInstance();
+               try {
+                       Transformer serializer = tfactory.newTransformer();
+                       serializer.transform(new DOMSource(document), 
+ streamResult);
+               } catch(javax.xml.transform.TransformerException e) {
+                       e.printStackTrace();
+               }
+       }
\ No newline at end of file

Reply via email to