Uploaded image for project: 'Terrier Core'
  1. Terrier Core
  2. TR-220

SimpleXMLCollection raise null pointer exception if document contains doctype with same the name than xml.doctag

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.6
    • Component/s: .indexing
    • Labels:
      None

      Description

      See : http://terrier.org/forum//read.php?3,1669

      NPE occurs when a document has a DOCTYPE placed before the root element, with the same name than the root element,
      and the xml.doctag property is set with this name.

      In SimpleXMLDocument, the method findDocumentElement(Node n) only checks the name of the node n :
      if (DocumentElements.contains(n.getNodeName().toLowerCase()) {...}
      and if true, tries to get all the attributes of n.
      But if n is a doctype element, it doesn't have any attribute.

      My workaround is to check if n is not a DOCUMENT_TYPE element (can be a DOCUMENT_NODE or an ELEMENT_NODE).

      Regards,
      Nicolas


        Attachments

          Activity

          nfaessel Nicolas Faessel created issue -
          nfaessel Nicolas Faessel made changes -
          Field Original Value New Value
          Status Open [ 1 ] Patch Available [ 10000 ]
          craigm Craig Macdonald made changes -
          Status Patch Available [ 10000 ] Open [ 1 ]
          nfaessel Nicolas Faessel made changes -
          craigm Craig Macdonald made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 3.6 [ 10060 ]
          Resolution Fixed [ 1 ]

            People

            • Assignee:
              craigm Craig Macdonald
              Reporter:
              nfaessel Nicolas Faessel
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: