You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by xa...@xml.apache.org on 2004/10/19 23:48:01 UTC

[jira] Closed: (XALANJ-1947) XSLTFunctions_TestIdFuncInComplexStruct

Message:

   The following issue has been closed.

   Resolver: Brian Minchau
       Date: Tue, 19 Oct 2004 2:47 PM

This bug is invalid.
The output produced by Xalan-J is:
<?xml version="1.0" encoding="UTF-8"?><out>
  Test for id selection and pattern matching...
  Next line should read: -*id17*-    
  
  -*id17*-

Numbering those lines 1 to 5 we see that line 4 was unexpected by the reporter of this bug. Although unexpected the output is correct. 

Here is where it came from,
the stylesheet has this:

  Test for id selection and pattern matching...
  Next line should read: -*id17*-    <!-- No id() either end -->
  <xsl:apply-templates select="c/b"/>

If this is interpreted as 
  1. a text node (the one running up to the start of the comment)
  2. a comment
  3. another whitespace only text node 
         (the new line just after the comment and the 
             leading spaces just before <xsl:apply-templates...>

Then one could argue that according to section 3.4 of the XSLT 1.0 recommendation that item 3. above should be stripped.

However the second paragraph under section 3. of the XSLT 1.0 recommendation says this:
>>Processing instructions and comments in the stylesheet are ignored: the stylesheet is treated as if neither processing instruction nodes nor comment nodes were included in the tree that represents the stylesheet.<<

So Xalan sees the items 1,2,3 above as just one item. When ignoring the comment it is one text node, which is composed of the characters in the first text node (item 1. above) concatenated with the characters in the other whitespace only text node (item 3. above). When viewed as this single text node it is not whitespace only and nothing is stripped.

Here is a simpler stylesheet that shows the issue:
--------------------------------------------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">



<xsl:template match="/">
<out>How many lines?<!-- a comment that should be stripped
from the stylesheet tree 
followed by whitespace that shouldn't -->
  <xsl:call-template name="tname"/></out></xsl:template>



<xsl:template name="tname">
There should be a blank line just before this one.
</xsl:template>



</xsl:stylesheet>
----------------------------------------


Xalan's output is:
--------------------------------------------
<?xml version="1.0" encoding="UTF-8"?><out>How many lines?
  
There should be a blank line just before this one.
</out>
---------------------------------------------
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XALANJ-1947

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XALANJ-1947
    Summary: XSLTFunctions_TestIdFuncInComplexStruct
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: INVALID

    Project: XalanJ2
 Components: 
             Xalan-interpretive transformation
             transformation
   Versions:
             2.6

   Assignee: 
   Reporter: elharo

    Created: Sun, 19 Sep 2004 2:47 PM
    Updated: Tue, 19 Oct 2004 2:47 PM

Description:
Xalan is failign OASIS XSLT test case XSLTFunctions_TestIdFuncInComplexStruct. libxslt2 passes this test case, and I think the test output is correct. Xalan seems to be adding extra line breaks here for unclear reasons. This test case should produce this output:

<?xml version="1.0"?>
<out>
  Test for id selection and pattern matching...
  Next line should read: -*id17*-    
  -*id17*-

  Next line should read: (*id14*)    
  (*id14*)

  Next line should read: -*id4*-     
  -*id4*-

  Next line should read: +*id9*+     
  +*id9*+

  Next line should read: (*id13*)    
  (*id13*)

  Next line should read: -*id6*-     
  -*id6*-

  Next line should read: @*id19*@    
  @*id19*@

  Next line should read: %*id12*%    
  %*id12*%

  Next line should read: !*id11*!    
  !*id11*!

  Next line should read: [*id3*] \*id5*\ =*id16*=  
  [*id3*]

  \*id5*\

  =*id16*=
</out>

However, it produces this output instead. Note the exxtra line breaks:


<?xml version="1.0"?>
<out>
  Test for id selection and pattern matching...
  Next line should read: -*id17*-    
  
  -*id17*-

  Next line should read: (*id14*)    
  
  (*id14*)

  Next line should read: -*id4*-     
  
  -*id4*-

  Next line should read: +*id9*+     
  
  +*id9*+

  Next line should read: (*id13*)    
  
  (*id13*)

  Next line should read: -*id6*-     
  
  -*id6*-

  Next line should read: @*id19*@    
  
  @*id19*@

  Next line should read: %*id12*%    
  
  %*id12*%

  Next line should read: !*id11*!    
  
  !*id11*!

  Next line should read: [*id3*] \*id5*\ =*id16*=  
  
  [*id3*]

  \*id5*\

  =*id16*=
</out>


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org