當前位置: 首頁>>代碼示例>>C#>>正文


C# Compiler.CreateXPathQName方法代碼示例

本文整理匯總了C#中System.Xml.Xsl.Compiler.CreateXPathQName方法的典型用法代碼示例。如果您正苦於以下問題:C# Compiler.CreateXPathQName方法的具體用法?C# Compiler.CreateXPathQName怎麽用?C# Compiler.CreateXPathQName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.Xsl.Compiler的用法示例。


在下文中一共展示了Compiler.CreateXPathQName方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CompileAttribute

        internal override bool CompileAttribute(Compiler compiler) {
            string name   = compiler.Input.LocalName;
            string value  = compiler.Input.Value;
            if (Keywords.Equals(name, compiler.Atoms.Name)) {
                Debug.Assert(this.name == null);
                this.name = compiler.CreateXPathQName(value);
                Debug.WriteLine("Name attribute found: " + this.name);
            }
            else {
                return false;
            }

            return true;
        }
開發者ID:ArildF,項目名稱:masters,代碼行數:14,代碼來源:calltemplateaction.cs

示例2: CompileAttribute

        internal override bool CompileAttribute(Compiler compiler) {
            string name   = compiler.Input.LocalName;
            string value  = compiler.Input.Value;
            if (Keywords.Equals(name, compiler.Atoms.Name)) {
                Debug.Assert(this.name == null);
                this.name = compiler.CreateXPathQName(value);
                Debug.WriteLine("name attribute found: " + this.name);
            }
            else if (Keywords.Equals(name, compiler.Atoms.UseAttributeSets)) {
                // create a UseAttributeSetsAction
                // sets come before xsl:attributes
                AddAction(compiler.CreateUseAttributeSetsAction());
            }
            else {
                return false;
            }

            return true;
        }
開發者ID:ArildF,項目名稱:masters,代碼行數:19,代碼來源:attributesetaction.cs

示例3: Compile

        internal override void Compile(Compiler compiler) {
            Debug.Assert(Keywords.Equals(compiler.Input.LocalName, compiler.Atoms.UseAttributeSets));
            this.useString = compiler.Input.Value;

            Debug.Assert(this.useAttributeSets == null);

            if (this.useString.Length == 0) {
                // Split creates empty node is spliting empty string
                this.useAttributeSets = new XmlQualifiedName[0];
                return ;
            }

            string[] qnames = Compiler.SplitString(this.useString);

            this.useAttributeSets = new XmlQualifiedName[qnames.Length]; {
                for (int i = 0; i < qnames.Length; i++) {
                    this.useAttributeSets[i] = compiler.CreateXPathQName(qnames[i]);
                }
            }
        }
開發者ID:ArildF,項目名稱:masters,代碼行數:20,代碼來源:useattributesetsaction.cs

示例4: CompileAttribute

        internal override bool CompileAttribute(Compiler compiler) {
            string name   = compiler.Input.LocalName;
            string value  = compiler.Input.Value;
            if (Keywords.Equals(name, compiler.Atoms.Select )) {
                this.select    = value;
                this.selectKey = compiler.AddQuery(this.select);
                Debug.WriteLine("apply-templates select: \"" + this.select + "\" (#" + this.selectKey.ToString() + ")");
            }
            else if (Keywords.Equals(name, compiler.Atoms.Mode )) {
                Debug.Assert(this.mode == null);
                if (compiler.AllowBuiltInMode && value.Trim() == "*") {
                    this.mode = Compiler.BuiltInMode;
                }
                else {
                    this.mode = compiler.CreateXPathQName(value);
                }
                Debug.WriteLine("mode attribute found: \"" + this.mode + "\"");
            }
            else {
                return false;
            }

            return true;
        }
開發者ID:ArildF,項目名稱:masters,代碼行數:24,代碼來源:applytemplatesaction.cs

示例5: CompileAttribute

        internal override bool CompileAttribute(Compiler compiler) {
            string name   = compiler.Input.LocalName;
            string value  = compiler.Input.Value;

            if (Keywords.Equals(name, compiler.Atoms.Name)) {
                Debug.Assert(this.name == null && this.nameStr == null);
                this.nameStr = value;
                this.name    = compiler.CreateXPathQName(this.nameStr);
                Debug.WriteLine("name attribute found: " + this.name);
            }
            else if (Keywords.Equals(name, compiler.Atoms.Select)) {
                Debug.Assert(this.select == null);
                this.select    = value;
                this.selectKey = compiler.AddQuery(this.select);
                Debug.WriteLine("select attribute = \"" + this.select + "\"  (#" + this.selectKey + ")");
            }
            else {
                return false;
            }

            return true;
        }
開發者ID:ArildF,項目名稱:masters,代碼行數:22,代碼來源:variableaction.cs

示例6: CompileAttribute

        internal override bool CompileAttribute(Compiler compiler) {
            string name   = compiler.Input.LocalName;
            string value  = compiler.Input.Value;

            if (Keywords.Equals(name, compiler.Atoms.Match)) {
                Debug.Assert(this.match == null);
                this.match    = value;
                this.matchKey = compiler.AddPatternQuery(value, /*allowVars:*/false, /*allowKey:*/true);
                Debug.WriteLine("match attribute found: \"" + this.match + "\"  (#" + this.matchKey + ")");
            }
            else if (Keywords.Equals(name, compiler.Atoms.Name)) {
                Debug.Assert(this.name == null);
                this.name = compiler.CreateXPathQName(value);
                Debug.WriteLine("name attribute found: " + this.name);
            }
            else if (Keywords.Equals(name, compiler.Atoms.Priority)) {
                Debug.Assert(Double.IsNaN(this.priority));
                this.priority = XmlConvert.ToXPathDouble(value);
                if (double.IsNaN(this.priority) && ! compiler.ForwardCompatibility) {
                    throw XsltException.InvalidAttrValue(Keywords.s_Priority, value);
                }
            }
            else if (Keywords.Equals(name, compiler.Atoms.Mode)) {
                Debug.Assert(this.mode == null);
                if (compiler.AllowBuiltInMode && value.Trim() == "*") {
                    this.mode = Compiler.BuiltInMode;
                }
                else {
                    this.mode = compiler.CreateXPathQName(value);
                }
                Debug.WriteLine("mode attribute found: " + this.mode);
            }
            else {
                return false;
            }

            return true;
        }
開發者ID:ArildF,項目名稱:masters,代碼行數:38,代碼來源:templateaction.cs

示例7: ParseOutputMethod

 private static OutputMethod ParseOutputMethod(string value, Compiler compiler) {
     XmlQualifiedName method = compiler.CreateXPathQName(value);
     if(method.Namespace != string.Empty) {
         return OutputMethod.Other;
     }
     switch(method.Name) {
     case Keywords.s_Xml  : 
         return OutputMethod.Xml ;
     case Keywords.s_Html : 
         return OutputMethod.Html;
     case Keywords.s_Text : 
         return OutputMethod.Text;
     default :
         if (compiler.ForwardCompatibility) {
             return OutputMethod.Unknown;
         }
         throw XsltException.InvalidAttrValue(Keywords.s_Method, value);
     }
 }
開發者ID:ArildF,項目名稱:masters,代碼行數:19,代碼來源:xsltoutput.cs

