JDK-8261012 : Implementation specific property xsltcIsStandalone for XSLTC Serializer
  • Type: CSR
  • Component: xml
  • Sub-Component: jaxp
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 17
  • Submitted: 2021-02-03
  • Updated: 2021-02-19
  • Resolved: 2021-02-19
Related Reports
CSR :  
Description
Summary
-------

Adds an implementation-specific property `http://www.oracle.com/xml/jaxp/properties/xsltcIsStandalone` to be supported by the XSLTC Serializer.

Problem
-------

The legacy property http://www.oracle.com/xml/is-standalone for the XSLTC Serializer, introduced through JDK-7150637, does not comply with the new specification for Implementation-specific Features and Properties. In addition, it was intended to perform similar functions to the `isStandalone` property added through JDK-8259352 but was insufficiently specified, but  the prefix http://www.oracle.com/xml needs to be standardized as http://www.oracle.com/xml/properties and name is-standalone as isStandalone. 

Solution
--------

Create a new property `http://www.oracle.com/xml/jaxp/properties/xsltcIsStandalone` for the XSLTC Serializer. The property shall be named with the same, standard prefix `http://www.oracle.com/xml/jaxp/properties/` and have the same function as `'isStandalone` for DOMLS. The property name will begin with an additional prefix `xsltc` to differentiate it from the `isStandalone` property for DOMLS so that their corresponding System properties will not affect each other. 

Continue supporting the legacy property `http://www.oracle.com/xml/is-standalone` for backward compatibility.

Specification
-------------

In java.xml module-summary (java.xml/module-info.java), add the following items.

**In table Processors, add the following item:**

    ID                            Name                    How to set the property
    XSLTC Serializer    XSLTC Serializer  Transformer t = TransformerFactory.newInstance().newTransformer();

                                          t.setOutputProperty(name, value);

<br>
**In table Features and Properties, add the following item:**

**Name**: xsltcIsStandalone<br>
**Description**: indicates that the XSLTC serializer should treat the output as a standalone document. The property can be used to ensure a newline is written after the XML declaration. Unlike the property OMIT_XML_DECLARATION, this property does not have an effect on whether an XML declaration should be written out.

This property behaves similar to that for DOMLS above, except that it is for the XSLTC Serializer and its value is a String. <br>
**System Property**: yes<br>
**jaxp.properties**: yes<br>
**Value**:<br>
  **Type**:  String<br>
  **Value**: yes/no<br>
  **Default**: no<br>
**Security**: no<br>
**Supported Processor**: XSLTC Serializer <br>
**Since**: 17

<br>
**Change note 3 for table Features and Properties to reflect the addition of a string type property:**

\- [3] The value must be exactly as listed in this table, case-sensitive. The value type for the corresponding System Property is String. For boolean type, the system property is true only if it is "true" and false otherwise. 

\+ [3] The value must be exactly as listed in this table, case-sensitive. The value of the corresponding System Property is the String representation of the property value. If the type is boolean, the system property is true only if it is "true"; If the type is String, the system property is true only if it is exactly the same string representing the positive value (e.g. "yes" for xsltcIsStandalone); The system property is false otherwise. 

<br>
Attached spec_01_8260858.zip

Convenient link: http://cr.openjdk.java.net/~joehw/jdk17/8260858/spec_01/java.xml/module-summary.html


Comments
Moving to Approved.
19-02-2021

Yes, they affect different serializers: one is the DOMLS LSSerializer, another XSLTC Serializer. From the API point of view, both of them can be called "isStandalone" since they function the same and won't affect each other when set through the API. However, the corresponding System Property would affect both serializers, and for that reason, their names have to be different. The reason why the properties have different value types is to comply with the existing properties in the APIs: DOMLS properties typically are boolean (20 out of 24), while XSLTC output properties are String type. For example, "format-pretty-print" for DOMLS is true/false while XSLTC's OutputKeys#INDENT (for pretty-print) has value "yes"/"no".
17-02-2021

Moving to Provisional, not Approved. So the two "standalone" properties don't interact with each other, affecting different serializers? Why is one property a boolean and the other a string?
17-02-2021