本文整理汇总了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");
}
示例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 "";
//.........这里部分代码省略.........
示例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");
}
示例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;
}
示例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;
}
示例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");
}