2005-04-03 Juergen Donnerstag Once we introduced wicket namespace to handle wicket tags and attributes like and wicket-example tests failed. Tracing the error down through jWebUnit and HttpUnit I found that HttpUnit calls ParseHTML.getDOM() for each assertXXX() like test. getDOM() calls Node.cloneNode( /* deep */ true) to make a copy of the DOM tree (obviously to protected the DOM against accidental changes). As Xerces-2.6.2 is the underlying XML implementation, the Xerces2 implementation of cloneNode() gets called. And cloneNode() is causing all the problems. From my point the cloneNode() (resp. importNode) implementation has several bugs with respect to namespaces (though I have not studied the xml spec in detail). a) cloneNode() first creates an empty Document but does not copy the strictErrorHandling() attribute from the original document. As default for this attribute is true, strict error handling is always enable during clone node and there is no way to disable it. Because html with namespace is not valid xml and since we do not have a xhtml + wicket DTD, wicket's output with wicket namespace is non-valid xml. (of course you can strip wicket tags and attrs from output, but for debugging purposes you'll still need it). Thus Xerces throws a NAMESPACE_ERR exception. In order to circumvent that problem I copied the HtmlDocumentImpl.java and changed cloneNode() to always disable error handling while cloning. b) Unfortunately cloneNode() still didn't work. Tags like failed. The clone always looked like and id="xxxx" was swallowed. The reason, again, was not 100% compliant XML. The wicket attribute did not have a namespace URI (though I specific