Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4934468

DOMSerializer's conf parameter 'format-pretty-print' has wrong default value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 5.0
    • xml

      Name: apR10229 Date: 10/08/2003


      Filed By : SPB JCK team (###@###.###)
      JDK : java full version "1.5.0-beta-b22"
      JCK : 1.5
      Platform[s] : Linux
      switch/Mode :
      JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
      Failing Test [s] : N/A


      Specification excerpt:
      ======================
      --------- J2SE API spec v.1.5 ---------
      ...
      public DOMConfiguration getConfig()
      ...
      "format-pretty-print"
          true[optional] Formatting the output by adding whitespace to produce a
      pretty-printed, indented, human-readable form. The exact form of the
      transformations is not specified by this specification. Pretty-printing changes
      the content of the document and may affect the validity of the document,
      validating implementations should preserve validity. Setting this parameter to
      true will set the parameter " canonical-form" to false.
          false[required] (default) Don't pretty-print the result.

      ...
      ---------- end-of-excerpt ---------------

      Problem description
      ===================
      DOMSerializer's implementation stores an incorrect default value for
      configuration parameter 'format-pretty-print'.

      Minimized test:
      ===============
      ------- Test.java -------
      import java.io.*;
      import org.w3c.dom.ls.*;
      import org.w3c.dom.*;
      import javax.xml.parsers.*;

      public class Test {
          public static void main(String[] argv) {
              Document doc = null;
              try {
                  DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                  doc = parser.parse(new StringBufferInputStream("<?xml version='1.0'?><ROOT/>"));
              } catch (Throwable e) {
      e.printStackTrace();
              }
              DOMImplementation impl = doc.getImplementation();
              DOMImplementationLS implLS = (DOMImplementationLS) impl.getFeature("LS","3.0");
              DOMSerializer writer = implLS.createDOMSerializer();
              Boolean param = (Boolean)writer.getConfig().getParameter("format-pretty-print");
              System.out.println("format-pretty-print: "+param.booleanValue());
          }
      }
      ------- end-of-Test.java -------

      Minimized test output:
      ======================
      <pav@hammer(pts/3).334> java Test
      format-pretty-print: false


      JCK test source location:
      ==========================
      /java/re/jck/1.5/promoted/latest/JCK-runtime-15/tests

      Specific Machine Info:
      =====================
      Linux hammer 2.4.21 #1 Wed Jun 25 20:18:22 MSD 2003 i686 unknown

      ======================================================================

            gsharmasunw Gopal Sharma (Inactive)
            pavsunw Pav Pav (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: