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/25 22:14:35 UTC

[Bug 1513] New - xml output with ident="yes" not being indented

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

*** shadow/1513	Wed Apr 25 13:14:35 2001
--- shadow/1513.tmp.5579	Wed Apr 25 13:14:35 2001
***************
*** 0 ****
--- 1,103 ----
+ +============================================================================+
+ | xml output with ident="yes" not being indented                             |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1513                        Product: XalanJ2                 |
+ |       Status: NEW                         Version: 2.0.0                   |
+ |   Resolution:                            Platform: Sun                     |
+ |     Severity: Normal                   OS/Version: Solaris                 |
+ |     Priority: Medium                    Component: org.apache.xalan.xsltc  |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: xalan-dev@xml.apache.org                                     |
+ |  Reported By: tamiro@east.sun.com                                          |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ [from SunMicrosystem's bug 4437714]
+ 
+ Recently, some changes to the code were made. The first prevented 
+ extra blank lines from being output by the identity transform
+ of XML to XML (copy-of). This then caused a number of tests 
+ generating html output to fail the diff test because the 
+ closing tags such as </body> and </html> were not being 
+ put on a new line. 
+ 
+ After a fix was submitted for the html output, 
+ one more problem with output formatting was encountered.
+ It seems xsltc is ignoring indent="yes" option when 
+ generating XML output. Xsltc's output when indent="yes"
+ seems to match Saxon/Xalan's output when you remove 
+ the indent="yes" setting.
+ 
+ When indent="yes" and output method="xml", a line-feed should
+ be inserted before the closing tags, as well as indenting 
+ child elements to show the nesting. 
+ 
+ Here's a test case: 
+ 
+ XML file
+ =============================
+ <?xml version="1.0" encoding="UTF-8"?>
+ <root xmlns:ped="http://ped.test.com">
+    <Out xmlns:ns0="http://www.ns0.com" ns0:Attr0="Hello" xmlns:ns1="www.ns1.com"
+ ns1:Attr1="Whatsup" ped:Attr2="Goodbye"/>
+    <Out2 xmlns:bdd="http://bdd.test.com">
+       <Out3 xmlns:jad="http://jad.test.com"/>
+    </Out2>
+ </root>
+ 
+ XSL file
+ ========
+ <?xml version="1.0"?>
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ 
+ <xsl:output indent="yes"/>
+ 
+   <!-- FileName: copy09 -->
+   <!-- Document: http://www.w3.org/TR/xslt -->
+   <!-- DocVersion: 19991116 -->
+   <!-- Section: 11.3 -->
+   <!-- Purpose: Test for xsl:copy-of with nodeset. -->                
+ 
+ <xsl:template match="/">
+   <root>
+         <xsl:apply-templates/>
+   </root>
+ </xsl:template>
+ 
+ <xsl:template match="*">
+         <xsl:copy-of select="*|@*"/>
+ </xsl:template>
+ 
+ </xsl:stylesheet>
+ 
+ Expected Output
+ ===============
+ <?xml version="1.0" encoding="utf-8"?>
+ <root>
+    <Out xmlns:ns0="http://www.ns0.com" xmlns:ns1="www.ns1.com"
+ xmlns:ped="http://ped.test.com" ns0:Attr0="Hello" ns1:Attr1="Whatsup"
+ ped:Attr2="Goodbye"/>
+    <Out2 xmlns:bdd="http://bdd.test.com" xmlns:ped="http://ped.test.com">
+       
+       <Out3 xmlns:jad="http://jad.test.com"/>
+    
+    </Out2>
+ </root> 
+ 
+ XSLTC Output
+ ============
+ <?xml version="1.0" encoding="utf-8" ?>
+ <root>
+   <Out xmlns:ns1="www.ns1.com" xmlns:ns0="http://www.ns0.com" ns0:Attr0="Hello"
+ ns1:Attr1="Whatsup" ns2:Attr2="Goodbye" xmlns:ns2="http://ped.test.com"/> 
+ <Out2>
+           <Out3/>
+      </Out2></root> 
+ 
+ Notice that the closing </root> tag is incorrectly
+ located on the same line as </Out2>. It should be 
+ on the next line, flush left. (There are other problems 
+ with missing namespace attributes, which are orthogonal to
+ the formatting issue).