In one of the prototypes I was working on I had to programmatically populate an InfoPath form with data.
After loading the required data and serializing it to the required schema I thought calling “thisXDocument.DOM.loadXML(strXmlData)” should do the job of populating the form with the data.
That call, however, triggers a “The DOM can’t be loaded twice” error.
After a quick search in the SDK help I came up with the following solution (which merges two DOMs):
IXMLDOMDocument newDOM = thisXDocument.CreateDOM();
newDOM.loadXML(strXmlData);
thisXDocument.ImportDOM(newDOM);
Similar Posts:
- Corporate Data Slips Out Via Google Calendar
- Modern Approaches to Data Visualization
- Apology to My Readers (Buggy dasBlog Contact Form)
- Developing a Robust Data Driven UI Using WPF – The DataModel
- Microsoft Live Search as a Hot, Young, Woman
Tags: InfoPath, Microsoft Office, OBA









Leave a Comment