-
Bug
-
Resolution: Fixed
-
P3
-
7, 11, 15
-
- 8bpr-critical-approved
- CPU21_04-critical-SQE-OK
- CPU21_04-critical-approved
- additional-information-not-received
- dcsaw
- jdk11u-critical-request
- jdk11u-critical-yes
- jdk13u-fix-request
- jdk13u-fix-yes
- jdk15u-fix-request
- jdk15u-fix-yes
- jdk16u-fix-SQE-ok
- jdk16u-fix-request
- jdk16u-fix-yes
- redhat-interest
- regression
- reproducer-yes
- webbug
-
b08
-
generic
-
generic
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8261761 | 16.0.2 | Kiran Sidhartha Ravikumar | P3 | Resolved | Fixed | b01 |
JDK-8259700 | 16.0.1 | Kiran Sidhartha Ravikumar | P3 | Closed | Fixed | b06 |
JDK-8281965 | 15.0.7 | Yuri Nesterenko | P3 | Resolved | Fixed | b02 |
JDK-8281826 | 13.0.11 | Yuri Nesterenko | P3 | Resolved | Fixed | b02 |
JDK-8259701 | 11.0.12-oracle | Kiran Sidhartha Ravikumar | P3 | Closed | Fixed | b01 |
JDK-8263418 | 11.0.12 | Joe Wang | P3 | Resolved | Fixed | b01 |
JDK-8262776 | 11.0.11-oracle | Dukebot | P3 | Resolved | Fixed | b07 |
JDK-8263049 | 11.0.11 | Martin Doerr | P3 | Resolved | Fixed | b06 |
JDK-8259702 | 8u301 | Kiran Sidhartha Ravikumar | P3 | Resolved | Fixed | b01 |
JDK-8262757 | 8u291 | Kiran Sidhartha Ravikumar | P3 | Resolved | Fixed | b07 |
JDK-8262206 | 8u281 | Kiran Sidhartha Ravikumar | P3 | Closed | Fixed | b33 |
JDK-8264245 | emb-8u291 | Kiran Sidhartha Ravikumar | P3 | Resolved | Fixed | team |
JDK-8259703 | 7u311 | Kiran Sidhartha Ravikumar | P3 | Closed | Fixed | b01 |
JDK-8262772 | 7u301 | Kiran Sidhartha Ravikumar | P3 | Resolved | Fixed | b07 |
Using LSSerializer to pretty-print a DOM results in an xml-declaration being not followed by a newline.
Related to bugs #7150637 and #8054115.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the following code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
<?xml version="1.0" encoding="UTF-8"?>
<sometag/>
ACTUAL -
<?xml version="1.0" encoding="UTF-8"?><sometag/>
---------- BEGIN SOURCE ----------
package io.github.oliviercailloux.jaris.xml;
import java.io.StringWriter;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.ls.DOMImplementationLS;
import org.w3c.dom.ls.LSOutput;
import org.w3c.dom.ls.LSSerializer;
public class Snippet {
public static void main(String[] args) throws Exception {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final DocumentBuilder builder = factory.newDocumentBuilder();
final Document document = builder.newDocument();
final Element child = document.createElement("sometag");
document.appendChild(child);
final DOMImplementationLS impl = (DOMImplementationLS) document.getImplementation().getFeature("LS", "3.0");
final LSSerializer ser = impl.createLSSerializer();
/** But see https://bugs.openjdk.java.net/browse/JDK-7150637 */
/**
* But see
* <a href="https://bugs.openjdk.java.net/browse/JDK-8054115">8054115</a>:
* LSSerializer remove a '\n' following the xml declaration
*/
ser.getDomConfig().setParameter("format-pretty-print", true);
final StringWriter writer = new StringWriter();
final LSOutput output = impl.createLSOutput();
output.setCharacterStream(writer);
ser.write(document, output);
System.out.println(writer.toString());
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8259702 XML declaration is not followed by a newline
- Resolved
-
JDK-8261761 XML declaration is not followed by a newline
- Resolved
-
JDK-8262757 XML declaration is not followed by a newline
- Resolved
-
JDK-8262772 XML declaration is not followed by a newline
- Resolved
-
JDK-8262776 XML declaration is not followed by a newline
- Resolved
-
JDK-8263049 XML declaration is not followed by a newline
- Resolved
-
JDK-8263418 XML declaration is not followed by a newline
- Resolved
-
JDK-8264245 XML declaration is not followed by a newline
- Resolved
-
JDK-8281826 XML declaration is not followed by a newline
- Resolved
-
JDK-8281965 XML declaration is not followed by a newline
- Resolved
-
JDK-8259700 XML declaration is not followed by a newline
- Closed
-
JDK-8259701 XML declaration is not followed by a newline
- Closed
-
JDK-8259703 XML declaration is not followed by a newline
- Closed
-
JDK-8262206 XML declaration is not followed by a newline
- Closed
- csr for
-
JDK-8259352 Documenting the implementation specific features and properties
- Closed
- duplicates
-
JDK-8258803 WLS/Tuxedo error in encoding post JDK upgrade
- Closed
- relates to
-
JDK-8054115 LSSerializer remove a '\n' following the xml declaration
- Resolved
-
JDK-8260858 Implementation specific property xsltcIsStandalone for XSLTC Serializer
- Resolved
-
JDK-8261209 isStandalone property: remove dependency on pretty-print
- Resolved
-
JDK-7150637 No newline emitted after XML decl in XSLT output
- Closed
-
JDK-8259704 DOM LSSerializer control of newline after XML header
- Closed
-
JDK-8261970 reutilization of org.w3c.dom.ls.LSSerializer,produces unexpected result in 8u271
- Resolved
-
JDK-8261670 Add javadoc for the XML processing limits
- Resolved
-
JDK-8261673 Move javadoc for the lookup mechanism to module-info
- Resolved
-
JDK-8261856 Documenting the implementation specific features and properties
- Resolved
-
JDK-8250879 Create XML File - no indentation - one long row
- Closed
-
JDK-8265252 Implementation Specific Properties: change prefix, plus add existing properties
- Closed
- links to
-
Commit openjdk/jdk13u-dev/b9c0ba83
-
Commit openjdk/jdk15u-dev/b01d9799
-
Commit openjdk/jdk16u/6c6c6e67
-
Commit openjdk/jdk/69ee314b
-
Review openjdk/jdk13u-dev/328
-
Review openjdk/jdk15u-dev/178
-
Review openjdk/jdk16u/24
-
Review openjdk/jdk/2041