You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/04/20 20:54:53 UTC

[Bug 1437] New - disable-output-escaping generates in output.

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

*** shadow/1437	Fri Apr 20 11:54:53 2001
--- shadow/1437.tmp.8467	Fri Apr 20 11:54:53 2001
***************
*** 0 ****
--- 1,66 ----
+ +============================================================================+
+ | disable-output-escaping generates <?javax.xml.transform.disable-output-esc |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1437                        Product: XalanJ2                 |
+ |       Status: NEW                         Version: 2.0.1                   |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version:                         |
+ |     Priority: High                      Component: Xalan                   |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: xalan-dev@xml.apache.org                                     |
+ |  Reported By: cao@ispsoft.com                                              |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ This xsl file generates different output when using 
+ SAXResult/StreamResult/DOMResult individually. Basically only StreamResult 
+ generates the expected result. When I'm using the command line tool to do 
+ transformation, it works fine. I guess it's because the 
+ org.apache.xalan.xslt.Process is using StreamResult too. With 
+ SAXResult/DOMResult,  two PIs (<?javax.xml.transform.disable-output-escaping ?
+ ><?javax.xml.transform.enable-output-escaping ?>) are inserted. Perhaps it's 
+ just caused by some work not finished yet. Any ideas?
+ 
+ ---------------- test.xml -------------------
+ <root/>
+ 
+ ---------------- test.xsl --------------------
+ <?xml version="1.0"?>
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ 
+ <xsl:template match="/">
+ <a>
+   <xsl:value-of disable-output-escaping="yes" select="'&lt;![CDATA['"/>
+   <b/>
+   <xsl:value-of disable-output-escaping="yes" select="']]&gt;'"/>
+ </a>
+ </xsl:template>
+ </xsl:stylesheet>
+ 
+ ---------------- MinimalTransformationTest.java ----------------
+ import java.io.*;
+ import javax.xml.transform.*;
+ import javax.xml.transform.dom.*;
+ import org.apache.xalan.transformer.TransformerImpl;
+ import javax.xml.transform.stream.*;
+ import org.apache.xerces.dom.*;
+ import org.w3c.dom.*;
+ 
+ public class MinimalTransformationTest
+ {
+   public static void main(String[] args)
+   {
+       try{
+       TransformerFactory tFactory = TransformerFactory.newInstance();
+       Templates templates = tFactory.newTemplates(new StreamSource(args[0]));
+       Transformer transformer = templates.newTransformer();
+       Document result = new DocumentImpl();
+       transformer.transform(new StreamSource(args[1]), new DOMResult(result));
+       // output result.
+       } catch (Exception e){
+           e.printStackTrace();
+       }
+   }
+ }