Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8261856 Documenting the implementation specific features and properties
  3. JDK-8261861

Release Note: XML Implementation Specific Features and Properties

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • 17
    • 17
    • docs

      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. See JDK-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.

         See JDK-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");

         See JDK-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 through JDK-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");

         See JDK-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`.

         See JDK-8265252.

            joehw Joe Wang
            joehw Joe Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: