Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / July 2004

Tip: Looking for answers? Try searching our database.

IXMLDOMDocument with C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
G. Kumar - 29 Jun 2004 16:27 GMT
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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.