/// <summary> /// Get the first the <see cref="XmlElement"/> with the corresponding name and and with the corresponding value attribute of the <see cref="XmlNodeList"/> /// </summary> /// <param name="nodeList"></param> /// <param name="name"></param> /// <param name="attribute"></param> /// <param name="value"></param> /// <returns></returns> static public XmlElement FirstElement(this XmlNodeList nodeList, string name, string attribute, string value) { foreach (XmlElement item in nodeList.EnumerableElement(name, attribute, value)) { return(item); } return(null); }
/// <summary> /// Get the first <see cref="XmlElement"/> of the <see cref="XmlNodeList"/> /// </summary> /// <param name="nodeList"></param> static public XmlElement FirstElement(this XmlNodeList nodeList) { foreach (XmlElement item in nodeList.EnumerableElement()) { return(item); } return(null); }
/// <summary> /// Enumerate the <see cref="XmlElement"/> with the corresponding name and containing the attribute in the <see cref="XmlNodeList"/> /// </summary> /// <param name="nodeList"></param> /// <param name="name"></param> /// <param name="attribute"></param> /// <returns></returns> static public IEnumerable <XmlElement> EnumerableElement(this XmlNodeList nodeList, string name, string attribute) { foreach (XmlElement item in nodeList.EnumerableElement(name)) { if (item.Name == name && item.HasAttribute(attribute)) { yield return(item); } } }
/// <summary> /// Enumerate the <see cref="XmlElement"/> in the <see cref="XmlNodeList"/> in reverse ordre /// </summary> /// <param name="nodeList"></param> /// <returns></returns> static IEnumerable <XmlElement> EnumerableElementReverse(this XmlNodeList nodeList) { return(nodeList.EnumerableElement().Reverse()); }
/// <summary> /// Enumerate the <see cref="XmlElement"/> with the corresponding name and and with the corresponding value attribute in the <see cref="XmlNodeList"/> /// </summary> /// <param name="nodeList"></param> /// <param name="name"></param> /// <param name="attribute"></param> /// <param name="value"></param> static public XmlElement[] GetElements(this XmlNodeList nodeList, string name, string attribute, string value) { return(nodeList.EnumerableElement(name, attribute, value).ToArray()); }
/// <summary> /// Enumerate the <see cref="XmlElement"/> in the <see cref="XmlNodeList"/> /// </summary> /// <param name="nodeList"></param> static public XmlElement[] GetElements(this XmlNodeList nodeList) { return(nodeList.EnumerableElement().ToArray()); }