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

DOMConfiguration: some required Document configuration properties are not suppor

XMLWordPrintable

        Name: erR10175 Date: 12/04/2003


         
          The following property/value pairs are required by spec but not supported
        by the implementation of the interface org.w3c.dom.DOMConfiguration returned
        by Document.getDomConfig():

        ('namespace-declarations', false)
        ('element-content-whitespace', true)
        ('infoset', true)

        This bug affects new tests in JCK 1.5 (not integrated yet)
           api/org_w3c/dom/DOMConfiguration/index.html#Params[Infoset001]
           api/org_w3c/dom/DOMConfiguration/index.html#Params[Namespaces001]
           api/org_w3c/dom/DOMConfiguration/index.html#Params[ECWhitespace001]

        The bug is found in jdk1.5.0/beta/b30.

        To reproduce the bug compile and run the following code as shown
        in the log below:
        ------------------------------ test.java
        import org.w3c.dom.DOMConfiguration;
        import org.w3c.dom.DOMImplementation;
        import org.w3c.dom.Document;
        import org.w3c.dom.DOMError;
        import org.w3c.dom.DOMErrorHandler;
        import javax.xml.parsers.DocumentBuilderFactory;

        class test {

            static final DOMErrorHandler handler = new DOMErrorHandler() {
                public boolean handleError(DOMError error) {
                    return false;
                }
            };

            /**
             * list of all required parameter/value pairs
             */
            static final Object [][] values = {
                // parameter, value
                {"canonical-form", Boolean.FALSE},
                {"cdata-sections", Boolean.FALSE},
                {"cdata-sections", Boolean.TRUE},
                {"check-character-normalization", Boolean.FALSE},
                {"comments", Boolean.FALSE},
                {"comments", Boolean.TRUE},
                {"datatype-normalization", Boolean.FALSE},
                {"entities", Boolean.FALSE},
                {"entities", Boolean.TRUE},
                {"error-handler", handler},
                {"infoset", Boolean.TRUE},
                {"namespaces", Boolean.TRUE},
                {"namespace-declarations", Boolean.TRUE},
                {"namespace-declarations", Boolean.FALSE},
                {"normalize-characters", Boolean.FALSE},
                {"split-cdata-sections", Boolean.TRUE},
                {"split-cdata-sections", Boolean.FALSE},
                {"validate", Boolean.FALSE},
                {"validate-if-schema", Boolean.FALSE},
                {"well-formed", Boolean.TRUE},
                {"element-content-whitespace", Boolean.TRUE},
            };

            public static void main(String [] args) throws Exception {
                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                DOMImplementation domImpl = dbf.newDocumentBuilder()
                                            .getDOMImplementation();
                Document doc = domImpl.createDocument(null, "root", null);
                DOMConfiguration config = doc.getDomConfig();

                for(int i = values.length; --i >= 0; ) {
                    String param = (String)values[i][0];
                    Object val = values[i][1];
                    if (!config.canSetParameter(param, val)) {
                        System.out.println("setting '" + param + "' to "
                                         + val + " is not supported");
                    } else {
                        config.setParameter(param, val);
                        Object returned = config.getParameter(param);
                        if (!val.equals(returned)) {
                            System.out.println("'" + param + "' is set to "
                                  + returned + ", but expected " + val);
                        }
                    }
                }
            }
        }
        ----------------------------------------------------

        ------------------------------------------------ log
        java version "1.5.0-beta"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b30)
        Java HotSpot(TM) Client VM (build 1.5.0-beta-b30, mixed mode)

        setting 'element-content-whitespace' to true is not supported
        setting 'namespace-declarations' to false is not supported
        setting 'infoset' to true is not supported
        ----------------------------------------------------

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

              joehw Joe Wang
              reysunw Rey Rey (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: