public xml_node add_after(xml_node node_add) { if (_node == null || _node.ParentNode == null) { return(null); } return(new xml_node(_node.ParentNode.InsertAfter(node_add.node, this.node))); }
public xml_node add_node(string name, string text, Dictionary <string, string> attrs) { xml_node nd = add_node(name); if (nd != null) { nd.text = !string.IsNullOrEmpty(text) ? text : ""; nd.set_attrs(attrs); } return(nd); }
public xml_node add_node(string name, Dictionary <string, string> attrs) { xml_node nd = add_node(name); if (nd != null) { nd.set_attrs(attrs); } return(nd); }
public xml_node add_node(string xpath, string name, string text = "") { xml_node nd = node(xpath); if (nd != null && !string.IsNullOrEmpty(text)) { nd.text = text; } return(nd == null ? null : nd.add_node(name)); }
public List <xml_node> clone_childs(xml_node ref_node) { List <xml_node> res = new List <xml_node>(); foreach (xml_node nc in this.childs) { res.Add(nc.clone(this)); } return(res); }
public List <xml_node> add_clone_childs(xml_node node_to_clone) { List <xml_node> res = new List <xml_node>(); foreach (xml_node nc in node_to_clone.childs) { res.Add(this.add_node(nc.clone(this))); } return(res); }
public xml_node add_node(string name, string text, string[] attrs) { xml_node nd = add_node(name); if (nd != null) { nd.text = text; if (attrs != null) { nd.set_attrs(attrs); } } return(nd); }
protected xml_node clone(xml_node ref_node) { xml_node res = new xml_node(ref_node._node.OwnerDocument.CreateElement(this.name)); // attrs foreach (XmlAttribute a in this._node.Attributes) { res.set_attr(a.Name, a.Value); } // childs foreach (xml_node nc in this.childs) { res._node.AppendChild(nc.clone(ref_node)._node); } return(res); }
public xml_node add_xml(string xpath, string xml) { xml_node nd = node(xpath); return(nd == null ? null : nd.add_xml(xml)); }
public xml_node add_node(string name) { xml_node nd = root_node; return(nd == null ? null : nd.add_node(name)); }
public xml_node add_node(string xpath, xml_node node_add) { xml_node nd = node(xpath); return(nd == null ? null : nd.add_node(node_add)); }
public xml_node add_before(string xpath, xml_node node_add, string xpath_before) { xml_node nd = node(xpath); return(nd == null ? null : nd.add_node(node_add, null, node(xpath_before))); }
public xml_node add_after(string xpath, xml_node node_add, string xpath_after) { xml_node nd = node(xpath); return(nd == null ? null : nd.add_node(node_add, node(xpath_after))); }
public xml_node add_clone(xml_node node_to_clone) { return(this.add_node(node_to_clone.clone(this))); }
public xml_node add_node(xml_node node_add, xml_node node_after = null, xml_node node_before = null) { return(_node == null ? null : new xml_node(node_after != null ? _node.InsertAfter(node_add.node, node_after.node) : node_before != null ? _node.InsertBefore(node_add.node, node_before.node) : _node.AppendChild(node_add.node))); }
public xml_node add_node(string name, string text) { xml_node nd = add_node(name); nd.text = text; return(nd); }