For XHTML documents, appending new items produces broken results - the new items all go in one line lacking a list marker. When examining the resulting document in Inspector, errors are logged to the console: /Users/ap/WebKit/WebCore/bindings/objc/WebScriptObject.mm:198:[8444] JavaScript exception: Null value
Created attachment 10394 [details] test case
I had the same problem when I was trying to add with appendChild and createElement (JavaScript) new elemnts to DOM of XHTML valid document (application/xhtml+xml). I enabled DEBUG in Safari (not webkit) and looked at the code of the page. it showed me that if i try to add link to a page it 4example adds this code "<a href="link"/>text</a>". the same thing with paragraph it adds "<p/>text</p>". So the problem is that it adds to opening tag "/" at the end of it.
*** This bug has been marked as a duplicate of 8007 ***