Hi, I'm trying to convert some JScript code to C# and am having some trouble defining a new IXMLDOMDocument in C# and loading an xml file to it. This is what I want to do in JScript:
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
xmlDoc.loadXML("Some XML Code");
How would I do this in C#? Also, is there any good documentation for the Infopath object model using C#? The help in Infopath 2003 Toolkit for Visual Studio only names the methods and objects without any descriptions or examples. The help for JScript and VBScript is very well-documented but I couldn't find any examples using C#. Is there a good place for this? Thanks!
Greg Collins [MVP] - 01 Jul 2004 18:07 GMT
Here's what I do in C#:
string sXml = "<SomeHTML />";
IXMLDOMDocument oXml = thisXDocument.CreateDOM();
oXml.async = false;
oXml.loadXML(sXml);
And I would also put this code in a try/catch block.

Signature
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
Hi, I'm trying to convert some JScript code to C# and am having some trouble defining a new IXMLDOMDocument in C# and loading an xml file to it. This is what I want to do in JScript:
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
xmlDoc.loadXML("Some XML Code");
How would I do this in C#? Also, is there any good documentation for the Infopath object model using C#? The help in Infopath 2003 Toolkit for Visual Studio only names the methods and objects without any descriptions or examples. The help for JScript and VBScript is very well-documented but I couldn't find any examples using C#. Is there a good place for this? Thanks!