本文整理匯總了C#中System.Xml.Xsl.XsltOld.Compiler.AddQuery方法的典型用法代碼示例。如果您正苦於以下問題:C# Compiler.AddQuery方法的具體用法?C# Compiler.AddQuery怎麽用?C# Compiler.AddQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Xsl.XsltOld.Compiler
的用法示例。
在下文中一共展示了Compiler.AddQuery方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CompileAttribute
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;
}
示例2: CompileAttribute
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;
}
示例3: CompileSingle
internal virtual void CompileSingle(Compiler compiler)
{
_matchKey = compiler.AddQuery("/", /*allowVars:*/false, /*allowKey:*/true, /*pattern*/true);
_priority = Compiler.RootPriority;
CompileOnceTemplate(compiler);
}
示例4: CompileAttribute
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;
}
示例5: 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.selectKey = compiler.AddQuery(value);
}
else if (Keywords.Equals(name, compiler.Atoms.DisableOutputEscaping)) {
this.disableOutputEscaping = compiler.GetYesNo(value);
}
else {
return false;
}
return true;
}
示例6: AddSpace
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);
}
示例7: CompileAttribute
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;
}
示例8: CompileAttribute
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;
}
示例9: CompileAttribute
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;
}
示例10: Compile
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);
}
}
示例11: 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 {
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);
}
示例12: Compile
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);
}
}
示例13: 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 {
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);
}