Esempio n. 1
0
 public override bool evalBoolean(VTDNav vn)
 {
     // TODO Auto-generated method stub
     if (cached)
     {
         return(eb);
     }
     else
     {
         eb = e.evalBoolean(vn);
         return(eb);
     }
 }
Esempio n. 2
0
        /*
         * (non-Javadoc)
         *
         * @see com.ximpleware.xpath.Expr#evalBoolean(com.ximpleware.VTDNav)
         */
        public override bool evalBoolean(VTDNav vn)
        {
            if (e.Boolean)
            {
                return(e.evalBoolean(vn));
            }
            if (e.NodeSet)
            {
                bool a = false;
                vn.push2();
                // record teh stack size
                int size = vn.contextStack2.size;
                try
                {
                    a = (evalNodeSet(vn) != -1);
                }
                catch (System.Exception ee)
                {
                }
                //rewind stack
                vn.contextStack2.size = size;
                reset(vn);
                vn.pop2();
                return(a);
            }
            if (e.Numerical)
            {
                double dval = e.evalNumber(vn);

                if (dval == 0.0 || System.Double.IsNaN(dval))
                {
                    return(false);
                }
                return(true);
            }

            String s = e.evalString(vn);

            if (s == null || s.Length == 0)
            {
                return(false);
            }
            return(true);
        }
Esempio n. 3
0
 /// <summary>
 ///  evalXPathToBoolean() evaluates the xpath expression to a boolean
 /// </summary>
 /// <returns> return the result as a boolean</returns>
 public bool evalXPathToBoolean()
 {
     return(xpe.evalBoolean(vn));
 }