當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。