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

String comparison is errorneous if used with serialization

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 2.2.1
    • None
    • XNI
    • None
    • Operating System: All
      Platform: All
    • 16235

    Description

      class ---> org.apache.xerces.dom.CoreDocumentImpl
      method ---> protected final void checkDOMNSErr(String prefix, String namespace);

      the comparisons of the namespace (namespace != NamespaceContext.XMLNS_URI)
      does not work with deserialized objects. A org.w3c.dom.DOMException:
      NAMESPACE_ERR is raised allways.

      Sample to reconstruct the problem

      String test = "<aprefix:atag
      xmlns:aprefix=\"http://www.w3.org/2000/09/xmldsig#\">some data</aprefix:atag>";
      Document parsedDoc = ... parse test and aquire a DOM-Document
      ....
      ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(1024);
      ObjectOutputStream outputStream = new ObjectOutputStream(byteArrayOutputStream);
      outputStream.writeObject(parsedDoc.getDocumentElement());
      ObjectInputStream inputStream = new ObjectInputStream(new ByteArrayInputStrea
      ((byteArrayOutputStream.toByteArray()));
      Element element = (Element) inputStream.readObject();
      Document emptyDoc = new org.apache.xerces.dom.DocumentImpl();
      emptyDoc.importNode(element, true); //---> Exception is raised

      My enviroment:
      JDK 1.4.1_01 (Win32)

      Attachments

        Activity

          People

            Unassigned Unassigned
            christos.hadoulas@vionti.de Christos Hadoulas
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: