Return-Path: X-Original-To: apmail-xalan-dev-archive@www.apache.org Delivered-To: apmail-xalan-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DB9C3DF7A for ; Fri, 2 Nov 2012 16:41:12 +0000 (UTC) Received: (qmail 14899 invoked by uid 500); 2 Nov 2012 16:41:12 -0000 Delivered-To: apmail-xalan-dev-archive@xalan.apache.org Received: (qmail 14839 invoked by uid 500); 2 Nov 2012 16:41:12 -0000 Mailing-List: contact dev-help@xalan.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@xalan.apache.org Delivered-To: mailing list dev@xalan.apache.org Received: (qmail 14759 invoked by uid 99); 2 Nov 2012 16:41:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2012 16:41:12 +0000 Date: Fri, 2 Nov 2012 16:41:12 +0000 (UTC) From: "Chris Wolf (JIRA)" To: dev@xalan.apache.org Message-ID: <256461819.61011.1351874472591.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (XALANJ-361) Transformation of DOMSource not working. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/XALANJ-361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13489527#comment-13489527 ] Chris Wolf commented on XALANJ-361: ----------------------------------- I would say this is a bug because when javax.xml.tranform.Transformer.transform is called with javax.xml.transform.stream.StreamSource, then namespace aware is set true, but if it's called with javax.xml.transform.dom.DOMSource, then namespace aware is not set true. I would advise changing com.sun.org.apache.xalan.internal.xsltc.compiler.Parser.parse(XMLReader reader, InputSource input) to call XMLReader.seFeature("http://xml.org/sax/features/namespace", true) such that it is consistent with com.sun.org.apache.xalan.internal.xsltc.compiler.Parser.parse(InputSource) which already sets namespace awareness to true. I also filed a bug with Oracle/Sun for this issue. > Transformation of DOMSource not working. > ---------------------------------------- > > Key: XALANJ-361 > URL: https://issues.apache.org/jira/browse/XALANJ-361 > Project: XalanJ2 > Issue Type: Bug > Security Level: No security risk; visible to anyone(Ordinary problems in Xalan projects. Anybody can view the issue.) > Components: transformation, Xalan-interpretive > Affects Versions: 2.2.x > Environment: Operating System: Windows NT/2K > Platform: PC > Reporter: Shourya Shukla > Attachments: ASF.LICENSE.NOT.GRANTED--TestServlet.java, ASF.LICENSE.NOT.GRANTED--wizard3.xsl > > > 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 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@xalan.apache.org For additional commands, e-mail: dev-help@xalan.apache.org