示例8: CompileDecimalFormat

        protected void CompileDecimalFormat(Compiler compiler){
            NumberFormatInfo info   = new NumberFormatInfo();
            DecimalFormat    format = new DecimalFormat(info, '#', '0', ';');
            XmlQualifiedName  Name  = null;
            NavigatorInput   input  = compiler.Input;
            if (input.MoveToFirstAttribute()) {
                do {
                    Debug.TraceAttribute(input);

                    if (! Keywords.Equals(input.Prefix, input.Atoms.Empty)) continue;

                    string name   = input.LocalName;
                    string value  = input.Value;

                    if (Keywords.Equals(name, input.Atoms.Name)) {
                        Name = compiler.CreateXPathQName(value);
                    }
                    else if (Keywords.Equals(name, input.Atoms.DecimalSeparator)) {
                        info.NumberDecimalSeparator = value;
                    }
                    else if (Keywords.Equals(name, input.Atoms.GroupingSeparator)) {
                        info.NumberGroupSeparator = value;
                    }
                    else if (Keywords.Equals(name, input.Atoms.Infinity)) {
                        info.PositiveInfinitySymbol = value;
                    }
                    else if (Keywords.Equals(name, input.Atoms.MinusSign)) {
                        info.NegativeSign = value;
                    }
                    else if (Keywords.Equals(name, input.Atoms.NaN)) {
                        info.NaNSymbol = value;
                    }
                    else if (Keywords.Equals(name, input.Atoms.Percent)) {
                        info.PercentSymbol = value;
                    }
                    else if (Keywords.Equals(name, input.Atoms.PerMille)) {
                        info.PerMilleSymbol = value;
                    }
                    else if (Keywords.Equals(name, input.Atoms.Digit)) {
                        if (CheckAttribute(value.Length == 1, compiler)) {
                            format.digit = value[0];
                        }   
                    }
                    else if (Keywords.Equals(name, input.Atoms.ZeroDigit)) {
                        if (CheckAttribute(value.Length == 1, compiler)) {
                            format.zeroDigit = value[0];
                        }   
                    }
                    else if (Keywords.Equals(name, input.Atoms.PatternSeparator)) {
                        if (CheckAttribute(value.Length == 1, compiler)) {
                            format.patternSeparator = value[0];
                        }   
                    }
                }
                while(input.MoveToNextAttribute());
                info.NegativeInfinitySymbol = String.Concat(info.NegativeSign, info.PositiveInfinitySymbol);
                if (Name == null) {
                    Name = new XmlQualifiedName(null, null);
                }
                compiler.AddDecimalFormat(Name, format);
                input.ToParent();
            }
        }
開發者ID:ArildF,項目名稱:masters,代碼行數:63,代碼來源:containeraction.cs

示例9: CompileKey

        internal void CompileKey(Compiler compiler){
            NavigatorInput input    = compiler.Input;
            string         element  = input.LocalName;
            int            MatchKey = Compiler.InvalidQueryKey;
            int            UseKey   = Compiler.InvalidQueryKey;

            XmlQualifiedName Name = null;
            if (input.MoveToFirstAttribute()) {
                do {
                    Debug.TraceAttribute(input);

                    string nspace = input.NamespaceURI;
                    string name   = input.LocalName;
                    string value  = input.Value;

                    if (! Keywords.Equals(nspace, input.Atoms.Empty)) continue;

                    if (Keywords.Equals(name, input.Atoms.Name)) {
                        Name = compiler.CreateXPathQName(value);
                    }
                    else if (Keywords.Equals(name, input.Atoms.Match)) {
                        MatchKey = compiler.AddPatternQuery(value, /*allowVars:*/false, /*allowKey*/false);
                    }
                    else if (Keywords.Equals(name, input.Atoms.Use)) {
                        UseKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey*/false);
                    }
                    else {
                        if (! compiler.ForwardCompatibility) {
                             throw XsltException.InvalidAttribute(element, name);
                        }
                    }
                }
                while(input.MoveToNextAttribute());
                input.ToParent();
            }

            CheckRequiredAttribute(compiler, MatchKey != Compiler.InvalidQueryKey, Keywords.s_Match);
            CheckRequiredAttribute(compiler, UseKey   != Compiler.InvalidQueryKey, Keywords.s_Use  );
            CheckRequiredAttribute(compiler, Name     != null                    , Keywords.s_Name );

            compiler.InsertKey(Name, MatchKey, UseKey);
        }
開發者ID:ArildF,項目名稱:masters,代碼行數:42,代碼來源:containeraction.cs


注:本文中的System.Xml.Xsl.Compiler.CreateXPathQName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。