-
Bug
-
Resolution: Fixed
-
P2
-
6u18
-
b01
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2207331 | 7 | Joe Wang | P2 | Closed | Fixed | b112 |
JDK-2194557 | 1.4.0 | Joe Wang | P2 | Closed | Fixed | 1.4 |
The upgrade of JAXP in JDK6u18 has introduced an XSLT regression which prevents us from building our project (OpenDS). I have managed to narrow down the problem to a simple test case which shows that in some circumstances the xsl:copy-of instruction does not fully copy the content of a variable containing attributes created using xsl:attribute instructions.
To reproduce:
Compile the attached Java program, BasicXsl.java, which I ripped from CR 6940416.
Run it as follows:
java -cp <classpath> BasicXsl test.xml output.xml test.xsl
The application should generate two identical elements as follows:
<?xml version="1.0" encoding="UTF-8"?>
<aaa name="aaa-name" package="aaa-package">
<bbb name="bbb-name">
<aaa-ref name="aaa-name" package="aaa-package"/>
</bbb>
</aaa>
<aaa name="aaa-name" package="aaa-package">
<bbb name="bbb-name">
<aaa-ref name="aaa-name" package="aaa-package"/>
</bbb>
</aaa>
This is the case for JDK6u17, Xalan-J 2.7.1, and GNOME libxslt (via xsltproc).
However with JDK6u18 and above (I have been using JDK6u20 and JDK7) the following is output:
<?xml version="1.0" encoding="UTF-8"?>
<aaa name="aaa-name" package="aaa-package">
<bbb name="bbb-name">
<aaa-ref/>
</bbb>
</aaa>
<aaa name="aaa-name" package="aaa-package">
<bbb name="bbb-name">
<aaa-ref name="aaa-name" package="aaa-package"/>
</bbb>
</aaa>
Note that the attributes are missing from the first aaa-ref element. They do not seem to be copied via the xsl:copy-of instruction.
To reproduce:
Compile the attached Java program, BasicXsl.java, which I ripped from CR 6940416.
Run it as follows:
java -cp <classpath> BasicXsl test.xml output.xml test.xsl
The application should generate two identical elements as follows:
<?xml version="1.0" encoding="UTF-8"?>
<aaa name="aaa-name" package="aaa-package">
<bbb name="bbb-name">
<aaa-ref name="aaa-name" package="aaa-package"/>
</bbb>
</aaa>
<aaa name="aaa-name" package="aaa-package">
<bbb name="bbb-name">
<aaa-ref name="aaa-name" package="aaa-package"/>
</bbb>
</aaa>
This is the case for JDK6u17, Xalan-J 2.7.1, and GNOME libxslt (via xsltproc).
However with JDK6u18 and above (I have been using JDK6u20 and JDK7) the following is output:
<?xml version="1.0" encoding="UTF-8"?>
<aaa name="aaa-name" package="aaa-package">
<bbb name="bbb-name">
<aaa-ref/>
</bbb>
</aaa>
<aaa name="aaa-name" package="aaa-package">
<bbb name="bbb-name">
<aaa-ref name="aaa-name" package="aaa-package"/>
</bbb>
</aaa>
Note that the attributes are missing from the first aaa-ref element. They do not seem to be copied via the xsl:copy-of instruction.
- backported by
-
JDK-2194557 JDK6u18 XSLT regression: xsl:copy-of failing to copy generated attributes
-
- Closed
-
-
JDK-2207331 JDK6u18 XSLT regression: xsl:copy-of failing to copy generated attributes
-
- Closed
-