当前位置: 首页>>代码示例>>C#>>正文


C# VTDNav.toNode方法代码示例

本文整理汇总了C#中com.ximpleware.VTDNav.toNode方法的典型用法代码示例。如果您正苦于以下问题:C# VTDNav.toNode方法的具体用法?C# VTDNav.toNode怎么用?C# VTDNav.toNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ximpleware.VTDNav的用法示例。


在下文中一共展示了VTDNav.toNode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: computeContextSize4PrecedingSibling2

 protected internal int computeContextSize4PrecedingSibling2(Predicate p, VTDNav vn)
 {
     int i=0;
     vn.push2();
     while(vn.toNode(VTDNav.PREV_SIBLING)){
     if (currentStep.eval2(vn,p)){
         i++;
     }
     }
     vn.pop2();
     currentStep.resetP(vn,p);
     currentStep.out_of_range=false;
     //currentStep.o = ap;
     return i;
 }
开发者ID:jzhang2004,项目名称:vtd-xml,代码行数:15,代码来源:LocationPathExpr.cs

示例2: process_ancestor2

        protected internal int process_ancestor2( VTDNav vn)
        {
            int result;
            bool b = false, b1 = false;
            //int contextSize;
            Predicate t= null;

            switch(state){
            case START:

                t = currentStep.p;
                while (t != null) {
                    if (t.requireContext) {
                        int i = computeContextSize( t, vn);
                        if (i == 0) {
                            b1 = true;
                            break;
                        } else
                            t.ContextSize=(i);
                    }
                    t = t.nextP;
                }
                if (b1) {
                    state = END;
                    break;
                }

                state = END;
                //if (vn.getCurrentDepth() != -1) {
                    vn.push2();

                    while (vn.toNode(VTDNav.P)) {
                        if ((currentStep.nt_eval || currentStep.nt.eval2(vn))
                                && ((!currentStep.hasPredicate) || currentStep.evalPredicates(vn))) {
                            if (currentStep.nextS != null) {
                                state = FORWARD;
                                currentStep = currentStep.nextS;
                                break;
                            } else {
                                //vn.pop();
                                state = TERMINAL;
                                result = vn.getCurrentIndex2();
                                if (isUnique(result))
                                    return result;
                            }
                        }
                    }
                    if (state == END) {
                        if (currentStep.hasPredicate)
                            currentStep.resetP(vn);
                        vn.pop2();
                    }
               // }
                break;

            case END:
                currentStep =null;
                // reset();
                return -1;

            case FORWARD:
                 t = currentStep.p;
                 while(t!=null){
                    if (t.requireContext){
                         int i = computeContextSize(t,vn);
                         if (i==0){
                             b1 = true;
                             break;
                         }else
                             t.ContextSize=(i);
                    }
                    t = t.nextP;
                }
                if (b1){
                    currentStep = currentStep.prevS;
                    state = BACKWARD;
                    break;
                }
                state =  BACKWARD;
               	vn.push2();

               	while(vn.toNode(VTDNav.P)){
               		if ((currentStep.nt_eval || currentStep.nt.eval2(vn))
               				&& ((!currentStep.hasPredicate) || currentStep.evalPredicates(vn))){
               			if (currentStep.nextS != null){
               				 state =  FORWARD;
               				currentStep = currentStep.nextS;
               				break;
               			}
               			else {
               				//vn.pop();
               				 state =  TERMINAL;
               				result = vn.getCurrentIndex2();
                            if ( isUnique(result))
                                return result;
               			}
               		}
               	}
               	if ( state == BACKWARD){
                    if (currentStep.hasPredicate)
//.........这里部分代码省略.........
开发者ID:jzhang2004,项目名称:vtd-xml,代码行数:101,代码来源:LocationPathExpr.cs

示例3: computeContextSize4Child2

 protected internal int computeContextSize4Child2(Predicate p, VTDNav vn)
 {
     int i=0;
     bool b = vn.toNode(VTDNav.FIRST_CHILD);
     if (b) {
     do {
         if (currentStep.eval2(vn, p)) {
             i++;
         }
     } while (vn.toNode(VTDNav.NS));
     vn.toNode(VTDNav.PARENT);
     currentStep.resetP(vn,p);
     currentStep.out_of_range=false;
     return i;
     } else
     return 0;
 }
开发者ID:jzhang2004,项目名称:vtd-xml,代码行数:17,代码来源:LocationPathExpr.cs

示例4: computeContextSize4AncestorOrSelf2

 protected internal int computeContextSize4AncestorOrSelf2(Predicate p, VTDNav vn)
 {
     int i=0;
     AutoPilot ap = (AutoPilot)currentStep.o;
     vn.push2();
     i = 0;
     do {
     if (currentStep.eval2(vn, p)) {
         i++;
     }
     }while(vn.toNode(VTDNav.PARENT));
     vn.pop2();
     currentStep.resetP(vn,p);
     currentStep.out_of_range=false;
     currentStep.o = ap;
     return i;
 }
开发者ID:jzhang2004,项目名称:vtd-xml,代码行数:17,代码来源:LocationPathExpr.cs

示例5: process_parent2

        protected internal int process_parent2(VTDNav vn)
        {
            bool b1 = false;
            Predicate t= null;
            int result;
            switch ( state) {
            case  START:
            case  FORWARD:
                t = currentStep.p;
                while(t!=null){
                    if (t.requireContext){
                        int i = computeContextSize(t,vn);
                        if (i==0){
                            b1 = true;
                            break;
                        }else
                            t.ContextSize=(i);
                    }
                    t = t.nextP;
                }
                if (b1){
                    if (state == FORWARD){
                        state = BACKWARD;
                        currentStep = currentStep.prevS;
                    }else
                        state = END;
                    break;
                }

                if (vn.getCurrentDepth() == -1) {
                    if ( state ==  START)
                         state =  END;
                    else {
                        //vn.pop();
                         state =  BACKWARD;
                        currentStep = currentStep.prevS;
                    }
                } else {
                    vn.push2();
                    vn.toNode(VTDNav.P); // must return true
                    if ((currentStep.nt_eval || currentStep.nt.eval2(vn))
                            && ((!currentStep.hasPredicate) || currentStep.evalPredicates(vn))){
                        if (currentStep.nextS != null) {
                            state =  FORWARD;
                           currentStep = currentStep.nextS;
                        } else {
                            state =  TERMINAL;
                           result = vn.getCurrentIndex2();
                            if ( isUnique(result))
                                return result;
                        }
                    }else{
                        vn.pop2();
                        if (currentStep.hasPredicate)
                            currentStep.resetP(vn);
                        if ( state ==  START)
                             state =  END;
                        else {
                             state =  BACKWARD;
                            currentStep = currentStep.prevS;
                        }
                    }
                }

                break;

            case  END:
                currentStep = null;
                // reset();
                return -1;

            case  BACKWARD:
            case  TERMINAL:
                if (currentStep.prevS == null) {
                    vn.pop2();
                     state =  END;
                    break;
                }else {
                    vn.pop2();
                     state =  BACKWARD;
                    currentStep = currentStep.prevS;
                    break;
                }

            default:
                throw new  XPathEvalException("unknown state");

            }
            return -2;
        }
开发者ID:jzhang2004,项目名称:vtd-xml,代码行数:90,代码来源:LocationPathExpr.cs

示例6: process_child2

        protected internal int process_child2(VTDNav vn)
        {
            int result;
            bool b = false, b1 = false;
            Predicate t= null;

            switch(state){
            case START:
            // first search for any predicate that
            // requires contextSize
            // if so, compute its context size
            // if size > 0
            // set context
            // if size ==0
            // immediately set the state to backward or end
            t = currentStep.p;
            while (t != null) {
                if (t.requireContext) {
                    int i = computeContextSize(t, vn);
                    if (i == 0) {
                        b1 = true;
                        break;
                    } else
                        t.ContextSize=(i);
                }
                t = t.nextP;
            }
            if (b1) {
                state = END;
                break;
            }

            b = vn.toNode(VTDNav.FIRST_CHILD);
            state = END;
            if (b) {
                do {
                    if ((currentStep.nt_eval || currentStep.nt.eval2(vn))
                            && ((!currentStep.hasPredicate) || currentStep.evalPredicates(vn))) {
                        if (currentStep.nextS != null) {
                            // currentStep.position++;
                            state = FORWARD;
                            currentStep = currentStep.nextS;
                        } else {
                            state = TERMINAL;
                            result = vn.getCurrentIndex();
                            if (isUnique(result)) {
                                return result;
                            }
                        }
                        break;
                    }
                } while (vn.toNode(VTDNav.NS));
                if (state == END)
                    vn.toNode(VTDNav.PARENT);
            }
            break;

            case END:
            currentStep = null;
            // reset();
            return -1;

            case FORWARD:

            t = currentStep.p;
            while (t != null) {
                if (t.requireContext) {
                    int i = computeContextSize(t, vn);
                    if (i == 0) {
                        b1 = true;
                        break;
                    } else
                        t.ContextSize=(i);
                }
                t = t.nextP;
            }
            if (b1) {
                currentStep = currentStep.prevS;
                state = BACKWARD;
                break;
            }

            state = BACKWARD;
             if (vn.toNode(VTDNav.FC)) {
                do {
                    if ((currentStep.nt_eval || currentStep.nt.eval2(vn))
                            && ((!currentStep.hasPredicate) || currentStep.evalPredicates(vn))) {
                        if (currentStep.nextS != null) {
                            state = FORWARD;
                            currentStep = currentStep.nextS;
                        } else {
                            state = TERMINAL;
                            result = vn.getCurrentIndex();
                            if (isUnique(result))
                                return result;
                        }
                        goto forward;
                    }
                } while (vn.toNode(VTDNav.NS));

//.........这里部分代码省略.........
开发者ID:jzhang2004,项目名称:vtd-xml,代码行数:101,代码来源:LocationPathExpr.cs

示例7: process_ancestor_or_self2

        protected internal int process_ancestor_or_self2(VTDNav vn)
        {
            bool b = false, b1 = false;
            Predicate t= null;
            int result;
            switch ( state) {
            case  START:
                t = currentStep.p;
                while (t != null) {
                    if (t.requireContext) {
                        int i = computeContextSize( t, vn);
                        if (i == 0) {
                            b1 = true;
                            break;
                        } else
                            t.ContextSize = i ;
                    }
                    t = t.nextP;
                }
                if (b1) {
                    state = END;
                    break;
                }
                state =  END;
                vn.push2();

                if (currentStep.ft){
                    currentStep.ft = false;
                    if ((currentStep.nt_eval || currentStep.nt.eval2(vn))
                            && ((!currentStep.hasPredicate) || currentStep.evalPredicates(vn))) {
                        if (currentStep.nextS != null) {
                            state =  FORWARD;
                            currentStep = currentStep.nextS;
                            break;
                        } else {
                            //vn.pop();
                            state =  TERMINAL;
                            if (vn.atTerminal)
                                result = vn.LN;
                            else
                                result = vn.getCurrentIndex();
                            if ( isUnique(result))
                                return result;
                        }
                    }
                }

                    while (vn.toNode(VTDNav.P)) {
                        if ((currentStep.nt_eval || currentStep.nt.eval2(vn))
                                && ((!currentStep.hasPredicate) || currentStep.evalPredicates(vn))) {
                            if (currentStep.nextS != null) {
                                 state =  FORWARD;
                                currentStep = currentStep.nextS;
                                break;
                            } else {
                                //vn.pop();
                                 state =  TERMINAL;
                                result = vn.getCurrentIndex();
                                if ( isUnique(result))
                                    return result;
                            }
                        }
                    }

                if ( state ==  END) {
                    if (currentStep.hasPredicate)
                        currentStep.resetP(vn);
                    vn.pop2();
                }

                break;

            case  FORWARD:
                 t = currentStep.p;
                 while(t!=null){
                    if (t.requireContext){
                         int i = computeContextSize(t,vn);
                         if (i==0){
                             b1 = true;
                             break;
                         }else
                             t.ContextSize=i;
                    }
                    t = t.nextP;
                }
                if (b1){
                    currentStep = currentStep.prevS;
                    state = BACKWARD;
                    break;
                }
                 state =  BACKWARD;
                    vn.push2();
                    if (currentStep.ft ) {
                        currentStep.ft = false;

                        if ((currentStep.nt_eval || currentStep.nt.eval2(vn))
                                && ((!currentStep.hasPredicate) || currentStep.evalPredicates(vn))) {
                            if (currentStep.nextS != null) {
                                 state =  FORWARD;
                                currentStep = currentStep.nextS;
//.........这里部分代码省略.........
开发者ID:DuLerWeil,项目名称:vtd-xml,代码行数:101,代码来源:LocationPathExpr.cs


注:本文中的com.ximpleware.VTDNav.toNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。