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

DOMSerializer's conf parameter 'normalize-characters' has wrong default value

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.3
    • CPU:
      sparc
    • OS:
      solaris_2.6

      Backports

        Description

        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()
        ...
         "normalize-characters"
        This parameter is equivalent to the one defined by DOMConfiguration in [DOM Level 3 Core] . Unlike in the Core, the default value for this parameter is true. While DOM implementations are not required to support fully normalizing the characters in the document according to the rules defined in [CharModel] supplemented by the definitions of relevant constructs from Section 2.13 of [XML 1.1], this parameter must be activated by default if supported.

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

        Problem description
        ===================
        DOMSerializer's implementation stores an incorrect default value for configuration parameter 'normalize-characters'.
            
        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("normalize-characters");
                System.out.println("Normalize-characters: "+param.booleanValue());
            }
        }
        ------- end-of-Test.java -------

        Minimized test output:
        ======================
        <pav@hammer(pts/3).334> java Test
        Normalize-characters: 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

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

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                vkorcl Venugopal K (Inactive)
                Reporter:
                pavsunw Pav Pav (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: