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


C# VTDNav.toRawString方法代码示例

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


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

示例1: getName

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

                if ((type == VTDNav.TOKEN_STARTING_TAG
                        || type == VTDNav.TOKEN_ATTR_NAME
                        || type == VTDNav.TOKEN_PI_NAME))
                {
                    try
                    {
                        if (vn.nameIndex != a)
                        {
                            vn.name = vn.toRawString(a);
                            vn.nameIndex = a;
                        }
                        return vn.name;
                    }
                    catch (Exception e)
                    {
                        return "";
                    }
                }
                else
                    return "";
            }
            else if (argCount1 == 1)
            {
                a = evalFirstArgumentListNodeSet2(vn);
                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
                                || type == VTDNav.TOKEN_PI_NAME)
                            return vn.toRawString(a);
                        return "";
                    }
                }
                catch (Exception e)
                {
                }
                return "";
            }
            else
                throw new System.ArgumentException
                ("name()'s argument count is invalid");

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

示例2: getLocalName

        private String getLocalName(VTDNav vn)
        {
            if (argCount1 == 0)
            {
                try
                {
                    int index = vn.getCurrentIndex();
                    int type = vn.getTokenType(index);
                    if (vn.ns && (type == VTDNav.TOKEN_STARTING_TAG
                            || type == VTDNav.TOKEN_ATTR_NAME))
                    {
                        int offset = vn.getTokenOffset(index);
                        int length = vn.getTokenLength(index);
                        if (length < 0x10000)
                        {
                            if (vn.localNameIndex != index)
                            {
                                vn.localNameIndex = index;
                                vn.localName = vn.toRawString(index);
                            }
                            return vn.localName;
                        }
                        else
                        {
                            int preLen = length >> 16;
                            int QLen = length & 0xffff;
                            if (preLen != 0)
                            {
                                if (vn.localNameIndex != index)
                                {
                                    vn.localNameIndex = index;
                                    vn.localName = vn.toRawString(offset + preLen + 1, QLen
                                            - preLen - 1);
                                }
                                return vn.localName;
                            }
                            else
                            {
                                if (vn.localNameIndex != index)
                                {
                                    vn.localNameIndex = index;
                                    vn.localName = vn.toRawString(offset, QLen);
                                }
                                return vn.localName;
                            }
                        }
                    }
                    else
                        return "";
                }
                catch (NavException e)
                {
                    return ""; // this will almost never occur
                }

            }
            else if (argCount1 == 1)
            {
                int a = evalFirstArgumentListNodeSet2(vn);

                if (a == -1 || vn.ns == false)
                    return "";
                int type = vn.getTokenType(a);
                if (type == VTDNav.TOKEN_STARTING_TAG || type == VTDNav.TOKEN_ATTR_NAME)
                {

                    try
                    {
                        int offset = vn.getTokenOffset(a);
                        int length = vn.getTokenLength(a);
                        if (length < 0x10000)
                            return vn.toRawString(a);
                        else
                        {
                            int preLen = length >> 16;
                            int QLen = length & 0xffff;
                            if (preLen != 0)
                                return vn.toRawString(offset + preLen + 1,
                                        QLen - preLen - 1);
                            else
                            {
                                return vn.toRawString(offset, QLen);
                            }
                        }
                    }

                    catch (NavException e)
                    {
                        return ""; // this will almost never occur
                    }
                }
                else if (type == VTDNav.TOKEN_PI_NAME)
                {
                    try
                    {
                        return vn.toRawString(a);
                    }
                    catch (NavException e)
                    {
                        return "";
//.........这里部分代码省略.........
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:101,代码来源:FuncExpr.cs

示例3: 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

示例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: 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

示例6: getLocalName

        private String getLocalName(VTDNav vn)
        {
            if (argCount() == 0)
            {
                try
                {
                    int index = vn.getCurrentIndex();
                    int type = vn.getTokenType(index);
                    if (vn.ns && (type == VTDNav.TOKEN_STARTING_TAG
                            || type == VTDNav.TOKEN_ATTR_NAME))
                    {
                        long offset = vn.getTokenOffset(index);
                        int length = vn.getTokenLength(index);
                        if (length < 0x10000)
                            return vn.toRawString(index);
                        else
                        {
                            int preLen = length >> 16;
                            int QLen = length & 0xffff;
                            if (preLen != 0)
                                return vn.toRawString(offset + preLen + 1, QLen
                                        - preLen - 1);
                            else
                            {
                                return vn.toRawString(offset, QLen);
                            }
                        }
                    }
                    else
                        return "";
                }
                catch (NavException e)
                {
                    return ""; // this will almost never occur
                }

            } else if (argCount() == 1)
            {
                int 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();
                }

                if (a == -1 || vn.ns == false)
                    return "";
                int type = vn.getTokenType(a);
                if (type != VTDNav.TOKEN_STARTING_TAG && type != VTDNav.TOKEN_ATTR_NAME)
                    return "";
                try
                {
                    long offset = vn.getTokenOffset(a);
                    int length = vn.getTokenLength(a);
                    if (length < 0x10000)
                        return vn.toRawString(a);
                    else
                    {
                        int preLen = length >> 16;
                        int QLen = length & 0xffff;
                        if (preLen != 0)
                            return vn.toRawString(offset + preLen + 1,
                                    QLen - preLen - 1);
                        else
                        {
                            return vn.toRawString(offset, QLen);
                        }
                    }
                }
                catch (NavException e)
                {
                    return ""; // this will almost never occur
                }
            }
            else
                throw new System.ArgumentException
                ("local-name()'s argument count is invalid");
        }
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:85,代码来源:FuncExpr.cs


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