Results 1 to 6 of 6

Thread: Xml: Append with \n

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Resolved Xml: Append with \n

    I have a code that looks like
    Code:
    [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);
    		}
    When tested, it looks like
    Code:
    <database name="Northwind" type="MSSQL"><table name="Categories" /></database>
    What I really want is something like
    Code:
    <database name="Northwind" type="MSSQL">
        <table name="Categories" />
    </database>
    Any help?
    Last edited by nebulom; Oct 5th, 2006 at 07:36 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width