Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
2.2.1
-
None
-
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)