本文整理汇总了C#中System.Xml.Xsl.XsltOld.Processor.Matches方法的典型用法代码示例。如果您正苦于以下问题:C# Processor.Matches方法的具体用法?C# Processor.Matches怎么用?C# Processor.Matches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Xsl.XsltOld.Processor
的用法示例。
在下文中一共展示了Processor.Matches方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindTemplate
internal TemplateAction FindTemplate(Processor processor, XPathNavigator navigator) {
if (this.templates == null) {
return null;
}
Debug.Assert(this.templates != null);
for (int templateIndex = this.templates.Count - 1; templateIndex >= 0 ; templateIndex --) {
TemplateAction action = (TemplateAction) this.templates[templateIndex];
int matchKey = action.MatchKey;
if (matchKey != Compiler.InvalidQueryKey) {
if (processor.Matches(navigator, matchKey)) {
return action;
}
}
}
return null;
}
示例2: MatchCountKey
private bool MatchCountKey(Processor processor, XPathNavigator contextNode, XPathNavigator nav){
if (this.countKey != Compiler.InvalidQueryKey) {
return processor.Matches(nav, this.countKey);
}
if (contextNode.Name == nav.Name && BasicNodeType(contextNode.NodeType) == BasicNodeType(nav.NodeType)) {
return true;
}
return false;
}
示例3: moveToCount
private bool moveToCount(XPathNavigator nav, Processor processor, XPathNavigator contextNode) {
do {
if (this.fromKey != Compiler.InvalidQueryKey && processor.Matches(nav, this.fromKey)) {
return false;
}
if (MatchCountKey(processor, contextNode, nav)) {
return true;
}
}while (nav.MoveToParent());
return false;
}
示例4: checkFrom
// check 'from' condition:
// if 'from' exist it has to be ancestor-or-self for the nav
private bool checkFrom(Processor processor, XPathNavigator nav) {
if(this.fromKey == Compiler.InvalidQueryKey) {
return true;
}
do {
if (processor.Matches(nav, this.fromKey)) {
return true;
}
}while (nav.MoveToParent());
return false;
}
示例5: numberAny
private int numberAny(Processor processor, ActionFrame frame) {
int result = 0;
// Our current point will be our end point in this search
XPathNavigator endNode = frame.Node;
if(endNode.NodeType == XPathNodeType.Attribute || endNode.NodeType == XPathNodeType.Namespace) {
endNode = endNode.Clone();
endNode.MoveToParent();
}
XPathNavigator startNode = endNode.Clone();
if(this.fromKey != Compiler.InvalidQueryKey) {
bool hitFrom = false;
// First try to find start by traversing up. This gives the best candidate or we hit root
do{
if(processor.Matches(startNode, this.fromKey)) {
hitFrom = true;
break;
}
}while(startNode.MoveToParent());
Debug.Assert(
processor.Matches(startNode, this.fromKey) || // we hit 'from' or
startNode.NodeType == XPathNodeType.Root // we are at root
);
// from this point (matched parent | root) create descendent quiery:
// we have to reset 'result' on each 'from' node, because this point can' be not last from point;
XPathNodeIterator sel = startNode.SelectDescendants(XPathNodeType.All, /*matchSelf:*/ true);
while (sel.MoveNext()) {
if(processor.Matches(sel.Current, this.fromKey)) {
hitFrom = true;
result = 0;
}
else if(MatchCountKey(processor, frame.Node, sel.Current)) {
result ++;
}
if(sel.Current.IsSamePosition(endNode)) {
break;
}
}
if(! hitFrom) {
result = 0;
}
}
else {
// without 'from' we startting from the root
startNode.MoveToRoot();
XPathNodeIterator sel = startNode.SelectDescendants(XPathNodeType.All, /*matchSelf:*/ true);
// and count root node by itself
while (sel.MoveNext()) {
if (MatchCountKey(processor, frame.Node, sel.Current)) {
result ++;
}
if (sel.Current.IsSamePosition(endNode)) {
break;
}
}
}
return result;
}
示例6: PreserveWhiteSpace
internal bool PreserveWhiteSpace(Processor proc, XPathNavigator node){
// last one should win. I.E. We starting from the end. I.E. Lowest priority should go first
if (this.whitespaceList != null) {
for (int i = this.whitespaceList.Count - 1; 0 <= i; i --) {
WhitespaceElement elem = (WhitespaceElement) this.whitespaceList[i];
if (proc.Matches(node, elem.Key)) {
return elem.PreserveSpace;
}
}
}
if (this.imports != null) {
for (int importIndex = this.imports.Count - 1; importIndex >= 0; importIndex --) {
Stylesheet stylesheet = (Stylesheet) this.imports[importIndex];
if (! stylesheet.PreserveWhiteSpace(proc, node))
return false;
}
}
return true;
}