You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Havasi, KrisztiƔn" <kh...@graphisoft.hu> on 2000/12/14 14:29:07 UTC

insertBefore; XMLPlatformUtils::Initialize

I found that the following code generates an acces violation:

	n.getParentNode().insertBefore(n,n); // n is some node in a DOM tree

Of course, this code does not have much sense, but I think that insertBefore
should be robust enough to handle such nonsenses. Simply, it should be
checked if the new node to be inserted is the same as the node before which
it is to be inserted. This is not so unlikely to happen in codes a little
more complicated than the above line.

One more thing I found was something that I am not sure if it is really an
error, but maybe it is. This piece of code fails, too, with access
violation:

	XMLPlatformUtils::Initialize();
	DOM_DOMImplementation::getImplementation().createDocument(
		DOMString(),DOMString("TestDOC"),DOM_DocumentType());
	XMLPlatformUtils::Terminate();

	XMLPlatformUtils::Initialize();
	DOM_DOMImplementation::getImplementation().createDocument(
		DOMString(),DOMString("TestDOC"),DOM_DocumentType());
	XMLPlatformUtils::Terminate();

In other words, the reinitialization of the dll is not perfect. What I think
the problem is (or a part of it), is that in the beginning of NodeImpl.cpp,
the 4 pointers to DOMString objects (s_xml...) are not set back to null.
Okay, maybe it wasn't designed to work like this, anyway.

Thanks,
Krisztian Havasi