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

NullPointerException while parsing document with XHTML entity resolver. "Random changes" fix the error in the document.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • None
    • None
    • DOM (Level 3 Core)
    • None

    Description

      See the attached test to reproduce the error. This is the output that I get from the test.

      If I remove the XhtmlEntityResolver the test will pass. Also, the only difference between the two XML files in the test is the addition of a comment.

      Java Home: C:\Program Files (x86)\Java\jre6
      Java Version: 1.6.0_14
      Parsing Works
      Parsing Fails
      Exception in thread "main" java.lang.NullPointerException
      at com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl.setChunkIndex(Unknown Source)
      at com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl.appendChild(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser.characters(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.characters(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
      at TestXercesParse.parse(TestXercesParse.java:41)
      at TestXercesParse.main(TestXercesParse.java:24)

      Attachments

        1. XercesNPX.zip
          278 kB
          Yonas Jongkind

        Activity

          People

            Unassigned Unassigned
            yonas.jongkind@gmail.com Yonas Jongkind
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: