本文整理汇总了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;
}
}