System.Xml.Xsl.XsltOld.ContainerAction.CompileDecimalFormat C# (CSharp) Method

CompileDecimalFormat() protected method

protected CompileDecimalFormat ( Compiler compiler ) : void
compiler Compiler
return void
        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 {
                    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());
                input.ToParent();
            }
            info.NegativeInfinitySymbol = String.Concat(info.NegativeSign, info.PositiveInfinitySymbol);
            if (Name == null) {
                Name = new XmlQualifiedName();
            }
            compiler.AddDecimalFormat(Name, format);
            CheckEmpty(compiler);
        }