public void AddTextNode(string name, string content) { DisableCompoundClose(); Indent(); content = XmlString.Escape(content); var node = $"<{name}>{content}</{name}>\n"; result.Append(node); }
public void AddAttribute(string key, string value) { if (nodes.Count == 0) { return; } var node = nodes.Peek(); value = XmlString.Escape(value); string attribute = $" {key}=\"{value}\""; result.Insert(node.AttributesIndex, attribute); node.AttributesIndex += attribute.Length; }