예제 #1
0
        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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 /// <param name="e">
 ///            is the element test. </param>
 /// <returns> e </returns>
 public virtual object visit(ElementTest e)
 {
     return(e);
 }