Saturday, March 15, 2008

How to create a white space in the XML Text node

XmlDocument doc = new XmlDocument();
XmlNode nNode = doc.CreateElement("Name");
nNode.AppendChild(doc.CreateTextNode(Convert.ToChar(160).ToString()));

Output would be something like: <Name> </Name> instead of </Name>
.....Hope this helps someone!

No comments: