JDK-8343024 : Release Note: Adjust XSLT and XPath Extension Function Property
  • Type: Sub-task
  • Component: xml
  • Sub-Component: jaxp
  • Affected Version: 24
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • Submitted: 2024-10-24
  • Updated: 2024-10-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24Unresolved
Description
The default value of the property for XSLT and XPath Extension Functions, `jdk.xml.enableExtensionFunctions`, has been changed from true to false, which disables Extension Functions.

If an application handles XML transformation with a stylesheet that uses Extension Functions, it may encounter processing error such as the follows:

    Use of the extension function '[function name]' is not allowed when extension functions are disabled
    by the secure processing feature or the property 'jdk.xml.enableExtensionFunctions'. To enable extension
    functions, set 'jdk.xml.enableExtensionFunctions' to 'true'.

For applications that require extension functions, the solution is to set the property `jdk.xml.enableExtensionFunctions` to true. This can be done via the Transform API, e.g.

            transformerFactory = TransformerFactory.newInstance();
            transformerFactory.setFeature("jdk.xml.enableExtensionFunctions", true);

Or in the JAXP Configuration File. A [template for creating Strict JAXP Configuration File](https://bugs.openjdk.org/browse/JDK-8330605), jaxp-strict.properties.template, was provided in JDK 23 for developers to assess and prepare for this type of changes. To set the property, copy the template and create a custom configuration file:

    cp $JAVA_HOME/conf/jaxp-strict.properties.template. /<my_path>/jaxp-strict.properties

Edit and change the setting as follows:

    jdk.xml.enableExtensionFunctions=true

Furthermore, as a system property, the property can also be set on the commandline, e.g.:

    java -Djdk.xml.enableExtensionFunctions=true myApp`