sjsxp
  1. sjsxp
  2. SJSXP-35

XMLStreamReader can't parse schema for XML Schema

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      35

      Description

      in some cases wsimport is given schema for XMLSchema:
      http://www.w3.org/2001/XMLSchema.xsd.

      But XMLStreamReader gives this error when reader.nextTag() is called:

      Exception in thread "main" javax.xml.stream.XMLStreamException: ParseError at
      [row,col]:[112,3
      6]
      Message: A '(' character or an element type is required in the declaration of
      element type "xs
      :schema".
      at com.sun.xml.stream.XMLReaderImpl.next(XMLReaderImpl.java:563)
      at com.sun.xml.stream.XMLReaderImpl.nextTag(XMLReaderImpl.java:1185)
      at Hello.main(Hello.java:13)

        Activity

        Hide
        vivekp added a comment -

        Created an attachment (id=7)
        Testcase

        Show
        vivekp added a comment - Created an attachment (id=7) Testcase
        Hide
        Santiago Pericas-Geertsen added a comment -

        This issue is now fixed. There were two problems. The first is that SJSXP was reading the external subset
        without actually reading its dependencies, external parameter entities in this case. Since SJSXP is a non-
        validating parser, it isn't actually required to read the external subset in the first place. Thus, the error is
        now gone simply because the external DTD isn't processed anymore.

        The second problem is in the test case provided. A call to nextTag() isn't supposed to skip over a DTD
        event, thus the test case should only call nextTag() after the DTD event has been seen. Otherwise, an
        exception will be thrown as explained in the documentation.

        Show
        Santiago Pericas-Geertsen added a comment - This issue is now fixed. There were two problems. The first is that SJSXP was reading the external subset without actually reading its dependencies, external parameter entities in this case. Since SJSXP is a non- validating parser, it isn't actually required to read the external subset in the first place. Thus, the error is now gone simply because the external DTD isn't processed anymore. The second problem is in the test case provided. A call to nextTag() isn't supposed to skip over a DTD event, thus the test case should only call nextTag() after the DTD event has been seen. Otherwise, an exception will be thrown as explained in the documentation.
        Hide
        Santiago Pericas-Geertsen added a comment -

        I've reverted the behavior proposed above. Instead of not reading the external DTD, SJSXP is now reading
        it as well as all its external dependencies such as external parameter entities. I have to make this change
        in order to preserve backward compatibility. Obviously, reading the whole external subset may have
        performance implications, but reading half of it asit was before is just plain wrong. Despite the change,
        this issue is still resolved.

        Show
        Santiago Pericas-Geertsen added a comment - I've reverted the behavior proposed above. Instead of not reading the external DTD, SJSXP is now reading it as well as all its external dependencies such as external parameter entities. I have to make this change in order to preserve backward compatibility. Obviously, reading the whole external subset may have performance implications, but reading half of it asit was before is just plain wrong. Despite the change, this issue is still resolved.

          People

          • Assignee:
            sjsxp-issues
            Reporter:
            vivekp
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: