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


C# VTDNav.toString方法代码示例

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


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

示例1: evalString

        public override System.String evalString(VTDNav vn)
        {
            String s = "";
            int a = -1;
            vn.push2();
            int size = vn.contextStack2.size;
            try
            {
                a = evalNodeSet(vn);
                if (a != -1)
                {
                    int t = vn.getTokenType(a);
                    switch (t)
                    {
                        case VTDNav.TOKEN_STARTING_TAG:
                        case VTDNav.TOKEN_DOCUMENT:
                            s = vn.getXPathStringVal2(a,(short)0);
                            break;
                        case VTDNav.TOKEN_ATTR_NAME:
                            s = vn.toString(a + 1);
                            break;
                        case VTDNav.TOKEN_PI_NAME:
                            //if (a + 1 < vn.vtdSize
                            //		|| vn.getTokenType(a + 1) == VTDNav.TOKEN_PI_VAL)
                            s = vn.toString(a + 1);
                            break;
                        default:
                            s = vn.toString(a);
                            break;
                    }
                }
            }
            catch (Exception e)
            {

            }
            vn.contextStack2.size = size;
            reset(vn);
            vn.pop2();
            return s;
        }
开发者ID:jzhang2004,项目名称:vtd-xml,代码行数:41,代码来源:LocationPathExpr.cs

示例2: getNameSpaceURI

        private String getNameSpaceURI(VTDNav vn)
        {
            if (argCount1 == 0)
            {
                try
                {
                    int i = vn.getCurrentIndex();
                    int type = vn.getTokenType(i);

                    if (vn.ns && (type == VTDNav.TOKEN_STARTING_TAG
                            || type == VTDNav.TOKEN_ATTR_NAME))
                    {
                        int a = vn.lookupNS();
                        if (a == 0)
                            return "";
                        else
                            return vn.toString(a);
                    }
                    return "";
                }
                catch (Exception e)
                {
                    return "";
                }
            }
            else if (argCount1 == 1 && argumentList.e.NodeSet)
            {
                vn.push2();
                int size = vn.contextStack2.size;
                int a = -1;
                try
                {
                    a = argumentList.e.evalNodeSet(vn);
                }
                catch (Exception e)
                {
                }
                String s = "";
                // return a;
                try
                {
                    if (a == -1 || vn.ns == false)
                    { }
                    else
                    {
                        int type = vn.getTokenType(a);
                        if (type == VTDNav.TOKEN_STARTING_TAG
                                || type == VTDNav.TOKEN_ATTR_NAME)
                            s = vn.toString(vn.lookupNS());

                    }
                }
                catch (Exception e) { };
                vn.contextStack2.size = size;
                argumentList.e.reset(vn);
                vn.pop2();
                return s;

            }
            else
                throw new System.ArgumentException
                ("namespace-uri()'s argument count is invalid");
        }
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:63,代码来源:FuncExpr.cs

示例3: evalNodeSet

        public override int evalNodeSet(VTDNav vn)
        {
            switch (opCode)
            {
                case FuncName.CURRENT:
                    if (state == START)
                    {
                        vn.loadCurrentNode();
                        state = END;
                        return vn.getCurrentIndex2();
                    }
                    else
                    {
                        return -1;
                    }
                // break;
                case FuncName.DOCUMENT:
                    if (argCount1 == 1)
                    {
                        if (!argumentList.e.NodeSet)
                        {
                            if (state == START)
                            {
                                String s = argumentList.e.evalString(vn);
                                if (s.Length == 0)
                                {
                                    newVN = xslVN;
                                    newVN.context[0] = -1;
                                }
                                else if (vg.parseFile(s, true))
                                {
                                    newVN = vg.getNav();
                                    newVN.context[0] = -1;
                                    newVN.URIName = s;
                                }
                                else
                                {
                                    state = END;
                                    return -1;
                                }
                                state = END;
                                return 0;
                            }
                            else
                            {
                                return -1;
                            }
                        }
                        else
                        {
                            try
                            {
                                if (state != END)
                                {
                                    a = argumentList.e.evalNodeSet(vn);
                                    if (a != -1)
                                    {
                                        String s = vn.toString(getStringVal(vn, a));
                                        if (s.Length == 0)
                                        {
                                            newVN = xslVN;
                                            newVN.context[0] = -1;
                                        }
                                        else if (vg.parseFile(s, true))
                                        {
                                            newVN = vg.getNav();
                                            newVN.context[0] = -1;
                                            newVN.URIName = s;
                                        }
                                        else
                                        {
                                            state = END;
                                            return -1;
                                        }
                                        state = END;
                                        return 0;
                                    }
                                    else
                                    {
                                        state = END;
                                        return -1;
                                    }
                                }
                                else
                                    return -1;
                            }
                            catch (NavException e)
                            {

                            }
                        }
                    }

                    break;
                case FuncName.KEY:
                    throw new XPathEvalException(" key() not yet implemented ");
                // break;
            }
            throw new XPathEvalException(" Function Expr can't eval to node set ");
        }
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:100,代码来源:FuncExpr.cs

示例4: normalizeSpace

        private System.String normalizeSpace(VTDNav vn)
        {
            if (argCount1 == 0)
            {
                String s = null;
                try
                {
                    if (vn.atTerminal)
                    {
                        int ttype = vn.getTokenType(vn.LN);
                        if (ttype == VTDNav.TOKEN_CDATA_VAL)
                            s = vn.toRawString(vn.LN);
                        else if (ttype == VTDNav.TOKEN_ATTR_NAME ||
                             ttype == VTDNav.TOKEN_ATTR_NS)
                        {
                            s = vn.toString(vn.LN + 1);
                        }
                        else
                            s = vn.toString(vn.LN);
                    }
                    else
                    {
                        int i = vn.getCurrentIndex();
                        int t = vn.getTokenType(i);
                        if (t == VTDNav.TOKEN_STARTING_TAG || t == VTDNav.TOKEN_DOCUMENT)
                        {
                            s = vn.toNormalizedXPathString(i);
                        }
                        else
                            s = vn.toNormalizedString(i);
                    }
                    return normalize(s);
                }
                catch (NavException e)
                {
                    return ""; // this will almost never occur
                }
            }
            else if (argCount1 == 1)
            {
                String s = "";
                if (argumentList.e.NodeSet)
                {
                    //boolean b = false;
                    int a = evalFirstArgumentListNodeSet(vn);
                    if (a == -1)
                        return "";
                    else
                    {
                        try
                        {
                            int t = vn.getTokenType(a);
                            if (t == VTDNav.TOKEN_STARTING_TAG || t == VTDNav.TOKEN_DOCUMENT)
                            {
                                s = vn.toNormalizedXPathString(a);
                            }
                            else
                                s = vn.toNormalizedString(a);
                        }
                        catch (Exception e)
                        {
                        }
                        return s;
                    }
                }
                else
                {
                    s = argumentList.e.evalString(vn);
                    return normalize(s);
                }
	        
            }
            throw new System.ArgumentException("normalize-space()'s argument count is invalid");
            //return null;
        }
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:75,代码来源:FuncExpr.cs

示例5: getString

 private String getString(VTDNav vn)
 {
     if (argCount1 == 0)
         try
         {
             if (vn.atTerminal)
             {
                 if (vn.getTokenType(vn.LN) == VTDNav.TOKEN_CDATA_VAL)
                     return vn.toRawString(vn.LN);
                 return vn.toString(vn.LN);
             }
             return vn.getXPathStringVal();
         }
         catch (NavException e)
         {
             return null; // this will almost never occur
         }
     else if (argCount1 == 1)
     {
         return argumentList.e.evalString(vn);
     }
     else
         throw new System.ArgumentException("String()'s argument count is invalid");
 }
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:24,代码来源:FuncExpr.cs

示例6: evalString

        /*
        * (non-Javadoc)
        *
        * @see com.ximpleware.xpath.Expr#evalString(com.ximpleware.VTDNav)
        */
        public override System.String evalString(VTDNav vn)
        {
            if (e.NodeSet == false)
                return e.evalString(vn);
            else
            {
                String s = "";
                int a = -1;
                vn.push2();
                int size = vn.contextStack2.size;
                try
                {
                    a = evalNodeSet(vn);
                    if (a != -1)
                    {
                        int t = vn.getTokenType(a);
                        switch (t)
                        {
                            case VTDNav.TOKEN_STARTING_TAG:
                            case VTDNav.TOKEN_DOCUMENT:
                                s = vn.getXPathStringVal();
                                break;
                            case VTDNav.TOKEN_ATTR_NAME:
                                s = vn.toString(a + 1);
                                break;
                            case VTDNav.TOKEN_PI_NAME:
                                //if (a + 1 < vn.vtdSize
                                //        || vn.getTokenType(a + 1) == VTDNav.TOKEN_PI_VAL)
                                s = vn.toString(a + 1);
                                break;
                            default:
                                s = vn.toString(a);
                                break;
                        }
                        /*if (t == VTDNav.TOKEN_ATTR_NAME) {
                            s = vn.toString(a + 1);
                        } else if (t == VTDNav.TOKEN_STARTING_TAG
                                || t == VTDNav.TOKEN_DOCUMENT) {
                            s = vn.getXPathStringVal();
                        } else if (t == VTDNav.TOKEN_PI_NAME) {
                            if (a + 1 < vn.vtdSize
                                    || vn.getTokenType(a + 1) == VTDNav.TOKEN_PI_VAL)
                                s = vn.toString(a + 1);
                            // s = vn.toString(a+1);
                        } else
                            s = vn.toString(a);*/
                    }
                }
                catch (Exception ee)
                {

                }
                vn.contextStack2.size = size;
                reset(vn);
                vn.pop2();
                return s;
            }
        }
