JDK-5059947 : Distributed Xalan (com.sun.org.apache.xalan.*) faulty
  • Type: Bug
  • Component: xml
  • Sub-Component: javax.xml.transform
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2004-06-08
  • Updated: 2012-04-25
  • Resolved: 2004-09-21
Description
Name: gm110360			Date: 06/08/2004


FULL PRODUCT VERSION :
jdk1.5.0 (beta2)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows 2000 [Version 5.00.2195]

EXTRA RELEVANT SYSTEM CONFIGURATION :
Nothing of interest

A DESCRIPTION OF THE PROBLEM :
Doing an XSLT transformation on a piece of XML and an XSL stylesheet that worked on 1.4 failes with the exception:

ERROR:  'Invalid conversion from 'com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl' to 'node-set'.'
javax.xml.transform.TransformerException: java.lang.RuntimeException: Invalid conversion from 'com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl' to 'node-set'.
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:604)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:277)

After downloading xalan.jar (2.6.0) from apache and putting that on the classpath everything works fine.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Do an XSLT transformation

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Generated XML
ACTUAL -
The exception stated above

ERROR MESSAGES/STACK TRACES THAT OCCUR :
ERROR:  'Invalid conversion from 'com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl' to 'node-set'.'
javax.xml.transform.TransformerException: java.lang.RuntimeException: Invalid conversion from 'com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl' to 'node-set'.
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:604)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:277)


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Add XALAN to class-path
(Incident Review ID: 276700) 
======================================================================

Comments
EVALUATION It is hard to determine if this bug if valid or not without a sample xsl/xml pair. However, it is likely to be invalid for the following reasons: 1) Conversions of Java types to XSLT types like node-set are outside the scope of the XSLT 1.0 specification. The stylesheet is most likely using extension functions. 2) Conversions in extensions functions are only supported for types implementing org.w3c.dom interfaces. The fact that this may work with Xalan DOES NOT mean it is a bug in XSLTC. These are two different processors that are only guaranteed to be compatible with respect to the XSLT 1.0 specification. Any feature outside this specification is not guaranteed to be portable across processors. ###@###.### 2004-06-08
08-06-2004