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


C# VTDNav.getCurrentDepth方法代码示例

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


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

示例1: lang

        /// <summary>
        /// 
        /// </summary>
        /// <param name="vn"></param>
        /// <param name="s"></param>
        /// <returns></returns>
        private bool lang(VTDNav vn, String s)
        {
            // check the length of s 
            bool b = false;
            vn.push2();
            try
            {
                while (vn.getCurrentDepth() >= 0)
                {
                    int i = vn.getAttrVal("xml:lang");
                    if (i != -1)
                    {
                        b = vn.matchTokenString(i, s);
                        break;
                    }
                    vn.toElement(VTDNav.P);
                }
            }
            catch (NavException e)
            {

            }
            vn.pop2();
            return b;
        }
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:31,代码来源:FuncExpr.cs

示例2: process_parent

        private int process_parent(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.toElement(VTDNav.P); // must return true
                        if ((currentStep.nt_eval || currentStep.nt.eval(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
                    {
//.........这里部分代码省略.........
开发者ID:jzhang2004,项目名称:vtd-xml,代码行数:101,代码来源:LocationPathExpr.cs

示例3: process_ancestor

		private int process_ancestor(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.requireContextSize())
						{
							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.toElement(VTDNav.P))
						{
							if (currentStep.eval(vn))
							{
								if (currentStep.NextStep != null)
								{
									state = FORWARD;
									currentStep = currentStep.NextStep;
									break;
								}
								else
								{
									//vn.pop();
									state = TERMINAL;
									result = vn.getCurrentIndex();
									if (isUnique(result))
										return result;
								}
							}
						}
						if (state == END)
						{
							currentStep.resetP(vn);
							vn.pop2();
						}
					}
					break;
				
				
				case END: 
					currentStep = null;
					// reset();
					return - 1;
				
				
				case FORWARD: 
					t = currentStep.p;
					while (t != null)
					{
						if (t.requireContextSize())
						{
							int i = computeContextSize(t, vn);
							if (i == 0)
							{
								b1 = true;
								break;
							}
							else
								t.ContextSize = i;
						}
						t = t.nextP;
					}
					if (b1)
					{
						currentStep = currentStep.PrevStep;
						state = BACKWARD;
						break;
					}
					state = BACKWARD;
					vn.push2();
					
					while (vn.toElement(VTDNav.P))
//.........这里部分代码省略.........
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:101,代码来源:LocationPathExpr.cs


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