public CreateWhitespace ( string text ) : |
||
text | string | |
return |
XmlDocument doc = new XmlDocument(); XmlElement elem = doc.CreateElement("root"); XmlWhitespace whitespaceNode = doc.CreateWhitespace("\n "); elem.AppendChild(whitespaceNode);
XmlDocument doc = new XmlDocument(); XmlElement elem1 = doc.CreateElement("foo"); XmlElement elem2 = doc.CreateElement("bar"); XmlWhitespace whitespaceNode = doc.CreateWhitespace("\r\n "); doc.DocumentElement.AppendChild(elem1); doc.DocumentElement.InsertBefore(whitespaceNode, elem1); doc.DocumentElement.AppendChild(elem2);
{whitespaceNode}