Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: appendChild & cloneNode

From: Joe Kesselman <keshlam.cat.nospam@-------.--->
To: NULL
Date: 6/2/2009 8:02:00 PM
>> 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.

Exactly. importNode()'s job is to read the data from the source node 
(using the public DOM APIs) and to recreate equivalent nodes in the 
target DOM.

> 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.

... Which means you have to go back to the solution used before 
importNode() was added: Write your own importing subroutine which walks 
the source tree and builds equivalent nodes in the target. Easy with 
recursion; more difficult but sometimes more efficient with an iterative 
engine.

> 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.

Or from an XML document to an XML document, unless you know the DOM 
implementations can work happily with each other. Basically, if you 
haven't written (or examined) the low-level code which created the DOMs, 
you'd better plan on importing.

FAQ, as cited.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent