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


C# Compiler.ToParent方法代码示例

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


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

示例1: CompileContent

        private void CompileContent(Compiler compiler) {
            NavigatorInput input = compiler.Input;
            
            if (compiler.Recurse()) {
                do {
                    Debug.Trace(input);
                    switch(input.NodeType) {
                    case XPathNodeType.Element:
                        compiler.PushNamespaceScope();
                        string nspace = input.NamespaceURI;
                        string name   = input.LocalName;

                        if (Keywords.Equals(nspace, input.Atoms.XsltNamespace) && Keywords.Equals(name, input.Atoms.WithParam)) {
                                WithParamAction par = compiler.CreateWithParamAction();
                                CheckDuplicateParams(par.Name);
                                AddAction(par);
                        }
                        else {
                            throw XsltException.UnexpectedKeyword(compiler);
                        }
                        compiler.PopScope();
                        break;
                    case XPathNodeType.Comment:
                    case XPathNodeType.ProcessingInstruction:
                    case XPathNodeType.Whitespace:
                    case XPathNodeType.SignificantWhitespace:
                        break;
                    default:
                        throw new XsltException(Res.Xslt_InvalidContents, Keywords.s_CallTemplate);
                    }
                } while(compiler.Advance());

                compiler.ToParent();
            }
        }
开发者ID:ArildF,项目名称:masters,代码行数:35,代码来源:calltemplateaction.cs

示例2: Compile

        internal override void Compile(Compiler compiler) {
            CompileAttributes(compiler);

            if (compiler.Recurse()) {
                CompileConditions(compiler);
                compiler.ToParent();
            }
        }
开发者ID:ArildF,项目名称:masters,代码行数:8,代码来源:chooseaction.cs

示例3: CheckEmpty

 public void CheckEmpty(Compiler compiler) {
     // Really EMPTY means no content atall but for compatibility with MSXML we allow whitespace
     if (compiler.Recurse()) {
         do {
             if(
                 compiler.Input.NodeType != XPathNodeType.Whitespace            &&
                 compiler.Input.NodeType != XPathNodeType.Comment               &&
                 compiler.Input.NodeType != XPathNodeType.ProcessingInstruction
             ) {
                 compiler.ToParent();
                 throw new XsltException(Res.Xslt_EmptyTagRequired, compiler.Input.LocalName);
             }
         }
         while (compiler.Advance());
         compiler.ToParent();
     }
 }
开发者ID:ArildF,项目名称:masters,代码行数:17,代码来源:compiledaction.cs

示例4: Compile

        internal override void Compile(Compiler compiler) {
            CompileAttributes(compiler);

            if (compiler.Recurse()) {
                CompileTemplate(compiler);
                compiler.ToParent();
            }
        }
开发者ID:ArildF,项目名称:masters,代码行数:8,代码来源:commentaction.cs

示例5: Compile

 internal override void Compile(Compiler compiler) {
     XPathNavigator nav = compiler.Input.Navigator.Clone();
     string name = nav.Name;
     nav.MoveToParent();
     string parent = nav.Name;
     if (compiler.Recurse()) {
         CompileSelectiveTemplate(compiler);
         compiler.ToParent();
     }
 }
开发者ID:ArildF,项目名称:masters,代码行数:10,代码来源:newinstructionaction.cs

示例6: Compile

        internal override void Compile(Compiler compiler) {
            CompileAttributes(compiler);

            if (compiler.Recurse()) {
                CompileTemplate(compiler);
                compiler.ToParent();
            }
            if (this.containedActions == null)
                this.empty = true;
                
        }
开发者ID:ArildF,项目名称:masters,代码行数:11,代码来源:copyaction.cs

示例7: Compile

        internal override void Compile(Compiler compiler) {
            CompileAttributes(compiler);
            if (this.type != ConditionType.ConditionOtherwise) {
                CheckRequiredAttribute(compiler, this.testKey != Compiler.InvalidQueryKey, Keywords.s_Test);
            }

            if (compiler.Recurse()) {
                CompileTemplate(compiler);
                compiler.ToParent();
            }
        }
开发者ID:ArildF,项目名称:masters,代码行数:11,代码来源:ifaction.cs

示例8: Compile

        internal override void Compile(Compiler compiler) {
            CompileAttributes(compiler);
            CheckRequiredAttribute(compiler, this.select, Keywords.s_Select);

            compiler.CanHaveApplyImports = false;
            if (compiler.Recurse()) {
                CompileSortElements(compiler);
                CompileTemplate(compiler);
                compiler.ToParent();
            }
        }
开发者ID:ArildF,项目名称:masters,代码行数:11,代码来源:foreachaction.cs

示例9: Compile

        internal override void Compile(Compiler compiler) {
            CompileAttributes(compiler);
            CheckRequiredAttribute(compiler, this.name, Keywords.s_Name);
            if (compiler.Recurse()) {
                CompileTemplate(compiler);
                compiler.ToParent();

                if (this.select != null && this.containedActions != null) {
                    throw new XsltException(Res.Xslt_VariableCntSel, this.nameStr, this.select);
                }
            }
        }
开发者ID:ArildF,项目名称:masters,代码行数:12,代码来源:withparamaction.cs

示例10: CompileSelectiveTemplate

 internal void CompileSelectiveTemplate(Compiler compiler){
     NavigatorInput input = compiler.Input;
     do{
         if (Keywords.Equals(input.NamespaceURI, input.Atoms.XsltNamespace) &&
             Keywords.Equals(input.LocalName, input.Atoms.Fallback)){
             fallback = true;
             if (compiler.Recurse()){
                 CompileTemplate(compiler);
                 compiler.ToParent();
             }
         }
     }
     while (compiler.Advance());
 }
开发者ID:ArildF,项目名称:masters,代码行数:14,代码来源:newinstructionaction.cs

示例11: Compile

        internal override void Compile(Compiler compiler) {
            this.stylesheetid = compiler.Stylesheetid;
            CompileAttributes(compiler);
            CheckRequiredAttribute(compiler, this.name, Keywords.s_Name);

            Debug.WriteLine("Variable inserted under the key: #" + this.varKey);

            if (compiler.Recurse()) {
                CompileTemplate(compiler);
                compiler.ToParent();

                if (this.select != null && this.containedActions != null) {
                    throw new XsltException(Res.Xslt_VariableCntSel, this.nameStr, this.select);
                }
            }

            this.varKey = compiler.InsertVariable(this);
        }
开发者ID:ArildF,项目名称:masters,代码行数:18,代码来源:variableaction.cs

示例12: Compile

        internal override void Compile(Compiler compiler) {
            CompileAttributes(compiler);
            CheckRequiredAttribute(compiler, this.nameAvt, Keywords.s_Name);

            if(this.nameAvt.IsConstant) {
                this.name    = this.nameAvt.Evaluate(null, null);
                this.nameAvt = null;
                if (! IsProcessingInstructionName(this.name)) {
                    // For Now: set to null to ignore action late;
                   this.name = null;
               }
            }

            if (compiler.Recurse()) {
                CompileTemplate(compiler);
                compiler.ToParent();
            }
        }
开发者ID:ArildF,项目名称:masters,代码行数:18,代码来源:processinginstructionaction.cs

示例13: Compile

        internal override void Compile(Compiler compiler) {
            CompileAttributes(compiler);
            if (this.match == null && this.name == null) {
                Debug.Assert(this.matchKey == Compiler.InvalidQueryKey);
                throw new XsltException(Res.Xslt_TemplateNoAttrib);
            }
            if ( this.matchKey == Compiler.InvalidQueryKey  && this.mode != null ) {
                throw new XsltException(Res.Xslt_InvalidModeAttribute);
            }
            compiler.BeginTemplate(this);

            if (compiler.Recurse()) {
                CompileParameters(compiler);
                CompileTemplate(compiler);

                compiler.ToParent();
            }

            compiler.EndTemplate();
            AnalyzePriority(compiler);
        }
开发者ID:ArildF,项目名称:masters,代码行数:21,代码来源:templateaction.cs

示例14: Compile

        internal override void Compile(Compiler compiler) {
            CompileAttributes(compiler);
            CheckRequiredAttribute(compiler, this.nameAvt, Keywords.s_Name);

            this.name  = PrecalculateAvt(ref this.nameAvt);
            this.nsUri = PrecalculateAvt(ref this.nsAvt  );

            // if both name and ns are not AVT we can calculate qname at compile time and will not need namespace manager anymore
            if (this.nameAvt == null && this.nsAvt == null) {
                if(this.name != Keywords.s_Xmlns) {
                    this.qname = CreateAttributeQName(this.name, this.nsUri, compiler.CloneScopeManager());                    
                }
            }
            else {
                this.manager = compiler.CloneScopeManager();
            }

            if (compiler.Recurse()) {
                CompileTemplate(compiler);
                compiler.ToParent();
            }
        }
开发者ID:ArildF,项目名称:masters,代码行数:22,代码来源:attributeaction.cs

示例15: CompileContent

        private void CompileContent(Compiler compiler) {
            if (compiler.Recurse()) {
                NavigatorInput input = compiler.Input;

                this.text = String.Empty;

                do {
                    switch (input.NodeType) {
                    case XPathNodeType.Text:
                    case XPathNodeType.Whitespace:
                    case XPathNodeType.SignificantWhitespace:
                        this.text += input.Value;
                        break;
                    case XPathNodeType.Comment:
                    case XPathNodeType.ProcessingInstruction:
                        break;
                    default:
                        throw XsltException.UnexpectedKeyword(compiler);
                    }
                } while(compiler.Advance());
                compiler.ToParent();
            }
        }
开发者ID:ArildF,项目名称:masters,代码行数:23,代码来源:textaction.cs


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