-
Sub-task
-
Resolution: Delivered
-
P4
-
17
Documentation for Implementation Specific Features and Properties has been added to the `java.xml` module summary. Along with the existing properties, two new properties are introduced in JDK 17. The following section describes the changes in more detail:
1) Added javadoc for the XML processing limits.
XML processing limits were introduced in JDK 7u45 and JDK 8. They were previously documented in the Java Tutorial <a href="https://docs.oracle.com/javase/tutorial/jaxp/limits/index.html">Processing Limits</a> section.
The definitions for these limits have been added to the `java.xml` module summary. SeeJDK-8261670.
2) Moved the javadoc for `JAXP Lookup Mechanism` to the `java.xml` module summary.
The javadoc for `JAXP Lookup Mechanism` has been moved to the module summary. The original javadoc in JAXP factories are replaced with a link to that section in the module summary.
SeeJDK-8261673.
3) Added a property to control the newline after the XML header for DOM LSSerializer.
The DOM Load and Save `LSSerializer` did not have an explicit control for whether or not the XML Declaration ends with a newline. In this release, a JDK implementation specific property, `jdk.xml.isStandalone`, and its corresponding System property, `jdk.xml.isStandalone`, have been added to control the addition of a newline and acts independently without having to set the pretty-print property. This property can be used to reverse the incompatible change introduced in Java SE 7 Update 4 with an update of Xalan 2.7.1 in which a newline is omitted after the XML header.
Usage:
// to set the property, get an instance of LSSerializer
LSSerializer ser = impl.createLSSerializer();
// the isStandalone property is effective whether or not pretty-print is set
ser.getDomConfig().setParameter("format-pretty-print", pretty ? true : false);
ser.getDomConfig().setParameter("jdk.xml.isStandalone", standalone ? true : false);
// to use the System property, set it before initializing a LSSerializer
System.setProperty("jdk.xml.isStandalone", standalone ? “true” : "false");
// to clear the property, place the line anywhere after the LSSerializer is initialized
System.clearProperty("jdk.xml.isStandalone");
SeeJDK-8249867.
4) Added a property to control the newline after the XML header for XSLTC Serializer`java.xml`.
The XSLTC Serializer supported a property, `http://www.oracle.com/xml/is-standalone`, introduced throughJDK-7150637, to control whether or not the XML Declaration ends with a newline. It is, however, not compliant with the new specification for Implementation Specific Features and Properties. In order to maintain compatibility, the legacy property is preserved, and a new property, `jdk.xml.xsltcIsStandalone`, along with its corresponding System property, `jdk.xml.xsltcIsStandalone`, have been created to perform the same function for the XSLTC Serializer as the `isStandalone` property for DOMLS LSSerializer. Note that the former has an extra prefix `xsltc` to avoid conflict with the later in case it is set through the System property.
Usage:
// to set the property, get an instance of the Transformer
Transformer transformer = getTransformer(…);
// the isStandalone property is effective whether or not pretty-print is set
transformer.setOutputProperty(OutputKeys.INDENT, pretty ? "yes" : "no");
transformer.setOutputProperty("jdk.xml.xsltcIsStandalone", standalone ? "yes" : "no");
// to use the System property, set it before initializing a Transformer
System.setProperty("jdk.xml.xsltcIsStandalone", standalone ? "yes" : "no");
// to clear the property, place the line anywhere after the Transformer is initialized
System.clearProperty("jdk.xml.xsltcIsStandalone");
SeeJDK-8260858.
5) Added existing features and properties and standardizing the prefix to `jdk.xml`.
Existing features and properties have been added to the `Implementation Specific Features and Properties` tables in the `java.xml` module summary. All of the features and properties, existing and new, now have a prefix of `jdk.xml` as redefined in the `Naming Convention` section. System properties are searchable in the Java API documentation by the full name, such as `jdk.xml.entityExpansionLimit`.
SeeJDK-8265252.
1) Added javadoc for the XML processing limits.
XML processing limits were introduced in JDK 7u45 and JDK 8. They were previously documented in the Java Tutorial <a href="https://docs.oracle.com/javase/tutorial/jaxp/limits/index.html">Processing Limits</a> section.
The definitions for these limits have been added to the `java.xml` module summary. See
2) Moved the javadoc for `JAXP Lookup Mechanism` to the `java.xml` module summary.
The javadoc for `JAXP Lookup Mechanism` has been moved to the module summary. The original javadoc in JAXP factories are replaced with a link to that section in the module summary.
See
3) Added a property to control the newline after the XML header for DOM LSSerializer.
The DOM Load and Save `LSSerializer` did not have an explicit control for whether or not the XML Declaration ends with a newline. In this release, a JDK implementation specific property, `jdk.xml.isStandalone`, and its corresponding System property, `jdk.xml.isStandalone`, have been added to control the addition of a newline and acts independently without having to set the pretty-print property. This property can be used to reverse the incompatible change introduced in Java SE 7 Update 4 with an update of Xalan 2.7.1 in which a newline is omitted after the XML header.
Usage:
// to set the property, get an instance of LSSerializer
LSSerializer ser = impl.createLSSerializer();
// the isStandalone property is effective whether or not pretty-print is set
ser.getDomConfig().setParameter("format-pretty-print", pretty ? true : false);
ser.getDomConfig().setParameter("jdk.xml.isStandalone", standalone ? true : false);
// to use the System property, set it before initializing a LSSerializer
System.setProperty("jdk.xml.isStandalone", standalone ? “true” : "false");
// to clear the property, place the line anywhere after the LSSerializer is initialized
System.clearProperty("jdk.xml.isStandalone");
See
4) Added a property to control the newline after the XML header for XSLTC Serializer`java.xml`.
The XSLTC Serializer supported a property, `http://www.oracle.com/xml/is-standalone`, introduced through
Usage:
// to set the property, get an instance of the Transformer
Transformer transformer = getTransformer(…);
// the isStandalone property is effective whether or not pretty-print is set
transformer.setOutputProperty(OutputKeys.INDENT, pretty ? "yes" : "no");
transformer.setOutputProperty("jdk.xml.xsltcIsStandalone", standalone ? "yes" : "no");
// to use the System property, set it before initializing a Transformer
System.setProperty("jdk.xml.xsltcIsStandalone", standalone ? "yes" : "no");
// to clear the property, place the line anywhere after the Transformer is initialized
System.clearProperty("jdk.xml.xsltcIsStandalone");
See
5) Added existing features and properties and standardizing the prefix to `jdk.xml`.
Existing features and properties have been added to the `Implementation Specific Features and Properties` tables in the `java.xml` module summary. All of the features and properties, existing and new, now have a prefix of `jdk.xml` as redefined in the `Naming Convention` section. System properties are searchable in the Java API documentation by the full name, such as `jdk.xml.entityExpansionLimit`.
See
- duplicates
-
JDK-8259502 Release Note: DOM LSSerializer control of newline after XML header
- Closed