Answers to Software Questions the Experts Would Not Answer. Microsoft.NET, Java, Spring, Hibernate, JavaScript, C#, SQL Server as well as Mac, Solaris, Linux, CISCO IOS and related now include some Automotive IT! You could be having the same problem for hours like me!
Sunday, July 18, 2010
Creating XMLDocument from Program Embedded String in C#
Problem:
You want to quickly create a simple XML document without needing to write data to a file.
Solution:
Use StringReader class and feed that into the Load() function.
Example Code: XmlDocument doc = new XmlDocument(); doc.Load(new StringReader("<myNode>Hello</myNode>"));
Update: Well, that was doing too much, Load(string) would have worked just as well.
No comments:
Post a Comment