Namespace Prefix Issue in XML to XSL Transformation

Hempushpa Sahu Hempushpa.Sahu at ibm.com
Tue Aug 27 05:28:32 UTC 2024


Problem Description :
XSLT transformation creating unique namespace prefixes.

Analysis & Observation :
When upgrading from Java 8 to Java 17, the XSLT transformation is generating a new namespace prefix for every XML element, even when the namespace value matches that of the parent element. This leads to large XML file transformations exceeding the file size and memory limits on our systems.

The behaviour in OpenJDK has remained consistent since JDK 8; however, the namespace prefix issue is not something we find acceptable.

Our investigation into the OpenJDK code led us to defect https://bugs.openjdk.org/browse/JDK-8167179, which addressed the namespace prefix issue in the OpenJDK 8 release. Despite this, we are still able to reproduce the issue in OpenJDK versions 8, 11, 17, and 22.


Releases:
OpenJDK 8, 11, 17 & 22 the issue is seen.

Next steps:
Please review and suggest if the above understanding is right. And please suggest solution to resolve the issue.

NOTE:
Please find the attachment with below files-
XML file - sourceFile.xml
XSL file - ie_si_to_spe.xsl
Current output - sourceFile-test-transform.xml
Expected output - sourceFile-expected-transform.xml

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20240827/8d2e2297/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TransformationIssue_Data.zip
Type: application/x-zip-compressed
Size: 2296 bytes
Desc: TransformationIssue_Data.zip
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20240827/8d2e2297/TransformationIssue_Data-0001.zip>


More information about the core-libs-dev mailing list