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

Windows-style filename in returned systemID URI

    XMLWordPrintable

Details

    Description

      Name: inR10064 Date: 06/21/2001


       The method getSystemId() of the class javax.xml.transform.stream.StreamResult
      returns URI with Windows-style filename ( with backslashes ) when a StreamResult
      instance is constructed with File argument or the setSystemId(File) is applied
      ( see sysID.java sample and log below ).

      The backslash symbol isn't admittable in URI (pp 26-27, RFC 2396 "URI Generic Syntax",
      August 1998 ; http://www.ietf.org/rfc/rfc2396.txt )

      The same bug is found in the class
         javax.xml.transform.stream.StreamSource

      Bugs affect tests in TCK JAXP 1.1.1
         api/javax_xml_transform/stream/StreamResultTests.html[Ctor_File]
         api/javax_xml_transform/stream/StreamResultTests.html[setSystemId_File]
         api/javax_xml_transform/stream/StreamSourceTests.html[Ctor_File]
         api/javax_xml_transform/stream/StreamSourceTests.html[setSystemId_File]

      and new tests in JCK Merlin Beta
         api/javax_xml/transform/stream/StreamResult/index.html#Ctor[Ctor005]
         api/javax_xml/transform/stream/StreamResult/index.html#setGet[setGet006]
         api/javax_xml/transform/stream/StreamSource/index.html#Ctor[Ctor007]
         api/javax_xml/transform/stream/StreamSource/index.html#setGet[setGet006]

      The bug is found in JAXP 1.1.1 build b24-19_jun_2001 and in Merlin-beta
      builds b65, b68 while test runs on Windows 98.

      ------------------------------------sysID.java-----------------------------
      package tests;

      import java.io.File;
      import javax.xml.transform.stream.StreamResult;

      public class sysID {
          public static void main(String argv[]) {

              File f = new File("H:\\ld22\\java\\inev\\local-home", "Ctor_File.xml");
              StreamResult sr = new StreamResult(f);
              System.out.println("sr.getSystemId(): '"+ sr.getSystemId() +"'");

              sr = new StreamResult();
              f = new File("H:\\ld22\\java\\inev\\local-home", "setSystemId_File99.xml");
              sr.setSystemId(f);
              System.out.println("sr.getSystemId(): '"+ sr.getSystemId() +"'");
           }
      }

      ---------------------------------------------------------------------------
      -------------------- log of run on Windows 98 ----------------------------

      H:\ld22\java\inev\local-home\work\tmp\JAXP>set CLASSPATH=clss;JAXP\jaxp-1.1.1-b2
      4-21_jun_2001\jaxp.jar;JAXP\jaxp-1.1.1-b24-21_jun_2001\crimson.jar;JAXP\jaxp-1.1
      .1-b24-21_jun_2001\xalan.jar

      H:\ld22\java\inev\local-home\work\tmp\JAXP>
      H:\ld22\java\inev\local-home\work\tmp\JAXP>H:\ld25\java\dest\jdk1.3.0fcsC\win32bin\java -verify -ms32m -mx64m tests.sysID
      sr.getSystemId(): 'file:///H:\ld22\java\inev\local-home\Ctor_File.xml'
      sr.getSystemId(): 'file:///H:\ld22\java\inev\local-home\setSystemId_File99.xml'

      H:\ld22\java\inev\local-home\work\tmp\JAXP>
      H:\ld22\java\inev\local-home\work\tmp\JAXP>set CLASSPATH=clss

      H:\ld22\java\inev\local-home\work\tmp\JAXP>H:\ld25\java\dest\jdk1.4.0beta-b68\wi
      n\bin\java -verify -ms32m -mx64m tests.sysID
      sr.getSystemId(): 'file:///H:\ld22\java\inev\local-home\Ctor_File.xml'
      sr.getSystemId(): 'file:///H:\ld22\java\inev\local-home\setSystemId_File99.xml'
      ---------------------------------------------------------------------------

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

      Attachments

        Issue Links

          Activity

            People

              jsuttorsunw Jeff Suttor (Inactive)
              inevsunw Inev Inev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: