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); }
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 { string nspace = input.NamespaceURI; string name = input.LocalName; string value = input.Value; if (nspace.Length != 0) { continue; } if (Ref.Equal(name, input.Atoms.Name)) { Name = compiler.CreateXPathQName(value); } else if (Ref.Equal(name, input.Atoms.Match)) { MatchKey = compiler.AddQuery(value, /*allowVars:*/ false, /*allowKey*/ false, /*pattern*/ true); } else if (Ref.Equal(name, input.Atoms.Use)) { UseKey = compiler.AddQuery(value, /*allowVars:*/ false, /*allowKey*/ false, /*pattern*/ false); } else { if (!compiler.ForwardCompatibility) { throw XsltException.Create(SR.Xslt_InvalidAttribute, name, element); } } }while (input.MoveToNextAttribute()); input.ToParent(); } CheckRequiredAttribute(compiler, MatchKey != Compiler.InvalidQueryKey, "match"); CheckRequiredAttribute(compiler, UseKey != Compiler.InvalidQueryKey, "use"); CheckRequiredAttribute(compiler, Name != null, "name"); // It is a breaking change to check for emptiness, SQLBUDT 324364 //CheckEmpty(compiler); compiler.InsertKey(Name !, MatchKey, UseKey); }
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 { 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.AddQuery(value, /*allowVars:*/ false, /*allowKey*/ false, /*pattern*/ true); } else if (Keywords.Equals(name, input.Atoms.Use)) { UseKey = compiler.AddQuery(value, /*allowVars:*/ false, /*allowKey*/ false, /*pattern*/ false); } else { if (!compiler.ForwardCompatibility) { throw XsltException.Create(Res.Xslt_InvalidAttribute, name, element); } } }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); }
internal virtual void CompileSingle(Compiler compiler) { _matchKey = compiler.AddQuery("/", /*allowVars:*/false, /*allowKey:*/true, /*pattern*/true); _priority = Compiler.RootPriority; CompileOnceTemplate(compiler); }
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.Mode)) { Debug.Assert(_mode == null); if (compiler.AllowBuiltInMode && value == "*") { _mode = Compiler.BuiltInMode; } else { _mode = compiler.CreateXPathQName(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.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); }
internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Ref.Equal(name, compiler.Atoms.Match)) { Debug.Assert(this.matchKey == Compiler.InvalidQueryKey); this.matchKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey:*/true, /*pattern*/true); } else if (Ref.Equal(name, compiler.Atoms.Name)) { Debug.Assert(this.name == null); this.name = compiler.CreateXPathQName(value); } else if (Ref.Equal(name, compiler.Atoms.Priority)) { Debug.Assert(Double.IsNaN(this.priority)); this.priority = XmlConvert.ToXPathDouble(value); if (double.IsNaN(this.priority) && ! compiler.ForwardCompatibility) { throw XsltException.Create(Res.Xslt_InvalidAttrValue, "priority", value); } } else if (Ref.Equal(name, compiler.Atoms.Mode)) { Debug.Assert(this.mode == null); if (compiler.AllowBuiltInMode && value == "*") { this.mode = Compiler.BuiltInMode; } else { this.mode = compiler.CreateXPathQName(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.Select)) { this.selectKey = compiler.AddQuery(value); } else if (Ref.Equal(name, compiler.Atoms.Mode)) { Debug.Assert(this.mode == null); if (compiler.AllowBuiltInMode && value == "*") { this.mode = Compiler.BuiltInMode; } else { this.mode = compiler.CreateXPathQName(value); } } else { return(false); } return(true); }
internal void CompileSingle(Compiler compiler) { _matchKey = compiler.AddQuery("/", /*allowVars:*/ false, /*allowKey:*/ true, /*pattern*/ true); _priority = Compiler.RootPriority; CompileOnceTemplate(compiler); }
internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Ref.Equal(name, compiler.Atoms.Select)) { this.selectKey = compiler.AddQuery(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.Select)) { _selectKey = compiler.AddQuery(value); } 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.Select)) { this.selectKey = compiler.AddQuery(value); } else if (Keywords.Equals(name, compiler.Atoms.DisableOutputEscaping)) { this.disableOutputEscaping = compiler.GetYesNo(value); } 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.Select)) { this.selectKey = compiler.AddQuery(value); } else { return(false); } return(true); }
internal void AddSpace(Compiler compiler, String query, double Priority, bool PreserveSpace) { WhitespaceElement elem; if (this.queryKeyTable != null) { if (this.queryKeyTable.Contains(query)) { elem = (WhitespaceElement) this.queryKeyTable[query]; elem.ReplaceValue(PreserveSpace); return; } } else{ this.queryKeyTable = new Hashtable(); this.whitespaceList = new ArrayList(); } int key = compiler.AddQuery(query); elem = new WhitespaceElement(key, Priority, PreserveSpace); this.queryKeyTable[query] = elem; this.whitespaceList.Add(elem); }
internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Ref.Equal(name, compiler.Atoms.Match)) { Debug.Assert(_matchKey == Compiler.InvalidQueryKey); _matchKey = compiler.AddQuery(value, /*allowVars:*/ false, /*allowKey:*/ true, /*pattern*/ true); } else if (Ref.Equal(name, compiler.Atoms.Name)) { Debug.Assert(_name == null); _name = compiler.CreateXPathQName(value); } else if (Ref.Equal(name, compiler.Atoms.Priority)) { Debug.Assert(double.IsNaN(_priority)); _priority = XmlConvert.ToXPathDouble(value); if (double.IsNaN(_priority) && !compiler.ForwardCompatibility) { throw XsltException.Create(SR.Xslt_InvalidAttrValue, "priority", value); } } else if (Ref.Equal(name, compiler.Atoms.Mode)) { Debug.Assert(_mode == null); if (compiler.AllowBuiltInMode && value == "*") { _mode = Compiler.BuiltInMode; } else { _mode = compiler.CreateXPathQName(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.Select)) { _selectKey = compiler.AddQuery(value); } else if (Ref.Equal(name, compiler.Atoms.DisableOutputEscaping)) { _disableOutputEscaping = compiler.GetYesNo(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.Select)) { _selectKey = compiler.AddQuery(value); } else if (Ref.Equal(name, compiler.Atoms.Mode)) { Debug.Assert(_mode == null); _mode = compiler.CreateXPathQName(value); } else { return(false); } return(true); }
internal override void Compile(Compiler compiler) { CompileAttributes(compiler); CheckEmpty(compiler); if (_selectKey == Compiler.InvalidQueryKey) { _selectKey = compiler.AddQuery("."); } _forwardCompatibility = compiler.ForwardCompatibility; _manager = compiler.CloneScopeManager(); _lang = ParseLang(PrecalculateAvt(ref _langAvt)); _dataType = ParseDataType(PrecalculateAvt(ref _dataTypeAvt), _manager); _order = ParseOrder(PrecalculateAvt(ref _orderAvt)); _caseOrder = ParseCaseOrder(PrecalculateAvt(ref _caseOrderAvt)); if (_langAvt == null && _dataTypeAvt == null && _orderAvt == null && _caseOrderAvt == null) { _sort = new Sort(_selectKey, _lang, _dataType, _order, _caseOrder); } }
internal override void Compile(Compiler compiler) { CompileAttributes(compiler); CheckEmpty(compiler); if (selectKey == Compiler.InvalidQueryKey) { selectKey = compiler.AddQuery("."); } this.forwardCompatibility = compiler.ForwardCompatibility; this.manager = compiler.CloneScopeManager(); this.lang = ParseLang(PrecalculateAvt(ref this.langAvt)); this.dataType = ParseDataType(PrecalculateAvt(ref this.dataTypeAvt), manager); this.order = ParseOrder(PrecalculateAvt(ref this.orderAvt)); this.caseOrder = ParseCaseOrder(PrecalculateAvt(ref this.caseOrderAvt)); if (this.langAvt == null && this.dataTypeAvt == null && this.orderAvt == null && this.caseOrderAvt == null) { this.sort = new Sort(this.selectKey, this.lang, this.dataType, this.order, this.caseOrder); } }
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); } else if (Keywords.Equals(name, compiler.Atoms.Select)) { this.selectKey = compiler.AddQuery(value); } else { return(false); } return(true); }
internal void AddSpace(Compiler compiler, String query, double Priority, bool PreserveSpace) { WhitespaceElement elem; if (_queryKeyTable != null) { if (_queryKeyTable.Contains(query)) { elem = (WhitespaceElement)_queryKeyTable[query]; elem.ReplaceValue(PreserveSpace); return; } } else { _queryKeyTable = new Hashtable(); _whitespaceList = new ArrayList(); } int key = compiler.AddQuery(query); elem = new WhitespaceElement(key, Priority, PreserveSpace); _queryKeyTable[query] = elem; _whitespaceList.Add(elem); }
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; }
internal override void Compile(Compiler compiler) { CompileAttributes(compiler); CheckEmpty(compiler); if (selectKey == Compiler.InvalidQueryKey) { selectKey = compiler.AddQuery("."); } this.forwardCompatibility = compiler.ForwardCompatibility; this.manager = compiler.CloneScopeManager(); this.lang = ParseLang( PrecalculateAvt(ref this.langAvt )); this.dataType = ParseDataType( PrecalculateAvt(ref this.dataTypeAvt ), manager); this.order = ParseOrder( PrecalculateAvt(ref this.orderAvt )); this.caseOrder = ParseCaseOrder(PrecalculateAvt(ref this.caseOrderAvt)); if(this.langAvt == null && this.dataTypeAvt == null && this.orderAvt == null && this.caseOrderAvt == null) { this.sort = new Sort(this.selectKey, this.lang, this.dataType, this.order, this.caseOrder); } }
internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Ref.Equal(name, compiler.Atoms.Name)) { Debug.Assert(this.name == null && this.nameStr == null); this.nameStr = value; this.name = compiler.CreateXPathQName(this.nameStr); } else if (Ref.Equal(name, compiler.Atoms.Select)) { this.selectKey = compiler.AddQuery(value); } else { return false; } return true; }
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 { string nspace = input.NamespaceURI; string name = input.LocalName; string value = input.Value; if (nspace.Length != 0) continue; if (Ref.Equal(name, input.Atoms.Name)) { Name = compiler.CreateXPathQName(value); } else if (Ref.Equal(name, input.Atoms.Match)) { MatchKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey*/false, /*pattern*/true); } else if (Ref.Equal(name, input.Atoms.Use)) { UseKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey*/false, /*pattern*/false); } else { if (! compiler.ForwardCompatibility) { throw XsltException.Create(Res.Xslt_InvalidAttribute, name, element); } } } while(input.MoveToNextAttribute()); input.ToParent(); } CheckRequiredAttribute(compiler, MatchKey != Compiler.InvalidQueryKey, "match"); CheckRequiredAttribute(compiler, UseKey != Compiler.InvalidQueryKey, "use" ); CheckRequiredAttribute(compiler, Name != null , "name" ); // It is a breaking change to check for emptiness, SQLBUDT 324364 //CheckEmpty(compiler); compiler.InsertKey(Name, MatchKey, UseKey); }
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; }
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 { 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.AddQuery(value, /*allowVars:*/false, /*allowKey*/false, /*pattern*/true); } else if (Keywords.Equals(name, input.Atoms.Use)) { UseKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey*/false, /*pattern*/false); } else { if (! compiler.ForwardCompatibility) { throw XsltException.Create(Res.Xslt_InvalidAttribute, name, element); } } } 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); }