Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4908167

Xalan extension mechanism needs to check for renamed packages

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • xml

      If an XSLT stylesheet includes an extension function or element that
      specifies the extension by the acutal name of the class used to
      implement the extension, the class will not be found on Tiger,
      because of the package renaming. For example, if the stylesheet has
      the following

        <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
           xmlns:lxslt="http://xml.apache.org/xslt"
           xmlns:redirect="org.apache.xalan.lib.Redirect"
           extension-element-prefixes="redirect"

      Xalan will fail to find org/apache/xalan/lib/Redirect. The class it
      needs to find is com/sun/org/apache/xalan/internal/lib/Redirect

      It looks like customers will have to change stylesheets that reference
      extension functions this way to point them to the renamed classes in Tiger.
      That is bound to cause some pain for our customers.

      However, the preferred way to reference an extension function/element is
      to define the appropriate namespace. For example:

         xmlns:redirect="http://xml.apache.org/xalan/redirect"

      There is no problem in that case on Tiger, since the renamed class is
      searched for automatically.

      According to Santiago Pericas-Geertsen, even if the stylesheet uses the
      bad "hard-wired" approach, we should be able to change the extension
      mechanism in Xalan to check if the URI starts with "org.apache.xalan.lib" and
      replace it by "com.sun.org.apache.xalan.internal.lib". The code that loads
      these classes is in 'org.apache.xalan.extensions.ExtensionHandlerJavaClass'.

      We need to document:
        a) The preferred way
           (xmlns:redirect=http://xml.apache.org/xalan/redirect)
           --which will work automatically

        b) The undesirable way
           (xmlns:redirect="org.apache.xalan.lib.Redirect)
           --and how that will be affected by the package name change

      It is also worth pointing out in the docs that if a user defines an extension function/element,
      its parameters will also be in the 'com.sun...' package. See Section entitled
      "Using an extension element" in

         http://xml.apache.org/xalan-j/extensions.html
                             
      ###@###.### 2003-08-18
      ###@###.### 2003-08-20</TEXTAREA>
      </td>
                          </tr>
                          <TR>
                            <TD colspan="2" bgcolor="#BFBFBF"> </td>
                          </tr>

      <a name="comments"></a>
                          <!-- COMMENTS -->
                          <TR>
                            <TD bgcolor="#BFBFBF" align="left" valign="bottom" height="24">
      <img src="/bugz/images/dot.gif" width="10">Comments
      </td>
                            <TD bgcolor="#BFBFBF" align="left" valign="bottom" height="24">
      <!-- BEGIN:TBR Mohan
        <A href="javascript:doDateStampSubmit(document.editbug_general, 'comments');"><font size="-1">[ Date Stamp ]</font></A>
      <img src="/bugz/images/dot.gif" width="18">
      END:TBR -->
      <A href="javascript:doFullPageSubmit(document.editbug_general, 'comments');"><font size="-1">[ Full Page ]</font></a>
      <img src="/bugz/images/dot.gif" width="22">
      <FONT size="-1" color="darkblue">--- Enter SUN Proprietary data here ---</font>
      </td>
                          </tr>

                          <TR>
                            <TD bgcolor="#BFBFBF" colspan="2" nowrap align="left">
      <img src="/bugz/images/dot.gif" width="5">
                              <TEXTAREA rows="6" cols="95" wrap="virtual" name="comments" align="left" bgcolor="white">As a test case if this gets fixed in Tiger, you can change the
      ResultScanner.xsl BaseScanner.xsl stylesheets used by the JAXP XSLT test suite
      to create the html report to use the hard-coded classname.
      ###@###.### 2003-08-18
      ###@###.### 2003-08-20
      ###@###.### 2003-09-02

            ayadavsunw Arun Yadav (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: