PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL BE LOST SOMEWHERE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2818 *** shadow/2818 Wed Jul 25 22:51:13 2001 --- shadow/2818.tmp.11114 Wed Jul 25 22:51:13 2001 *************** *** 0 **** --- 1,49 ---- + +============================================================================+ + | Transformation of DOMSource not working. | + +----------------------------------------------------------------------------+ + | Bug #: 2818 Product: XalanJ2 | + | Status: UNCONFIRMED Version: 2.2.x | + | Resolution: Platform: PC | + | Severity: Major OS/Version: Windows NT/2K | + | Priority: Other Component: org.apache.xalan.transf | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + Hi, + I have encountered a problem with Xalan. (2.2D6, 2.2D7, and also 2.1.0) .I am + constructing a DOM document in my code and passing it to the transformer as a + DOMSource object. However, I get a blank output. When I serialize the Document + and read it back in as a StreamSource it works fine. + + Here is the code + + //Does not work + + Writer outputWriter = resp.getWriter(); //resp is an HttpServletResponse object + Document xmlRes = (Document) getXMLNode(); //gets a org.w3c.dom.Document object + xmlTransformer.transform( new DOMSource(xmlRes.getDocumentElement()), + new javax.xml.transform.stream.StreamResult + (outputWriter)); + + + //However, this works fine + + org.apache.xml.serialize.XMLSerializer outXml = new + org.apache.xml.serialize.XMLSerializer(new java.io.FileOutputStream + ("test.xml"), null); + + outXml.serialize(xmlRes.getDocumentElement()); + + xmlTransformer.transform( new javax.xml.transform.stream.StreamSource(new + java.io.File("test.xml")), + new javax.xml.transform.stream.StreamResult + (outputWriter) ); + + I have not found anything in the docs to cause this behaviour, + Thanks, + Shourya
