本文整理汇总了C#中com.ximpleware.VTDNav类的典型用法代码示例。如果您正苦于以下问题:C# VTDNav类的具体用法?C# VTDNav怎么用?C# VTDNav使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VTDNav类属于com.ximpleware命名空间,在下文中一共展示了VTDNav类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: evalBoolean
/// <summary>
///
/// </summary>
/// <param name="vn"></param>
/// <returns></returns>
public override bool evalBoolean(VTDNav vn)
{
bool a = false;
vn.push2();
// record teh stack size
int size = vn.contextStack2.size;
try
{
a = (evalNodeSet(vn) != -1);
}
catch (System.Exception ee)
{
}
//rewind stack
vn.contextStack2.size = size;
reset(vn);
vn.pop2();
return a;
//}
/*if (e.Numerical)
{
double dval = e.evalNumber(vn);
if (dval == 0.0 || System.Double.IsNaN(dval))
return false;
return true;
}
String s = e.evalString(vn);
if (s == null || s.Length == 0)
return false;
return true;*/
}
示例2: bind
/// <summary>
/// attach a VTDNav instance to NodeRecorder
/// </summary>
/// <param name="vn1"></param>
public void bind(VTDNav vn1)
{
if (vn1 == null)
throw new System.ArgumentException(
"NodeRecorder can't take a null VTDNav instatnce");
vn = vn1;
}
示例3: ElementFragmentNs
protected internal ElementFragmentNs(VTDNav vn1, long l1, FastIntBuffer fib1, int len)
{
vn = vn1;
l = l1;
fib = fib1;
stLen = len;
}
示例4: bind
/// <summary> bind a BookMark object to a VTDNav object
/// the cursor position is set to an invalid state
/// </summary>
/// <param name="vn">*
/// </param>
public void bind(VTDNav vn)
{
if (vn == null)
throw new System.ArgumentException("vn can't be null");
vn1 = vn;
if (ba == null || vn.nestingLevel + 8 != ba.Length)
ba = new int[vn.nestingLevel + 8];
ba[0] = -2; // this would never happen in a VTDNav obj's context
}
示例5: reset
public void reset(VTDNav vn)
{
Alist temp = this;
while (temp != null)
{
temp.e.reset(vn);
temp = temp.next;
}
}
示例6: evalBoolean
public override bool evalBoolean(VTDNav vn)
{
// TODO Auto-generated method stub
if (cached)
{
return eb;
}
else
{
eb = e.evalBoolean(vn);
return eb;
}
}
示例7: eval
public bool eval(VTDNav vn)
{
if (vn.atTerminal)
return false;
switch (type)
{
case 0: return true;
case 1: return vn.matchElement(nodeName);
case 2: return vn.matchElementNS(URL, localName);
}
//}
return false;
}
示例8: evalNumber
public override double evalNumber(VTDNav vn)
{
// TODO Auto-generated method stub
if (cached)
{
return en;
}
else
{
cached = true;
en = e.evalNumber(vn);
return en;
}
}
示例9: eval
public bool eval(VTDNav vn)
{
if (testType == NODE)
return true;
else if (testType == NAMETEST)
{
if (vn.atTerminal == true)
return false;
if (localName != null)
return vn.matchElementNS(URL, localName);
else
return vn.matchElement(nodeName);
}
return false;
}
示例10: eval
public bool eval(VTDNav vn)
{
bool b;
count++; // increment the position
expr.Position = count;
if (expr.Numerical)
{
b = (expr.evalNumber(vn) == count);
}
else
{
b = expr.evalBoolean(vn);
}
return b;
}
示例11: evalNodeSet
public override int evalNodeSet(VTDNav vn)
{
// TODO Auto-generated method stub
int i = -1;
if (cached)
{
if (count < ens.size_Renamed_Field)
{
i = ens.intAt(count);
vn.recoverNode(i);
count++;
return i;
}
else
return -1;
}
else
{
cached = true;
if (ens == null)
{
ens = new FastIntBuffer(8);//page size 64
}
//record node set
while ((i = e.evalNodeSet(vn)) != -1)
{
ens.append(i);
}
e.reset(vn);
if (ens.size_Renamed_Field > 0)
{
i = ens.intAt(count);//count should be zero
vn.recoverNode(i);
count++;
return i;
}
else
return -1;
}
}
示例12: eval
public bool eval(VTDNav vn)
{
count++;
switch (type)
{
case simple:
if (d < count)
return false;
else if (d == count)
{
if (s != null)
{
s.out_of_range = true;
}
else
fe.out_of_range = true;
return true;
}
return false;
default:
bool b;
expr.Position = count;
if (expr.Numerical)
{
b = (expr.evalNumber(vn) == count);
}
else
{
b = expr.evalBoolean(vn);
}
if (b)
return true;
else
return false;
}
}
示例13: 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;
}
示例14: computeContextSize4Parent
protected internal int computeContextSize4Parent(Predicate p, VTDNav vn)
{
int i=0;
AutoPilot ap = (AutoPilot)currentStep.o;
vn.push2();
i = 0;
if (vn.toElement(VTDNav.PARENT)){
if (currentStep.eval(vn,p)){
i++;
}
}
vn.pop2();
currentStep.resetP(vn,p);
currentStep.out_of_range=false;
currentStep.o = ap;
return i;
}
示例15: computeContextSize4FollowingSibling
protected internal int computeContextSize4FollowingSibling(Predicate p, VTDNav vn)
{
int i=0;
//AutoPilot ap = (AutoPilot)currentStep.o;
vn.push2();
while(vn.toElement(VTDNav.NEXT_SIBLING)){
if (currentStep.eval(vn,p)){
i++;
}
}
vn.pop2();
currentStep.resetP(vn,p);
currentStep.out_of_range=false;
//currentStep.o = ap;
return i;
}