-
Sub-task
-
Resolution: Unresolved
-
P4
-
24
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`
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`