Andre,
sorry but I don't see the escaping or non-escaping with your two
stylesheets and the given input XML, because your sample input XML never
has any escaping required.

With your first stylesheet and your given XML I get this output:
<<
<?xml version="1.0" encoding="UTF-8"?>
    Yes:
  Google
<hr/>
    No:
  Google
>>

For the second stylesheet I get this:
<<
<?xml version="1.0" encoding="UTF-8"?>
    No:
  Google
<hr/>
    Yes:
  Google
>>

So I don't see where there is a chance for escaping with your testcase.  So
I modified your input XML to this:
<<
<?xml version="1.0"?>
<something>
  <a href="http://www.google.com";>3 &lt; 4</a>
</something>
>>

Your first stylesheet then produced this:
<<
<?xml version="1.0" encoding="UTF-8"?>
    No:
  3 &lt; 4
<hr/>
    Yes:
  3 < 4
>>
which is right, for the 'no' case escaping is not disabled, in other words
escape, and the '<' is escaped to "&lt;", and in the second case for 'yes'
escaping is disabled and the '<' is not escaped.  When run with your second
stylesheet the output is:
<<
<?xml version="1.0" encoding="UTF-8"?>
    Yes:
  3 < 4
<hr/>
    No:
  3 &lt; 4
>>

I don't see the bug that you are referring to.




- Brian
- - - - - - - - - - - - - - - - - - - -
Brian Minchau
XSLT Development, IBM Toronto
e-mail:        [EMAIL PROTECTED]



                                                                           
             [EMAIL PROTECTED]                                             
             rb.be                                                         
                                                                        To 
             05/15/2006 07:50          xalan-j-users@xml.apache.org        
             AM                                                         cc 
                                                                           
                                                                   Subject 
                                       Is this a bug in                    
                                       disable-output-encoding?            
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hello,

I'd like to have your opinion regarding a possible bug in Xalan 2.7.0...

Here are 2 stylesheets. With the first stylesheet, output is always escaped
(it's not what I expect), while in the second case, output is escaped as I
expect it to be.

Do you know if it is normal?

Thank you!

Andre Powroznik

Stylesheet 1:
=============

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:template match="/">
    Yes: <xsl:value-of select="/something" disable-output-escaping="yes" />
    <hr />
    No: <xsl:value-of select="/something" disable-output-escaping="no" />
  </xsl:template>
</xsl:stylesheet>

Stylesheet 2:
=============

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:template match="/">
    No: <xsl:value-of select="/something" disable-output-escaping="no" />
    <hr />
    Yes: <xsl:value-of select="/something" disable-output-escaping="yes" />
</xsl:template>
</xsl:stylesheet>

The XML could be, for example:
==============================

<?xml version="1.0"?>
<something>
  <a href="http://www.google.com";>Google</a>
</something>


Reply via email to