本文整理匯總了C#中System.Xml.Xsl.Compiler.CreateTextEvent方法的典型用法代碼示例。如果您正苦於以下問題:C# Compiler.CreateTextEvent方法的具體用法?C# Compiler.CreateTextEvent怎麽用?C# Compiler.CreateTextEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Xsl.Compiler
的用法示例。
在下文中一共展示了Compiler.CreateTextEvent方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CompileSortElements
protected void CompileSortElements(Compiler compiler) {
NavigatorInput input = compiler.Input;
do {
switch(input.NodeType) {
case XPathNodeType.Element:
if (Keywords.Equals(input.NamespaceURI, input.Atoms.XsltNamespace) &&
Keywords.Equals(input.LocalName, input.Atoms.Sort)) {
if (sortContainer == null) {
sortContainer = new ContainerAction();
sort = true;
}
sortContainer.AddAction(compiler.CreateSortAction());
continue;
}
return;
case XPathNodeType.Text:
return;
case XPathNodeType.SignificantWhitespace:
this.AddEvent(compiler.CreateTextEvent());
continue;
default :
continue;
}
}
while (input.Advance());
}
示例2: CompileParameters
protected void CompileParameters(Compiler compiler) {
NavigatorInput input = compiler.Input;
do {
switch(input.NodeType) {
case XPathNodeType.Element:
if (Keywords.Equals(input.NamespaceURI, input.Atoms.XsltNamespace) &&
Keywords.Equals(input.LocalName, input.Atoms.Param)) {
compiler.PushNamespaceScope();
AddAction(compiler.CreateVariableAction(VariableType.LocalParameter));
compiler.PopScope();
continue;
}
else {
return;
}
case XPathNodeType.Text:
return;
case XPathNodeType.SignificantWhitespace:
this.AddEvent(compiler.CreateTextEvent());
continue;
default :
continue;
}
}
while (input.Advance());
}
示例3: CompileLiteral
void CompileLiteral(Compiler compiler) {
NavigatorInput input = compiler.Input;
Debug.WriteLine("Node type: \"" + (int) input.NodeType + "\"");
Debug.WriteLine("Node name: \"" + input.LocalName + "\"");
switch (input.NodeType) {
case XPathNodeType.Element:
Debug.TraceElement(input);
this.AddEvent(compiler.CreateBeginEvent());
CompileLiteralAttributesAndNamespaces(compiler);
if (compiler.Recurse()) {
CompileTemplate(compiler);
compiler.ToParent();
}
this.AddEvent(new EndEvent(XPathNodeType.Element));
break;
case XPathNodeType.Text:
case XPathNodeType.SignificantWhitespace:
this.AddEvent(compiler.CreateTextEvent());
break;
case XPathNodeType.Whitespace:
case XPathNodeType.ProcessingInstruction:
case XPathNodeType.Comment:
break;
default:
Debug.Assert(false, "Unexpected node type.");
break;
}
}