예제 #1
0
        public void AddTextNode(string name, string content)
        {
            DisableCompoundClose();
            Indent();
            content = XmlString.Escape(content);
            var node = $"<{name}>{content}</{name}>\n";

            result.Append(node);
        }
예제 #2
0
        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;
        }