本文整理汇总了C#中System.Xml.Xsl.Compiler.IsExtensionNamespace方法的典型用法代码示例。如果您正苦于以下问题:C# Compiler.IsExtensionNamespace方法的具体用法?C# Compiler.IsExtensionNamespace怎么用?C# Compiler.IsExtensionNamespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Xsl.Compiler
的用法示例。
在下文中一共展示了Compiler.IsExtensionNamespace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompileLiteralAttributesAndNamespaces
void CompileLiteralAttributesAndNamespaces(Compiler compiler) {
NavigatorInput input = compiler.Input;
if (input.Navigator.MoveToAttribute(Keywords.s_UseAttributeSets, input.Atoms.XsltNamespace)) {
AddAction(compiler.CreateUseAttributeSetsAction());
input.Navigator.MoveToParent();
}
compiler.InsertExcludedNamespace();
if (input.MoveToFirstAttribute()) {
do {
// Skip everything from Xslt namespace
if (Keywords.Equals(input.NamespaceURI, input.Atoms.XsltNamespace)) {
continue;
}
// Add attribute events
this.AddEvent (compiler.CreateBeginEvent());
this.AddEvents(compiler.CompileAvt(input.Value));
this.AddEvent (new EndEvent(XPathNodeType.Attribute));
}
while (input.MoveToNextAttribute());
input.ToParent();
}
if (input.MoveToFirstNamespace()) {
do {
string uri = input.Value;
if (Keywords.Compare(uri, input.Atoms.XsltNamespace)) {
continue;
}
if (
compiler.IsExcludedNamespace(uri) ||
compiler.IsExtensionNamespace(uri) ||
compiler.IsNamespaceAlias(uri)
) {
continue;
}
this.AddEvent(new NamespaceEvent(input));
}
while (input.MoveToNextNamespace());
input.ToParent();
}
}
示例2: Compile
protected override void Compile (Compiler c)
{
if (c.Debugger != null)
c.Debugger.DebugCompile (this.DebugInput);
hasStack = (c.CurrentVariableScope == null);
c.PushScope ();
do {
Debug.EnterNavigator (c);
XPathNavigator n = c.Input;
switch (n.NodeType) {
case XPathNodeType.Element:
switch (n.NamespaceURI) {
case XsltNamespace:
switch (n.LocalName) {
case "apply-imports":
content.Add (new XslApplyImports (c));
break;
case "apply-templates":
content.Add (new XslApplyTemplates (c));
break;
case "attribute":
if (ParentType == XPathNodeType.All
|| ParentType == XPathNodeType.Element)
content.Add (new XslAttribute (c));
break;
case "call-template":
content.Add (new XslCallTemplate (c));
break;
case "choose":
content.Add (new XslChoose (c));
break;
case "comment":
if (ParentType == XPathNodeType.All
|| ParentType == XPathNodeType.Element)
content.Add (new XslComment (c));
break;
case "copy":
content.Add (new XslCopy (c));
break;
case "copy-of":
content.Add (new XslCopyOf (c));
break;
case "element":
if (ParentType == XPathNodeType.All
|| ParentType == XPathNodeType.Element)
content.Add (new XslElement (c));
break;
case "fallback":
break;
case "for-each":
content.Add (new XslForEach (c));
break;
case "if":
content.Add (new XslIf (c));
break;
case "message":
content.Add (new XslMessage(c));
break;
case "number":
content.Add (new XslNumber(c));
break;
case "processing-instruction":
if (ParentType == XPathNodeType.All
|| ParentType == XPathNodeType.Element)
content.Add (new XslProcessingInstruction(c));
break;
case "text":
content.Add (new XslText(c, false));
break;
case "value-of":
content.Add (new XslValueOf(c));
break;
case "variable":
content.Add (new XslLocalVariable (c));
break;
case "sort":
if (xslForEach)
break;
throw new XsltCompileException ("'sort' element is not allowed here as a templete content", null, n);
default:
// TODO: handle fallback, like we should
// throw new XsltCompileException ("Did not recognize element " + n.Name, null, n);
content.Add (new XslNotSupportedOperation (c));
break;
}
break;
default:
if (!c.IsExtensionNamespace (n.NamespaceURI))
content.Add (new XslLiteralElement(c));
else {
if (n.MoveToFirstChild ()) {
do {
if (n.NamespaceURI == XsltNamespace && n.LocalName == "fallback")
content.Add (new XslFallback (c));
} while (n.MoveToNext ());
n.MoveToParent ();
}
}
//.........这里部分代码省略.........
示例3: CompileOnceTemplate
protected void CompileOnceTemplate(Compiler compiler) {
NavigatorInput input = compiler.Input;
Debug.Trace(input);
if (input.NodeType == XPathNodeType.Element) {
string nspace = input.NamespaceURI;
if (Keywords.Equals(nspace, input.Atoms.XsltNamespace)) {
compiler.PushNamespaceScope();
CompileInstruction(compiler);
compiler.PopScope();
}
else {
compiler.PushLiteralScope();
compiler.InsertExtensionNamespace();
if (compiler.IsExtensionNamespace(nspace)) {
AddAction(compiler.CreateNewInstructionAction());
}
else {
CompileLiteral(compiler);
}
compiler.PopScope();
}
}
else {
CompileLiteral(compiler);
}
}