HandCoded.Xml.MutableNodeList.AddAll C# (CSharp) Method

AddAll() public method

Adds the contents of the given XmlNodeList into the current MutableNodeList.
public AddAll ( XmlNodeList list ) : void
list System.Xml.XmlNodeList The to be added.
return void
        public void AddAll(XmlNodeList list)
        {
            foreach (XmlNode node in list)
                if (!nodes.Contains (node)) nodes.Add (node);
        }

Usage Example

Beispiel #1
0
        /// <summary>
        /// Evaluates a simple multiple valued path access from the given context
        /// node to the named grandchild elements.
        /// </summary>
        /// <param name="contexts">The context <see cref="XmlElement"/>.</param>
        /// <param name="name1">The name of the required child.</param>
        /// <param name="name2">The name of the required grandchild.</param>
        /// <returns>A possibly empty <see cref="XmlNodeList"/> of matching
        /// child elements.</returns>
        public static XmlNodeList Paths(XmlNodeList contexts, string name1, string name2)
        {
            MutableNodeList list = new MutableNodeList();

            foreach (XmlElement context in contexts)
            {
                list.AddAll(Paths(Paths(context, name1), name2));
            }

            return(list);
        }
All Usage Examples Of HandCoded.Xml.MutableNodeList::AddAll