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

NAMESPACE_ERR raised from createDocument() if namespaceURI and qualifiedName are null.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.9.0
    • 2.9.1
    • DOM (Level 3 Core)
    • None

    Description

      If DOMImplementation.createDocument() is called with a null namespaceURI and qualifiedName it's supposed to return an empty Document (i.e. one with no document element). This doesn't work with a few of the DOM implementations, specifically CoreDOMImplementationImpl and PSVIDOMImplementationImpl:

      org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
      at org.apache.xerces.dom.ElementNSImpl.setName(ElementNSImpl.java:106)
      at org.apache.xerces.dom.ElementNSImpl.<init>(ElementNSImpl.java:81)
      at org.apache.xerces.dom.CoreDocumentImpl.createElementNS(CoreDocumentImpl.java:2091)
      at org.apache.xerces.dom.CoreDOMImplementationImpl.createDocument(CoreDOMImplementationImpl.java:289)

      org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
      at org.apache.xerces.dom.ElementNSImpl.setName(ElementNSImpl.java:106)
      at org.apache.xerces.dom.ElementNSImpl.<init>(ElementNSImpl.java:81)
      at org.apache.xerces.dom.PSVIElementNSImpl.<init>(PSVIElementNSImpl.java:55)
      at org.apache.xerces.dom.PSVIDocumentImpl.createElementNS(PSVIDocumentImpl.java:97)
      at org.apache.xerces.dom.PSVIDOMImplementationImpl.createDocument(PSVIDOMImplementationImpl.java:116)

      Attachments

        Activity

          People

            mrglavas@ca.ibm.com Michael Glavassevich
            mrglavas@ca.ibm.com Michael Glavassevich
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: