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

Method DOMSerializer.writeURI() does not work

XMLWordPrintable

    • 1.3
    • sparc
    • solaris_2.6

        Name: apR10229 Date: 10/03/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 boolean writeURI(org.w3c.dom.Node node,
                                java.lang.String URI)

        Serialize the specified node as described above in the general description of the DOMSerializer interface. The output is written to the supplied URI.
        ...
        ---------- end-of-excerpt ---------------

        Problem description
        ===================
        According to Java API Documentation, method
        org.w3c.dom.ls.DOMSerializer.writeURI() should serialize
        specified node to URI, but it returnes false and does nothing more.
            
        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();

        File f = new File("output.tmp");
                String uri = f.toURI().toString();
                System.out.println("Serialization result: "+writer.writeURI(doc,uri));
            }
        }
        ------- end-of-Test.java -------

        Minimized test output:
        ======================
        <pav@hammer(pts/3).487> java -cp ~/ Test
        Serialization result: 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

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

              rmandavasunw Ramesh Mandava (Inactive)
              pavsunw Pav Pav (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: