当前位置: 首页>>代码示例>>C#>>正文


C# Compiler.PushScope方法代码示例

本文整理汇总了C#中System.Xml.Xsl.Compiler.PushScope方法的典型用法代码示例。如果您正苦于以下问题:C# Compiler.PushScope方法的具体用法?C# Compiler.PushScope怎么用?C# Compiler.PushScope使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.Xsl.Compiler的用法示例。


在下文中一共展示了Compiler.PushScope方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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 ();
							}
						}
//.........这里部分代码省略.........
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:101,代码来源:XslTemplateContent.cs


注:本文中的System.Xml.Xsl.Compiler.PushScope方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。