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

Relative URIs are not resolved properly for schemaSource property

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.2.0
    • 1.2.0
    • xml
    • 1.2.0
    • sparc
    • solaris_2.6

      The parser can not load the schema when property schemaSource when set with a relative URI string, such as "Foobar.xsd". The same effect is optainable however using the apache external-schema location property. However, when a full path is supplied, i,e file:/..., the schemaSource can load the file. Note that apache settings does not require this.

      I include a test run to compare the settings below. The first run contains the
      JAXP setting and compare it with setting the XMLReader property.

      Please refer to the attachments to duplicate the case and examples. For convenience, please refer to http://javaweb.sfbay/~umit/jaxp12_bugs/test directory and change the Makefile* to point to the appropriate jars.



      ***********PARSER TEST test1relpathfails with Props file = /home/umit/projects/DTD2Schema/test/test1relpathfails/Properties

      Schema Location: Test1.xsd

      Using JAXP schemaSource setting:

      Location of Schema is: Test1.xsd

      Error: URI=null
      Line=-1: schema_reference.4: Failed to read schema document 'Test1.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

      Tag <b> occurs 1 times
      Tag <a> occurs 1 times
      Tag <foobar> occurs 1 times
      Tag <c> occurs 1 times
      Schema Location: http://java.sun.com/J2EE/Test Test1.xsd

      Using apache external-schemaLocation setting:

      Location of Schema is: http://java.sun.com/J2EE/Test Test1.xsd

      Tag <b> occurs 1 times
      Tag <a> occurs 1 times
      Tag <foobar> occurs 1 times
      Tag <c> occurs 1 times

            duke J. Duke
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: