Published in: C#
static void Csharp_HelloWorld_XML() { XmlNode myRoot; XmlAttribute myAttribute; myRoot = doc.CreateElement("HelloXMLWorld"); myRoot.InnerText = "ROOT Element"; doc.AppendChild(myRoot); myAttribute = doc.CreateAttribute("Attribute1"); myAttribute.InnerText = "AttributeText1"; myRoot.Attributes.Append(myAttribute); //doc.Save(@"c:\helloxmlworld.xml"); Console.WriteLine(doc.OuterXml); }
You need to login to post a comment.
