Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-843

XInclude bug on included xml that its own schema and no DTD

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.6.0
    • None
    • XInclude 1.0
    • None
    • Operating System: MacOS X
      Platform: Macintosh
    • 24992

    Description

      I get the following error message under both the 2.5.0 and 2.6.0 releases using
      XInclude. The included file (pmtext) has its own schema in its own namespace but
      no DTD. The including file also has its own schema and no DTD. The including
      file's schema imports the included file's schema.

      ==================
      LowLevelErrorHandler: error
      domain=http://www.w3.org/TR/1998/REC-xml-19980210 key=[MSG_GRAMMAR_NOT_FOUND]

      ::urn:com:streamvantage:pmtext:urn:com:streamvantage:pmtext:urn:com:streamvantage:pmtext:3:19:Document
      is invalid: no grammar found.
      ==================
      ==================
      LowLevelErrorHandler: error
      domain=http://www.w3.org/TR/1998/REC-xml-19980210
      key=[RootElementTypeMustMatchDoctypedecl]

      ::urn:com:streamvantage:pmtext:urn:com:streamvantage:pmtext:urn:com:streamvantage:pmtext:3:19:Document
      root element "pm:pmDescriptions", must match DOCTYPE root "null".
      ==================

      I ran it under a debugger and the messages are generated in
      XMLNSDocumentScannerImpl.scanStartElement() at the start of the included file.
      fPerformValidation is false for the including document but becomes true for the
      included document. My guess is that somehow the DTD validator is turned back on.

      Under 2.5.0, I simply commented out the fPerformValidation check and everything
      worked correctly. However, under 2.6.0 I get a null pointer exception at the
      following because parentBaseURI is null:

      ava.lang.NullPointerException
      at
      org.apache.xerces.xinclude.XIncludeHandler.sameBaseURIAsIncludeParent(XIncludeHandler.java:1299)
      at
      org.apache.xerces.xinclude.XIncludeHandler.processAttributes(XIncludeHandler.java:1377)
      at
      org.apache.xerces.xinclude.XIncludeHandler.startElement(XIncludeHandler.java:621)
      at
      org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:321)
      at
      org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:617)
      at
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentS%239B119.java:1617)
      at
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentS%239B119.java:338)
      at
      org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:827)
      at
      org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:757)
      at
      org.apache.xerces.xinclude.XIncludeHandler.handleIncludeElement(XIncludeHandler.java:1173)
      at
      org.apache.xerces.xinclude.XIncludeHandler.emptyElement(XIncludeHandler.java:638)
      at
      org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:313)
      at
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentS%239B119.java:1549)
      at
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentS%239B119.java:338)
      at
      org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:827)
      at
      org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:757)
      at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148)
      at
      com.streamvantage.BaseUtilities.Alarm.parseAlarmDescriptions(Alarm.java:111)
      at com.streamvantage.BaseUtilities.Alarm.initialize(Alarm.java:68)
      at Test.main(Test.java:10)

      Attachments

        Activity

          People

            mrglavas@ca.ibm.com Michael Glavassevich
            donbate@iadfw.net Don Bate
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: