A document can have only one Element child, and older versions of the DOM 
may not permit you to append an Element to a Document -- you were supposed 
to create the element as a side effect of the 
DOMImplemention.createDocument call. There are good reasons for this, 
having to do with the fact that some DOM factories may want to create 
different DOM implementation classes depending on doctype and root-element 
information.

DOM Level 3 was considering relaxing that restriction, allowing the root 
element to be removed and a new one attached, partly so folks would write 
things like DocumentBuilderFactory without having to violate the DOM 
spec... but I don't know whether that's still in the DOM3 working draft 
and/or whether Xerces has prototyped that behavior yet.

______________________________________
Joe Kesselman  / IBM Research


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to