public static List <Element> ElementFilter(ICollection <Element> elist, ElementTest testDelegate) { List <Element> ret = new List <Element>(); foreach (Element elem in elist) { if (testDelegate(elem)) { ret.Add(elem); } } return(ret); }
/// <summary> /// Validate an element test. /// </summary> /// <param name="e"> /// is the expression. </param> /// <returns> null. </returns> // XXX NO SEMANTIC CHECK?! public virtual object visit(ElementTest e) { if (e.name() != null) { if (!expandItemTypeQName(e.name())) { reportBadPrefix(e.name().prefix()); } } if (e.type() != null) { if (!expandItemTypeQName(e.type())) { reportBadPrefix(e.type().prefix()); } } return(null); }
/// <param name="e"> /// is the element test. </param> /// <returns> e </returns> public virtual object visit(ElementTest e) { return(e); }