Writes out the given white space.
using System;
using System.IO;
using System.Xml;
public class Sample
{
public static void Main()
{
XmlTextWriter writer = null;
writer = new XmlTextWriter ("ws.html", null);
writer.WriteStartElement("p");
writer.WriteAttributeString("xml", "space", null, "preserve");
if (writer.XmlSpace == XmlSpace.Preserve)
Console.WriteLine("xmlspace is correct!");
writer.WriteString("something");
writer.WriteWhitespace(" ");
writer.WriteElementString("b", "B");
writer.WriteString("ig");
writer.WriteEndElement();
writer.Close();
}
}
Related examples in the same category