I have a code that looks like
When tested, it looks likeCode:[Test] public void Test() { XmlDocument doc = new XmlDocument(); XmlElement e = doc.CreateElement("database"); e.SetAttribute("name", "Northwind"); e.SetAttribute("type", "MSSQL"); doc.PrependChild(e); XmlElement ee = doc.CreateElement("table"); ee.SetAttribute("name", "Categories"); e.PrependChild(ee); Console.WriteLine(e.OuterXml); }
What I really want is something likeCode:<database name="Northwind" type="MSSQL"><table name="Categories" /></database>
Any help?Code:<database name="Northwind" type="MSSQL"> <table name="Categories" /> </database>




Reply With Quote