Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: appendChild & cloneNode >Thread Next - Re: appendChild & cloneNode Re: appendChild & cloneNodeTo: NULL Date: 6/2/2009 8:42:00 AM On Jun 2, 2:24 pm, NickFitz wrote: > On Jun 2, 1:31 pm, Joe Kesselman wrote: > >> When nodes come from different documents, you should >> probably be using the importNode operation. > >> http://www.w3.org/DOM/faq.html#ownerdoc > > That still won't work on IE. XML nodes, implemented by MSXML, > are a different and incompatible kind of COM component to > the HTML nodes implemented in MSHTML :-( That would not necessarily matter as the - importNode - method would be able to create new nodes in the target document based upon the nodes it received as arguments. Indeed the - importNode - method is required to create new nodes rather than directly employing its argument nodes. Of course the reason that won't work with IE is that Microsoft DOMs (at very lest the HTML DOM that is the target here) does not have the - importNode - method implemented. On the other hand, the existence of an - importNode - method in the W3C Core DOM does appear to be a fair indicator that the ability to directly append nodes from one document into another should not be expected to be available. This impression is reinforced by observing that the - appendChild - method is allowed/expected to throw a "WRONG_DOCUMENT_ERR" "if newChild was created from a different document than the one that created this node". So there is no reason for expecting to be able to append nodes from an XML document into an HTML document, even if it is possible to point to some environments where it can be done. Richard. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
