示例#1
0
 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)));
 }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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));
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
        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);
        }
示例#8
0
        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);
        }
示例#9
0
 public xml_node add_xml(string xpath, string xml)
 {
     xml_node nd = node(xpath); return(nd == null ? null : nd.add_xml(xml));
 }
示例#10
0
 public xml_node add_node(string name)
 {
     xml_node nd = root_node; return(nd == null ? null : nd.add_node(name));
 }
示例#11
0
 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));
 }
示例#12
0
 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)));
 }
示例#13
0
 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)));
 }
示例#14
0
 public xml_node add_clone(xml_node node_to_clone)
 {
     return(this.add_node(node_to_clone.clone(this)));
 }
示例#15
0
 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)));
 }
示例#16
0
 public xml_node add_node(string name, string text)
 {
     xml_node nd = add_node(name); nd.text = text; return(nd);
 }