开发者ID:DuLerWeil,项目名称:vtd-xml,代码行数:63,代码来源:UnionExpr.cs

示例7: evalString

        public override System.String evalString(VTDNav vn)
        {
            String s = "";
            int a = 0x7fffffff, k = -1;
            vn.push2();
            int size = vn.contextStack2.size;
            try
            {
                //a = evalNodeSet(vn);
                if (needReordering)
                {
                    while ((k = evalNodeSet(vn)) != -1)
                    {
                        // a = evalNodeSet(vn);
                        if (k < a)
                            a = k;
                    }
                    if (a == 0x7fffffff)
                        a = -1;
                }
                else
                {
                    a = evalNodeSet(vn);
                }
                if (a != -1)
                {
                    int t = vn.getTokenType(a);
                    switch (t)
                    {
                        case VTDNav.TOKEN_STARTING_TAG:
                        case VTDNav.TOKEN_DOCUMENT:
                            s = vn.getXPathStringVal();
                            break;
                        case VTDNav.TOKEN_ATTR_NAME:
                            s = vn.toString(a + 1);
                            break;
                        case VTDNav.TOKEN_PI_NAME:
                            //if (a + 1 < vn.vtdSize
                            //		|| vn.getTokenType(a + 1) == VTDNav.TOKEN_PI_VAL)
                            s = vn.toString(a + 1);
                            break;
                        default:
                            s = vn.toString(a);
                            break;
                    }
                }
            }
            catch (Exception e)
            {

            }
            vn.contextStack2.size = size;
            reset(vn);
            vn.pop2();
            return s;
        }
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:56,代码来源:FilterExpr.cs

示例8: normalizeSpace

 private System.String normalizeSpace(VTDNav vn)
 {
     if (argCount() == 0)
     {
         String s = null;
         try
         {
             if (vn.atTerminal)
             {
                 int ttype = vn.getTokenType(vn.LN);
                 if (ttype == VTDNav.TOKEN_CDATA_VAL)
                     s = vn.toRawString(vn.LN);
                 else if (ttype == VTDNav.TOKEN_ATTR_NAME ||
                      ttype == VTDNav.TOKEN_ATTR_NS)
                 {
                     s = vn.toString(vn.LN + 1);
                 }
                 else
                     s = vn.toString(vn.LN);
             }else
                 s = vn.toString(vn.getCurrentIndex());
             return normalize(s);
         }
         catch (NavException e)
         {
             return ""; // this will almost never occur
         }
     }
     else if (argCount() == 1)
     {
         String s = argumentList.e.evalString(vn);
         return normalize(s);
     }
     throw new System.ArgumentException("normalize-space()'s argument count is invalid");
     //return null;
 }
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:36,代码来源:FuncExpr.cs

示例9: getName

        private String getName(VTDNav vn)
        {
            int a;
            if (argCount() == 0)
            {
                a = vn.getCurrentIndex();
                int type = vn.getTokenType(a);

                if ((type == VTDNav.TOKEN_STARTING_TAG
                        || type == VTDNav.TOKEN_ATTR_NAME))
                {
                    try
                    {
                        return vn.toString(a);
                    }
                    catch (Exception e)
                    {
                        return "";
                    }
                }
                else
                    return "";
            }
            else if (argCount() == 1)
            {
                a = -1;
                vn.push2();
                try
                {
                    a = argumentList.e.evalNodeSet(vn);
                    argumentList.e.reset(vn);
                    vn.pop2();
                }
                catch (Exception e)
                {
                    argumentList.e.reset(vn);
                    vn.pop2();
                }
                try
                {
                    if (a == -1 || vn.ns == false)
                        return "";
                    else
                    {
                        int type = vn.getTokenType(a);
                        if (type == VTDNav.TOKEN_STARTING_TAG
                                || type == VTDNav.TOKEN_ATTR_NAME)
                            return vn.toString(a);
                        return "";
                    }
                }
                catch (Exception e)
                {
                }
                return "";
            }
            else
                throw new System.ArgumentException
                ("name()'s argument count is invalid");

        }
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:61,代码来源:FuncExpr.cs

示例10: evalString

		public override System.String evalString(VTDNav vn)
		{
			vn.push2();
			int size = vn.contextStack2.size;
			int a = - 1;
			try
			{
				a = evalNodeSet(vn);
				if (a != - 1)
				{
					if (vn.getTokenType(a) == VTDNav.TOKEN_ATTR_NAME)
					{
						a++;
					}
					if (vn.getTokenType(a) == VTDNav.TOKEN_STARTING_TAG)
					{
						a = vn.getText();
					}
				}
			}
			catch (System.Exception e)
			{
			}
			vn.contextStack2.size = size;
			reset(vn);
			vn.pop2();
			try
			{
				if (a != - 1)
					return vn.toString(a);
			}
			catch (NavException e)
			{
			}
			return "";
		}
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:36,代码来源:FilterExpr.cs


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