If you receive new XML for your form and you want to replace the old XML, select the root node, and do a parentNode.replaceChild() on it with your new XML root node.

Signature
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
I think I read somewhere before that it's possible to reload the whole
primary DOM from an existing form (with a 1 liner). We are expecting to
lookup form contents from the database, transform it into the form schema
using BTS and then reload it from the XML document lookup result.
Is this a feasable plan?
Will the InfoPath part of reloading be slow?
Is there a code sample one could refer to?
Thanks in advance

Signature
Anton
Anton - 26 Oct 2005 16:15 GMT
I found a code sample such as this:
IXMLDOMDocument tmpDOM = thisXDocument.CreateDOM();
tmpDOM.loadXML(strMyData);
thisXDocument.ImportDOM(tmpDOM);
which supposedly would achieve the same effect but be faster?
>If you receive new XML for your form and you want to replace the old XML, select the root node, and do a parentNode.replaceChild() on it with your new XML root node.
>
[quoted text clipped - 7 lines]
>
>Thanks in advance

Signature
Anton
Greg Collins [InfoPath MVP] - 27 Oct 2005 18:02 GMT
I haven't tried that. You'd have to do some performance testing to see which is faster. If you do such testing, will you please report back your findings here? Thanx!

Signature
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
I found a code sample such as this:
IXMLDOMDocument tmpDOM = thisXDocument.CreateDOM();
tmpDOM.loadXML(strMyData);
thisXDocument.ImportDOM(tmpDOM);
which supposedly would achieve the same effect but be faster?
Greg Collins [InfoPath MVP] wrote:
>If you receive new XML for your form and you want to replace the old XML, select the root node, and do a parentNode.replaceChild() on it with your new XML root node.
>
[quoted text clipped - 7 lines]
>
>Thanks in advance

Signature
Anton