Ejemplo n.º 1
0
        public override int evalNodeSet(VTDNav vn)
        {
            // TODO Auto-generated method stub
            int i = -1;

            if (cached)
            {
                if (count < ens.size_Renamed_Field)
                {
                    i = ens.intAt(count);
                    vn.recoverNode(i);
                    count++;
                    return(i);
                }
                else
                {
                    return(-1);
                }
            }
            else
            {
                cached = true;

                if (ens == null)
                {
                    ens = new FastIntBuffer(8);//page size 64
                }
                //record node set
                while ((i = e.evalNodeSet(vn)) != -1)
                {
                    ens.append(i);
                }
                e.reset(vn);
                if (ens.size_Renamed_Field > 0)
                {
                    i = ens.intAt(count);//count should be zero
                    vn.recoverNode(i);
                    count++;
                    return(i);
                }
                else
                {
                    return(-1);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary> Reset the XPath so the XPath Expression can
        /// be reused and revaluated in anther context position
        ///
        /// </summary>

        public void  resetXPath()
        {
            if (xpe != null && vn != null)
            {
                xpe.reset(vn);
                ft = true;
                vn.contextStack2.size = stackSize;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Reset the XPath so the XPath Expression can
        /// be reused and revaluated in anther context position
        ///
        /// </summary>

        public void  resetXPath()
        {
            if (xpe != null && vn != null)
            {
                xpe.reset(vn);
                ft = true;
                vn.contextStack2.size = stackSize;
                if (cachingEnabled)
                {
                    xpe.clearCache();
                }
            }
        }
Ejemplo n.º 4
0
        /*
         * (non-Javadoc)
         *
         * @see com.ximpleware.xpath.Expr#reset(com.ximpleware.VTDNav)
         */
        public override void  reset(VTDNav vn)
        {
            // travese el list and reset every expression
            e.reset(vn);
            current = this;
            UnionExpr tmp = this.next;

            while (tmp != null)
            {
                tmp.e.reset(vn);
                tmp = tmp.next;
            }
            if (ih != null)
            {
                ih.reset();
            }
            state = 0;
        }