You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Mr.Dragomir Stanchev" <dr...@gmail.com> on 2009/01/14 11:32:57 UTC

Xalan 2.7 backward compatibility with Xalan 2.6

Hello,
Our company is currently using Xalan 2.6. However, we have found that  there
is a memory leak in the XMLReaderManager class, when the XMLReader instances
are not properly removed after the thread finishes and is garbage collected.
This issue has been known and is now fixed in Xalan 2.7.0. Therefore, we are
now analyzing whether it is suitable for us to migrate to Xalan 2.7.0. The
problem that arrises is that we do not know if there are any backward
compatibility issues between 2.7.0 and 2.6. After spending some time reading
the release notes I have found the following changes that might affect the
migration (confirm with Yes  / No if these are important changes )

1.The behavior of the default ErrorListener  was changed in this release of
Xalan-Java, in order to conform with a clarification of the required
behavior described by JAXP 1.3 ...The default ErrorListener of the old
Xalan-Java Interpretive processor throws exceptions on errors and fatal
errors. If your code expects exceptions to be thrown on errors and fatal
errors, you have to set a customized ErrorListener on TransformerFactory
and/or Transformer.
 -* Assuming that we do what is described here, is there any other parts of
the code Xalan code affected by this behaviour ? *

2. In this release of Xalan-Java the code related to serialization of output
result trees has been pulled out of xalan.jar and moved into a new jar file,
named serializer.jar.Although the code has been modified to create a
stand-alone jar, the serializer public APIs have not changed and the package
names and classnames are the same as they were last release.
*- From what I understand, there are no consequences besides adding and
additional .jar file to the build path. Is that correct ?

*3. Are there any additional major changes from 2.6 to 2.7.0 that need to be
addressed?

4. *Is there a list, containing all the bug-fixes with the appropriate
method / class signature and attribute changes? I saw the history.html file
- is this the complete list?*


Thank you in advance.

Warm Regards,
Dragomir Stanchev

Re: Xalan 2.7 backward compatibility with Xalan 2.6

Posted by Toadie <to...@gmail.com>.
We did our migration a while ago from 2.6.x to 2.7.0 and found a few issues


1. v2.7.0 had some issue with JDK 1.5 in terms of performance .  A few
JIRA issues were created and subsequently a patch was made available
by the Xalan dev team.   The same patch was rolled into 2.7.1.

2. I believe (not too sure here since it has been so long) that a few
of the interfaces in v2.6.0 were declared as public while in 2.7.0,
they were made protected/private.  This may not matter to you at all
if you don't make use of internal XALAN APIs and interfaces.  In any
case, v2.7.1 had reverted back to v2.6.0 behavior..

3. JAXP 1.3 in v2.7.0 required stricter checking on XSLT extension.
For example, as I recall, if you declare an extension-element-prefix
without an accompanying extension declaration, the XSLT will fail to
parse.

Note the line in the map below that begins with
extension-element-prefixes="counter bogusExtension"

In 2.6.0, the map parsed fine and essentialy ignored undefined prefix.
 in 2.7.0, a parsing failure occurred.  This was fairly obscure to
test because within our JUnit environment, all the JUnit XSLTs were
1.3 compliant.  However, within our user community where cut & paste
occurred quite often, there were tons of XSLTs where extraneous
element prefixes exist.   Unfortunately, the only fix was to
physically sweep through **EVERY* XSLT and detect parsing failures.
In our case, we have in excess of 2000+ XSLTs to validate.


 <?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xalan="http://xml.apache.org/xalan"
                xmlns:counter="MyCounter"
                extension-element-prefixes="counter bogusExtensionElePrefix"
                version="1.0">

  <xalan:component prefix="counter"
                   elements="init incr" functions="read">
    <xalan:script lang="javaclass" src="xalan://MyCounter"/>
  </xalan:component>

  <xsl:template match="/">
    <HTML>
      <H1>Names in alphabetical order</H1>
      <counter:init name="index" value="1"/>
      <xsl:for-each select="doc/name">
        <xsl:sort select="@last"/>
        <xsl:sort select="@first"/>
        <p>
        <xsl:text>[</xsl:text>
        <xsl:value-of select="counter:read('index')"/>
        <xsl:text>]. </xsl:text>
        <xsl:value-of select="@last"/>
        <xsl:text>, </xsl:text>
        <xsl:value-of select="@first"/>
        </p>
        <counter:incr name="index"/>
      </xsl:for-each>
    </HTML>
  </xsl:template>

</xsl:stylesheet>


Final note, if you don't have strict requirements around v2.7.0 vs
v2.7.1, v2.7.1 is your better bet.



On Wed, Jan 14, 2009 at 2:32 AM, Mr.Dragomir Stanchev
<dr...@gmail.com> wrote:
> Hello,
> Our company is currently using Xalan 2.6. However, we have found that  there
> is a memory leak in the XMLReaderManager class, when the XMLReader instances
> are not properly removed after the thread finishes and is garbage collected.
> This issue has been known and is now fixed in Xalan 2.7.0. Therefore, we are
> now analyzing whether it is suitable for us to migrate to Xalan 2.7.0. The
> problem that arrises is that we do not know if there are any backward
> compatibility issues between 2.7.0 and 2.6. After spending some time reading
> the release notes I have found the following changes that might affect the
> migration (confirm with Yes  / No if these are important changes )
>
> 1.The behavior of the default ErrorListener  was changed in this release of
> Xalan-Java, in order to conform with a clarification of the required
> behavior described by JAXP 1.3 ...The default ErrorListener of the old
> Xalan-Java Interpretive processor throws exceptions on errors and fatal
> errors. If your code expects exceptions to be thrown on errors and fatal
> errors, you have to set a customized ErrorListener on TransformerFactory
> and/or Transformer.
>  - Assuming that we do what is described here, is there any other parts of
> the code Xalan code affected by this behaviour ?
>
> 2. In this release of Xalan-Java the code related to serialization of output
> result trees has been pulled out of xalan.jar and moved into a new jar file,
> named serializer.jar.Although the code has been modified to create a
> stand-alone jar, the serializer public APIs have not changed and the package
> names and classnames are the same as they were last release.
> - From what I understand, there are no consequences besides adding and
> additional .jar file to the build path. Is that correct ?
>
> 3. Are there any additional major changes from 2.6 to 2.7.0 that need to be
> addressed?
>
> 4. Is there a list, containing all the bug-fixes with the appropriate method
> / class signature and attribute changes? I saw the history.html file - is
> this the complete list?
>
>
> Thank you in advance.
>
> Warm Regards,
> Dragomir Stanchev
>