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

            if (Ref.Equal(name, compiler.Atoms.Select))
            {
                _selectKey = compiler.AddQuery(value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Lang))
            {
                _langAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.DataType))
            {
                _dataTypeAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Order))
            {
                _orderAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.CaseOrder))
            {
                _caseOrderAvt = Avt.CompileAvt(compiler, value);
            }
            else
            {
                return(false);
            }
            return(true);
        }
 // For perf reason we precalculating AVTs at compile time.
 // If we can do this we set original AVT to null
 internal static string PrecalculateAvt(ref Avt avt) {
     string result = null;
     if(avt != null && avt.IsConstant) {
         result = avt.Evaluate(null, null);
         avt = null;
     }
     return result;
 }
        internal override bool CompileAttribute(Compiler compiler)
        {
            string name  = compiler.Input.LocalName;
            string value = compiler.Input.Value;

            if (Ref.Equal(name, compiler.Atoms.Level))
            {
                if (value != "any" && value != "multiple" && value != "single")
                {
                    throw XsltException.Create(SR.Xslt_InvalidAttrValue, "level", value);
                }
                _level = value;
            }
            else if (Ref.Equal(name, compiler.Atoms.Count))
            {
                _countPattern = value;
                _countKey     = compiler.AddQuery(value, /*allowVars:*/ true, /*allowKey:*/ true, /*pattern*/ true);
            }
            else if (Ref.Equal(name, compiler.Atoms.From))
            {
                _from    = value;
                _fromKey = compiler.AddQuery(value, /*allowVars:*/ true, /*allowKey:*/ true, /*pattern*/ true);
            }
            else if (Ref.Equal(name, compiler.Atoms.Value))
            {
                _value    = value;
                _valueKey = compiler.AddQuery(value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Format))
            {
                _formatAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Lang))
            {
                _langAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.LetterValue))
            {
                _letterAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.GroupingSeparator))
            {
                _groupingSepAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.GroupingSize))
            {
                _groupingSizeAvt = Avt.CompileAvt(compiler, value);
            }
            else
            {
                return(false);
            }
            return(true);
        }
Example #4
0
        // For perf reason we precalculating AVTs at compile time.
        // If we can do this we set original AVT to null
        internal static string PrecalculateAvt(ref Avt avt)
        {
            string result = null;

            if (avt != null && avt.IsConstant)
            {
                result = avt.Evaluate(null, null);
                avt    = null;
            }
            return(result);
        }
        internal override bool CompileAttribute(Compiler compiler) {
            string name   = compiler.Input.LocalName;
            string value  = compiler.Input.Value;
            if (Keywords.Equals(name, compiler.Atoms.Name)) {
                this.nameAvt = Avt.CompileAvt(compiler, value);
            }
            else {
                return false;
            }

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

            if (Ref.Equal(name, compiler.Atoms.Name))
            {
                _nameAvt = Avt.CompileAvt(compiler, value);
            }
            else
            {
                return(false);
            }

            return(true);
        }
        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();
            }
        }
        internal override bool CompileAttribute(Compiler compiler) {
            string name   = compiler.Input.LocalName;
            string value  = compiler.Input.Value;
            if (Ref.Equal(name, compiler.Atoms.Name)) {
                this.nameAvt      = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Namespace)) {
                this.nsAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.UseAttributeSets)) {
                AddAction(compiler.CreateUseAttributeSetsAction());
            }
            else {
                return false;
            }

            return true;
        }
Example #9
0
        internal override bool CompileAttribute(Compiler compiler)
        {
            string name  = compiler.Input.LocalName;
            string value = compiler.Input.Value;

            if (Keywords.Equals(name, compiler.Atoms.Name))
            {
                this.nameAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Keywords.Equals(name, compiler.Atoms.Namespace))
            {
                this.nsAvt = Avt.CompileAvt(compiler, value);
            }
            else
            {
                return(false);
            }

            return(true);
        }
        internal override void Compile(Compiler compiler)
        {
            CompileAttributes(compiler);
            CheckRequiredAttribute(compiler, _nameAvt, "name");

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

            if (compiler.Recurse())
            {
                CompileTemplate(compiler);
                compiler.ToParent();
            }
        }
Example #11
0
        internal override bool CompileAttribute(Compiler compiler)
        {
            string name  = compiler.Input.LocalName;
            string value = compiler.Input.Value;

            if (Ref.Equal(name, compiler.Atoms.Name))
            {
                _nameAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Namespace))
            {
                _nsAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.UseAttributeSets))
            {
                AddAction(compiler.CreateUseAttributeSetsAction());
            }
            else
            {
                return(false);
            }

            return(true);
        }
 internal override bool CompileAttribute(Compiler compiler) {
     string name   = compiler.Input.LocalName;
     string value  = compiler.Input.Value;
     if (Keywords.Equals(name, compiler.Atoms.Level)) {
         if (value != "any" && value != "multiple" && value != "single") {
             throw XsltException.Create(Res.Xslt_InvalidAttrValue, Keywords.s_Level, value);
         }
         this.level = value;
     }
     else if (Keywords.Equals(name, compiler.Atoms.Count)) {
         this.countPattern = value;
         this.countKey = compiler.AddQuery(value, /*allowVars:*/true, /*allowKey:*/true, /*pattern*/true);
     }
     else if (Keywords.Equals(name, compiler.Atoms.From)) {
         this.from = value;
         this.fromKey = compiler.AddQuery(value, /*allowVars:*/true, /*allowKey:*/true, /*pattern*/true);
     }
     else if (Keywords.Equals(name, compiler.Atoms.Value)) {
         this.value = value;
         this.valueKey = compiler.AddQuery(value);
     }
     else if (Keywords.Equals(name, compiler.Atoms.Format)) {
         this.formatAvt = Avt.CompileAvt(compiler, value);
     }
     else if (Keywords.Equals(name, compiler.Atoms.Lang)) {
         this.langAvt = Avt.CompileAvt(compiler, value);
     }
     else if (Keywords.Equals(name, compiler.Atoms.LetterValue)) {
         this.letterAvt = Avt.CompileAvt(compiler, value);
     }
     else if (Keywords.Equals(name, compiler.Atoms.GroupingSeparator)) {
         this.groupingSepAvt = Avt.CompileAvt(compiler, value);
     }
     else if (Keywords.Equals(name, compiler.Atoms.GroupingSize)) {
         this.groupingSizeAvt = Avt.CompileAvt(compiler, value);
     }
     else {
        return false;
     }
     return true;
 }
Example #13
0
        internal override bool CompileAttribute(Compiler compiler)
        {
            string name = compiler.Input.LocalName;
            string value = compiler.Input.Value;

            if (Ref.Equal(name, compiler.Atoms.Select))
            {
                _selectKey = compiler.AddQuery(value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Lang))
            {
                _langAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.DataType))
            {
                _dataTypeAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Order))
            {
                _orderAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.CaseOrder))
            {
                _caseOrderAvt = Avt.CompileAvt(compiler, value);
            }
            else
            {
                return false;
            }
            return true;
        }
Example #14
0
        internal override bool CompileAttribute(Compiler compiler)
        {
            string name = compiler.Input.LocalName;
            string value = compiler.Input.Value;
            if (Ref.Equal(name, compiler.Atoms.Name))
            {
                _nameAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Namespace))
            {
                _nsAvt = Avt.CompileAvt(compiler, value);
            }
            else
            {
                return false;
            }

            return true;
        }