Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
QilGenerator.cs
Go to the documentation of this file.
5using System.Text;
11
12namespace System.Xml.Xsl.Xslt;
13
15{
16 private sealed class VariableHelper
17 {
19
20 private readonly XPathQilFactory _f;
21
23 {
24 _f = f;
25 }
26
27 public int StartVariables()
28 {
29 return _vars.Count;
30 }
31
33 {
34 _vars.Push(let);
35 }
36
38 {
39 int num = _vars.Count - varScope;
40 while (num-- != 0)
41 {
42 node = _f.Loop(_vars.Pop(), node);
43 }
44 return node;
45 }
46 }
47
48 [StructLayout(LayoutKind.Sequential, Size = 1)]
49 private readonly struct ThrowErrorHelper : IErrorHelper
50 {
51 public void ReportError(string res, params string[] args)
52 {
54 }
55 }
56
69
71
73
75
76 private readonly XsltQilFactory _f;
77
78 private readonly XPathBuilder _xpathBuilder;
79
81
83
85
87
89
90 private readonly InvokeGenerator _invkGen;
91
93
95
96 private readonly VariableHelper _varHelper;
97
99
101
103
105
107
109
111
113
115
117
119
120 private readonly QilName _nameCurrent;
121
122 private readonly QilName _namePosition;
123
124 private readonly QilName _nameLast;
125
126 private readonly QilName _nameNamespaces;
127
128 private readonly QilName _nameInit;
129
131
133
135
136 private int _formatterCnt;
137
139
140 private static readonly char[] s_curlyBraces = new char[2] { '{', '}' };
141
142 private bool _allowVariables = true;
143
144 private bool _allowCurrent = true;
145
146 private bool _allowKey = true;
147
148 private static readonly XmlTypeCode[] s_argFnDocument = new XmlTypeCode[2]
149 {
150 XmlTypeCode.Item,
152 };
153
154 private static readonly XmlTypeCode[] s_argFnKey = new XmlTypeCode[2]
155 {
156 XmlTypeCode.String,
158 };
159
160 private static readonly XmlTypeCode[] s_argFnFormatNumber = new XmlTypeCode[3]
161 {
162 XmlTypeCode.Double,
163 XmlTypeCode.String,
165 };
166
168
169 private bool IsDebug => _compiler.IsDebug;
170
171 private bool EvaluateFuncCalls => !IsDebug;
172
173 private bool InferXPathTypes => !IsDebug;
174
176
178 {
179 return new QilGenerator(compiler.IsDebug).Compile(compiler);
180 }
181
182 private QilGenerator(bool debug)
183 {
187 _f = new XsltQilFactory(new QilFactory(), debug);
188 _xpathBuilder = new XPathBuilder(this);
196 _funcFocus = default(FunctionFocus);
197 _curLoop = new LoopFocus(_f);
202 _nameCurrent = _f.QName("current", "urn:schemas-microsoft-com:xslt-debug");
203 _namePosition = _f.QName("position", "urn:schemas-microsoft-com:xslt-debug");
204 _nameLast = _f.QName("last", "urn:schemas-microsoft-com:xslt-debug");
205 _nameNamespaces = _f.QName("namespaces", "urn:schemas-microsoft-com:xslt-debug");
206 _nameInit = _f.QName("init", "urn:schemas-microsoft-com:xslt-debug");
207 _formatterCnt = 0;
208 }
209
211 {
218 if (!IsDebug)
219 {
221 }
223 try
224 {
225 CompileKeys();
226 CompileAndSortMatches(compiler.Root.Imports[0]);
229 foreach (ProtoTemplate allTemplate in compiler.AllTemplates)
230 {
232 }
233 }
234 catch (XslLoadException ex)
235 {
236 ex.SetSourceLineInfo(_lastScope.SourceLine);
237 throw;
238 }
239 catch (Exception ex2)
240 {
242 {
243 throw;
244 }
246 }
248 QilNode root = CompileRootExpression(compiler.StartApplyTemplates);
249 foreach (ProtoTemplate allTemplate2 in compiler.AllTemplates)
250 {
251 foreach (QilParameter argument in allTemplate2.Function.Arguments)
252 {
253 if (!IsDebug || argument.Name.Equals(_nameNamespaces))
254 {
256 }
257 }
258 }
259 Scripts.TrimSafeDictionary scriptClasses = compiler.Scripts.ScriptClasses;
261 foreach (string key in scriptClasses.Keys)
262 {
264 if (type != null)
265 {
267 }
268 }
274 qilExpression.WhitespaceRules = compiler.WhitespaceRules;
278 return qilExpression;
279 }
280
286
322
324 {
325 _singlFocus.SetFocus(SingletonFocusType.InitialContextNode);
327 _singlFocus.SetFocus(null);
328 return _f.DocumentCtor(child);
329 }
330
332 {
334 _xslVersion = node.XslVersion;
335 if (_scope.EnterScope(node.Namespaces))
336 {
338 }
339 return null;
340 }
341
342 private void ExitScope()
343 {
345 }
346
348 {
349 if (IsDebug)
350 {
353 while (enumerator.MoveNext())
354 {
355 CompilerScopeManager<QilIterator>.ScopeRecord current = enumerator.Current;
356 qilList.Add(_f.NamespaceDecl(_f.String(current.ncName), _f.String(current.nsUri)));
357 }
358 return qilList;
359 }
360 return null;
361 }
362
364 {
366 {
367 return _curLoop.GetCurrent();
368 }
370 {
371 return _funcFocus.GetCurrent();
372 }
373 return _singlFocus.GetCurrent();
374 }
375
377 {
379 {
380 return _curLoop.GetPosition();
381 }
383 {
384 return _funcFocus.GetPosition();
385 }
386 return _singlFocus.GetPosition();
387 }
388
390 {
392 {
393 return _curLoop.GetLast();
394 }
396 {
397 return _funcFocus.GetLast();
398 }
399 return _singlFocus.GetLast();
400 }
401
423
425 {
426 foreach (QilIterator nsVar in _nsVars)
427 {
428 QilList qilList = (QilList)nsVar.Binding;
429 if (qilList.Count != nsList.Count)
430 {
431 continue;
432 }
433 bool flag = true;
434 for (int i = 0; i < nsList.Count; i++)
435 {
436 if (((QilLiteral)((QilBinary)nsList[i]).Right).Value != ((QilLiteral)((QilBinary)qilList[i]).Right).Value || ((QilLiteral)((QilBinary)nsList[i]).Left).Value != ((QilLiteral)((QilBinary)qilList[i]).Left).Value)
437 {
438 flag = false;
439 break;
440 }
441 }
442 if (flag)
443 {
444 return nsVar;
445 }
446 }
447 QilIterator qilIterator2 = _f.Let(nsList);
448 qilIterator2.DebugName = _f.QName("ns" + _nsVars.Count, "urn:schemas-microsoft-com:xslt-debug").ToString();
451 return qilIterator2;
452 }
453
455 {
456 List<VarPar> list = null;
460 {
462 XslFlags xslFlags = ((!IsDebug) ? allTemplate.Flags : XslFlags.FocusFilter);
464 if ((xslFlags & XslFlags.Current) != 0)
465 {
467 }
468 if ((xslFlags & XslFlags.Position) != 0)
469 {
471 }
472 if ((xslFlags & XslFlags.Last) != 0)
473 {
475 }
476 if (IsDebug && qilList2 != null)
477 {
481 }
482 if (allTemplate is Template template)
483 {
485 for (int i = 0; i < allTemplate.Content.Count; i++)
486 {
487 XslNode xslNode = allTemplate.Content[i];
488 if (xslNode.NodeType == XslNodeType.Text)
489 {
490 continue;
491 }
492 if (xslNode.NodeType != XslNodeType.Param)
493 {
494 break;
495 }
498 if (_scope.IsLocalVariable(varPar.Name.LocalName, varPar.Name.NamespaceUri))
499 {
500 ReportError(System.SR.Xslt_DupLocalVariable, varPar.Name.QualifiedName);
501 }
503 if (IsDebug)
504 {
506 }
507 else if ((varPar.DefValueFlags & XslFlags.HasCalls) == 0)
508 {
510 }
511 else
512 {
515 for (int j = 0; j < qilList.Count; j++)
516 {
520 SetLineInfo(qilParameter3, qilList[j].SourceLine);
523 }
524 varPar.Flags |= template.Flags & XslFlags.FocusFilter;
525 QilFunction qilFunction = _f.Function(qilList3, _f.Boolean((varPar.DefValueFlags & XslFlags.SideEffects) != 0), ChooseBestType(varPar));
527 qilFunction.DebugName = "<xsl:param name=\"" + varPar.Name.QualifiedName + "\">";
529 if (list == null)
530 {
531 list = new List<VarPar>();
534 }
535 list.Add(varPar);
536 dictionary.Add(varPar, template);
538 }
539 SetLineInfo(qilParameter2, varPar.SourceLine);
540 ExitScope();
543 }
545 }
546 ExitScope();
550 _functions.Add(allTemplate.Function);
551 }
552 if (list == null)
553 {
554 return;
555 }
556 foreach (VarPar item in list)
557 {
560 _funcFocus.StartFocus(qilFunction2.Arguments, item.Flags);
563 foreach (QilParameter argument in qilFunction2.Arguments)
564 {
566 }
568 SetLineInfo(qilFunction2.Definition, item.SourceLine);
569 ExitScope();
570 ExitScope();
573 }
574 }
575
577 {
579 qilParameter.DebugName = name.ToString();
580 qilParameter.Name = name;
581 return qilParameter;
582 }
583
585 {
587 _funcFocus.StartFocus(tmpl.Function.Arguments, (!IsDebug) ? tmpl.Flags : XslFlags.FocusFilter);
588 foreach (QilParameter argument in tmpl.Function.Arguments)
589 {
590 if (argument.Name.NamespaceUri != "urn:schemas-microsoft-com:xslt-debug")
591 {
592 if (IsDebug)
593 {
594 VarPar node = (VarPar)argument.Annotation;
595 QilList nsList = EnterScope(node);
597 ExitScope();
598 argument.DefaultValue = SetDebugNs(argument.DefaultValue, nsList);
599 }
601 }
602 }
605 ExitScope();
606 }
607
609 {
610 return _f.BaseFactory.Sequence();
611 }
612
617
622
624 {
625 return CompileInstructions(instructions, 0, content);
626 }
627
629 {
630 for (int i = from; i < instructions.Count; i++)
631 {
633 XslNodeType nodeType = xslNode.NodeType;
634 if (nodeType == XslNodeType.Param)
635 {
636 continue;
637 }
638 QilList nsList = EnterScope(xslNode);
639 QilNode qilNode = nodeType switch
640 {
665 _ => null,
666 };
667 ExitScope();
668 if (qilNode.NodeType != QilNodeType.Sequence || qilNode.Count != 0)
669 {
670 if (nodeType != XslNodeType.LiteralAttribute && nodeType != XslNodeType.UseAttributeSet)
671 {
672 SetLineInfoCheck(qilNode, xslNode.SourceLine);
673 }
674 qilNode = SetDebugNs(qilNode, nsList);
675 if (nodeType == XslNodeType.Variable)
676 {
678 qilIterator.DebugName = xslNode.Name.ToString();
682 }
683 content.Add(qilNode);
684 }
685 }
686 if (!IsDebug && content.Count == 1)
687 {
688 return content[0];
689 }
690 return content;
691 }
692
694 {
695 return CompileInstructions(node.Content);
696 }
697
699 {
700 return _f.Nop(_f.Sequence());
701 }
702
703 private void AddNsDecl(QilList content, string prefix, string nsUri)
704 {
705 if (!(_outputScope.LookupNamespace(prefix) == nsUri))
706 {
708 content.Add(_f.NamespaceDecl(_f.String(prefix), _f.String(nsUri)));
709 }
710 }
711
713 {
714 bool flag = true;
715 while (true)
716 {
718 QilName name = node.Name;
719 string prefix = name.Prefix;
720 string nsUri = name.NamespaceUri;
722 if (flag)
723 {
724 _prefixesInUse.Add(prefix, nsUri);
725 }
726 else
727 {
728 prefix = name.Prefix;
729 }
731 QilList content = InstructionList();
733 while (true)
734 {
735 if (enumerator.MoveNext())
736 {
737 CompilerScopeManager<QilIterator>.ScopeRecord current = enumerator.Current;
738 string prefix2 = current.ncName;
739 string nsUri2 = current.nsUri;
740 if (!(nsUri2 != "http://www.w3.org/1999/XSL/Transform") || _scope.IsExNamespace(nsUri2))
741 {
742 continue;
743 }
745 if (flag)
746 {
748 {
749 if ((string)_prefixesInUse[prefix2] != nsUri2)
750 {
751 break;
752 }
753 }
754 else
755 {
757 }
758 }
759 else
760 {
761 prefix2 = current.ncName;
762 }
763 AddNsDecl(content, prefix2, nsUri2);
764 continue;
765 }
766 QilNode content2 = CompileInstructions(node.Content, content);
769 name.NamespaceUri = nsUri;
770 return _f.ElementCtor(name, content2);
771 }
773 flag = false;
774 }
775 }
776
778 {
781 QilNode name;
782 if (qilNode2.NodeType != QilNodeType.LiteralString || (qilNode != null && qilNode.NodeType != QilNodeType.LiteralString))
783 {
785 }
786 else
787 {
788 string qname = (QilLiteral)qilNode2;
789 string prefix;
790 string localName;
791 bool flag = _compiler.ParseQName(qname, out prefix, out localName, this);
792 string uri = ((qilNode != null) ? ((string)(QilLiteral)qilNode) : (flag ? ResolvePrefix(ignoreDefaultNs: false, prefix) : _compiler.CreatePhantomNamespace()));
793 name = _f.QName(localName, uri, prefix);
794 }
797 QilNode content = CompileInstructions(node.Content);
799 return _f.ElementCtor(name, content);
800 }
801
803 {
804 QilName name = node.Name;
805 string prefix = name.Prefix;
806 string nsUri = name.NamespaceUri;
807 if (prefix.Length != 0)
808 {
810 }
812 name.NamespaceUri = nsUri;
813 return _f.AttributeCtor(name, CompileTextAvt(node.Select));
814 }
815
817 {
820 bool flag = false;
821 QilNode name;
822 if (qilNode2.NodeType != QilNodeType.LiteralString || (qilNode != null && qilNode.NodeType != QilNodeType.LiteralString))
823 {
825 }
826 else
827 {
828 string text = (QilLiteral)qilNode2;
829 string prefix;
830 string localName;
831 bool flag2 = _compiler.ParseQName(text, out prefix, out localName, this);
832 string text2;
833 if (qilNode == null)
834 {
836 }
837 else
838 {
840 flag = true;
841 }
842 if (text == "xmlns" || (localName == "xmlns" && text2.Length == 0))
843 {
845 }
846 name = _f.QName(localName, text2, prefix);
847 }
848 if (flag)
849 {
851 }
852 return _f.AttributeCtor(name, CompileInstructions(node.Content));
853 }
854
855 private QilNode ExtractText(string source, ref int pos)
856 {
857 int num = pos;
859 int i;
860 for (i = pos; i < source.Length; i++)
861 {
862 char c = source[i];
863 if (c != '{' && c != '}')
864 {
865 continue;
866 }
867 if (i + 1 < source.Length && source[i + 1] == c)
868 {
869 i++;
870 _unescapedText.Append(source, num, i - num);
871 num = i + 1;
872 continue;
873 }
874 if (c == '{')
875 {
876 break;
877 }
878 pos = source.Length;
879 if (_xslVersion != XslVersion.ForwardsCompatible)
880 {
882 return null;
883 }
885 }
886 pos = i;
887 if (_unescapedText.Length == 0)
888 {
889 if (i <= num)
890 {
891 return null;
892 }
893 return _f.String(source.Substring(num, i - num));
894 }
895 _unescapedText.Append(source, num, i - num);
897 }
898
899 private QilNode CompileAvt(string source)
900 {
902 int pos = 0;
903 while (pos < source.Length)
904 {
906 if (qilNode != null)
907 {
909 }
910 if (pos < source.Length)
911 {
912 pos++;
915 }
916 }
917 if (qilList.Count == 1)
918 {
919 return qilList[0];
920 }
921 return qilList;
922 }
923
924 [return: NotNullIfNotNull("avt")]
926 {
927 if (avt == null)
928 {
929 return null;
930 }
931 if (avt.IndexOfAny(s_curlyBraces) == -1)
932 {
933 return _f.String(avt);
934 }
935 return _f.StrConcat(CompileAvt(avt));
936 }
937
938 private QilNode CompileTextAvt(string avt)
939 {
940 if (avt.IndexOfAny(s_curlyBraces) == -1)
941 {
942 return _f.TextCtor(_f.String(avt));
943 }
945 if (qilNode.NodeType == QilNodeType.Sequence)
946 {
948 {
949 foreach (QilNode item in qilNode)
950 {
952 }
953 return qilList;
954 }
955 }
956 return _f.TextCtor(qilNode);
957 }
958
960 {
961 if (node.Hints == SerializationHints.None)
962 {
963 return _f.TextCtor(_f.String(node.Select));
964 }
965 return _f.RawTextCtor(_f.String(node.Select));
966 }
967
969 {
971 if (qilNode.NodeType == QilNodeType.LiteralString)
972 {
973 string name = (QilLiteral)qilNode;
974 _compiler.ValidatePiName(name, this);
975 }
976 return _f.PICtor(qilNode, CompileInstructions(node.Content));
977 }
978
980 {
981 return _f.CommentCtor(CompileInstructions(node.Content));
982 }
983
985 {
986 return _f.Error(_f.String(node.Select));
987 }
988
990 {
991 if (IsDebug)
992 {
994 }
995 return expr;
996 }
997
999 {
1000 IList<XslNode> content = node.Content;
1006 QilNode expr = CompileInstructions(content);
1007 expr = WrapLoopBody(node.ElemNameLi, expr, node.EndTagLi);
1008 expr = AddCurrentPositionLast(expr);
1009 expr = _curLoop.ConstructLoop(expr);
1010 expr = _varHelper.FinishVariables(expr, varScope);
1012 return expr;
1013 }
1014
1016 {
1017 IList<XslNode> content = node.Content;
1021 for (int i = 0; i < content.Count; i++)
1022 {
1023 if (content[i] is VarPar varPar)
1024 {
1026 QilNode value = varPar.Value;
1027 if (IsDebug || (!(value is QilIterator) && !(value is QilLiteral)))
1028 {
1030 qilIterator2.DebugName = _f.QName("with-param " + varPar.Name.QualifiedName, "urn:schemas-microsoft-com:xslt-debug").ToString();
1033 }
1034 }
1035 }
1041 expr = WrapLoopBody(node.ElemNameLi, expr, node.EndTagLi);
1042 expr = AddCurrentPositionLast(expr);
1043 expr = _curLoop.ConstructLoop(expr);
1045 return _varHelper.FinishVariables(expr, varScope);
1046 }
1047
1049 {
1050 return GenerateApply((StylesheetLevel)node.Arg, node);
1051 }
1052
1054 {
1056 IList<XslNode> content = node.Content;
1057 foreach (VarPar item in content)
1058 {
1060 if (IsDebug)
1061 {
1062 QilNode value = item.Value;
1064 qilIterator.DebugName = _f.QName("with-param " + item.Name.QualifiedName, "urn:schemas-microsoft-com:xslt-debug").ToString();
1067 }
1068 }
1071 {
1073 }
1074 else
1075 {
1076 if (!_compiler.IsPhantomName(node.Name))
1077 {
1078 _compiler.ReportError(node.SourceLine, System.SR.Xslt_InvalidCallTemplate, node.Name.QualifiedName);
1079 }
1080 qilNode = _f.Sequence();
1081 }
1082 if (content.Count > 0)
1083 {
1084 qilNode = SetLineInfo(qilNode, node.ElemNameLi);
1085 }
1087 if (IsDebug)
1088 {
1089 return _f.Nop(qilNode);
1090 }
1091 return qilNode;
1092 }
1093
1095 {
1098 {
1099 return _invkGen.GenerateInvoke(value.Function, AddRemoveImplicitArgs(node.Content, value.Flags));
1100 }
1101 if (!_compiler.IsPhantomName(node.Name))
1102 {
1103 _compiler.ReportError(node.SourceLine, System.SR.Xslt_NoAttributeSet, node.Name.QualifiedName);
1104 }
1105 return _f.Sequence();
1106 }
1107
1109 {
1110 QilNode currentNode = GetCurrentNode();
1111 if ((currentNode.XmlType.NodeKinds & (XmlNodeKindFlags.Attribute | XmlNodeKindFlags.Namespace)) != 0)
1112 {
1114 }
1115 if (currentNode.XmlType.NodeKinds == XmlNodeKindFlags.Element)
1116 {
1118 qilList.Add(_f.XPathNamespace(currentNode));
1121 QilNode content = CompileInstructions(copy.Content, qilList);
1123 return _f.ElementCtor(_f.NameOf(currentNode), content);
1124 }
1125 if (currentNode.XmlType.NodeKinds == XmlNodeKindFlags.Document)
1126 {
1127 return CompileInstructions(copy.Content);
1128 }
1129 if ((currentNode.XmlType.NodeKinds & (XmlNodeKindFlags.Document | XmlNodeKindFlags.Element)) == 0)
1130 {
1131 return currentNode;
1132 }
1133 return _f.XsltCopy(currentNode, CompileInstructions(copy.Content));
1134 }
1135
1137 {
1139 if (qilNode.XmlType.IsNode)
1140 {
1141 if ((qilNode.XmlType.NodeKinds & (XmlNodeKindFlags.Attribute | XmlNodeKindFlags.Namespace)) != 0)
1142 {
1144 }
1145 if (qilNode.XmlType.IsNotRtf && (qilNode.XmlType.NodeKinds & XmlNodeKindFlags.Document) == 0)
1146 {
1147 return qilNode;
1148 }
1149 if (qilNode.XmlType.IsSingleton)
1150 {
1151 return _f.XsltCopyOf(qilNode);
1152 }
1153 QilIterator expr;
1154 return _f.Loop(expr = _f.For(qilNode), _f.XsltCopyOf(expr));
1155 }
1156 if (qilNode.XmlType.IsAtomicValue)
1157 {
1159 }
1163 }
1164
1169
1174
1179
1181 {
1183 }
1184
1186 {
1187 IList<XslNode> content = node.Content;
1188 QilNode qilNode = null;
1189 int num = content.Count - 1;
1190 while (0 <= num)
1191 {
1192 XslNode xslNode = content[num];
1193 QilList nsList = EnterScope(xslNode);
1195 ExitScope();
1196 SetLineInfoCheck(qilNode, xslNode.SourceLine);
1197 qilNode = SetDebugNs(qilNode, nsList);
1198 num--;
1199 }
1200 if (qilNode == null)
1201 {
1202 return _f.Sequence();
1203 }
1204 if (!IsDebug)
1205 {
1206 return qilNode;
1207 }
1208 return _f.Sequence(qilNode);
1209 }
1210
1212 {
1213 string uri = _lastScope.SourceLine.Uri;
1214 QilNode n = _f.RtfCtor(CompileInstructions(node.Content), _f.String(uri));
1215 n = _f.InvokeOuterXml(n);
1216 if (!(bool)node.Arg)
1217 {
1218 return _f.Warning(n);
1219 }
1221 return _f.Loop(text = _f.Let(n), _f.Sequence(_f.Warning(text), _f.Error(text)));
1222 }
1223
1225 {
1226 if (_scope.IsLocalVariable(node.Name.LocalName, node.Name.NamespaceUri))
1227 {
1228 ReportError(System.SR.Xslt_DupLocalVariable, node.Name.QualifiedName);
1229 }
1230 return CompileVarParValue(node);
1231 }
1232
1234 {
1235 string uri = _lastScope.SourceLine.Uri;
1236 IList<XslNode> content = node.Content;
1237 string select = node.Select;
1239 if (select != null)
1240 {
1244 }
1245 else if (content.Count != 0)
1246 {
1249 qilNode = _f.RtfCtor(CompileInstructions(content), _f.String(uri));
1251 }
1252 else
1253 {
1254 qilNode = _f.String(string.Empty);
1255 }
1256 if (IsDebug)
1257 {
1259 }
1260 return qilNode;
1261 }
1262
1264 {
1265 QilList nsList = EnterScope(withParam);
1267 ExitScope();
1268 SetLineInfo(n, withParam.SourceLine);
1269 n = SetDebugNs(n, nsList);
1271 }
1272
1274 {
1276 int num = 0;
1277 while (num < content.Count)
1278 {
1279 if (content[num] is Sort sort)
1280 {
1282 content.RemoveAt(num);
1283 }
1284 else
1285 {
1286 num++;
1287 }
1288 }
1289 if (qilList.Count == 0)
1290 {
1291 return null;
1292 }
1293 return qilList;
1294 }
1295
1297 {
1299 if (qilNode != null)
1300 {
1301 if (qilNode.NodeType == QilNodeType.LiteralString)
1302 {
1303 string lang = (QilLiteral)qilNode;
1304 string text = XsltLibrary.LangToNameInternal(lang, fwdCompat, this);
1305 if (text == "")
1306 {
1307 qilNode = null;
1308 }
1309 }
1310 else
1311 {
1314 }
1315 }
1316 return qilNode;
1317 }
1318
1323
1325 {
1326 if (lang == null)
1327 {
1328 return _f.Double(127.0);
1329 }
1330 if (lang.NodeType == QilNodeType.LiteralString)
1331 {
1333 }
1335 }
1336
1338 {
1340 if (qilNode != null)
1341 {
1342 if (qilNode.NodeType != QilNodeType.LiteralString)
1343 {
1349 select2 = select.DeepClone(_f.BaseFactory);
1350 select = _f.Conditional(qilIterator3, _f.ConvertToString(select), _f.String(string.Empty));
1352 return;
1353 }
1354 string text = (QilLiteral)qilNode;
1355 if (text == "number")
1356 {
1357 select = _f.ConvertToNumber(select);
1358 select2 = null;
1359 return;
1360 }
1361 if (!(text == "text") && !fwdCompat)
1362 {
1363 string prefix;
1364 string localName;
1366 _ = text2.Length;
1367 ReportError(System.SR.Xslt_BistateAttribute, "data-type", "text", "number");
1368 }
1369 }
1370 select = _f.ConvertToString(select);
1371 select2 = null;
1372 }
1373
1374 [return: NotNullIfNotNull("attName")]
1375 private QilNode CompileOrderAttribute(string attName, string attValue, string value0, string value1, bool fwdCompat)
1376 {
1378 if (qilNode != null)
1379 {
1380 if (qilNode.NodeType == QilNodeType.LiteralString)
1381 {
1382 string text = (QilLiteral)qilNode;
1383 if (text == value1)
1384 {
1385 qilNode = _f.String("1");
1386 }
1387 else
1388 {
1389 if (text != value0 && !fwdCompat)
1390 {
1392 }
1393 qilNode = _f.String("0");
1394 }
1395 }
1396 else
1397 {
1398 QilIterator left;
1400 }
1401 }
1402 return qilNode;
1403 }
1404
1406 {
1408 bool forwardsCompatible = sort.ForwardsCompatible;
1409 QilNode select = CompileXPathExpression(sort.Select);
1410 QilNode value;
1414 if (sort.Lang != null || sort.DataType != null || sort.Order != null || sort.CaseOrder != null)
1415 {
1420 qilNode = CompileOrderAttribute("order", sort.Order, "ascending", "descending", forwardsCompatible);
1421 qilNode2 = CompileOrderAttribute("case-order", sort.CaseOrder, "lower-first", "upper-first", forwardsCompatible);
1422 _curLoop = curLoop;
1423 }
1424 else
1425 {
1426 select = _f.ConvertToString(select);
1427 select2 = (value = (qilNode = (qilNode2 = null)));
1428 }
1429 _strConcat.Reset();
1430 _strConcat.Append("http://collations.microsoft.com");
1431 _strConcat.Append('/');
1433 char value2 = '?';
1434 if (qilNode != null)
1435 {
1437 _strConcat.Append("descendingOrder=");
1439 value2 = '&';
1440 }
1441 if (qilNode2 != null)
1442 {
1444 _strConcat.Append("upperFirst=");
1446 value2 = '&';
1447 }
1449 QilSortKey node = _f.SortKey(select, qilNode3);
1450 keyList.Add(node);
1451 if (select2 != null)
1452 {
1453 node = _f.SortKey(select2, qilNode3.DeepClone(_f.BaseFactory));
1454 keyList.Add(node);
1455 }
1456 ExitScope();
1457 }
1458
1460 {
1461 if (pattern.NodeType == QilNodeType.Error)
1462 {
1463 return pattern;
1464 }
1466 if (pattern.NodeType == QilNodeType.Sequence)
1467 {
1468 qilList = (QilList)pattern;
1469 }
1470 else
1471 {
1473 qilList.Add(pattern);
1474 }
1475 QilNode qilNode = _f.False();
1476 int num = qilList.Count - 1;
1477 while (0 <= num)
1478 {
1481 num--;
1482 }
1483 return qilNode;
1484 }
1485
1487 {
1488 if (countPattern != null)
1489 {
1491 }
1492 QilNode currentNode = GetCurrentNode();
1493 XmlNodeKindFlags nodeKinds = currentNode.XmlType.NodeKinds;
1494 if ((nodeKinds & (nodeKinds - 1)) != 0)
1495 {
1496 return _f.InvokeIsSameNodeSort(testNode, currentNode);
1497 }
1498 QilNode left;
1499 switch (nodeKinds)
1500 {
1501 case XmlNodeKindFlags.Document:
1503 case XmlNodeKindFlags.Element:
1505 break;
1506 case XmlNodeKindFlags.Attribute:
1508 break;
1509 case XmlNodeKindFlags.Text:
1511 case XmlNodeKindFlags.Comment:
1513 case XmlNodeKindFlags.PI:
1515 case XmlNodeKindFlags.Namespace:
1517 default:
1518 return _f.False();
1519 }
1521 }
1522
1543
1564
1566 {
1568 if (qilNode != null)
1569 {
1570 if (qilNode.NodeType == QilNodeType.LiteralString)
1571 {
1572 string text = (QilLiteral)qilNode;
1573 if (text != "alphabetic" && text != "traditional")
1574 {
1575 if (fwdCompat)
1576 {
1577 return _f.String("default");
1578 }
1579 ReportError(System.SR.Xslt_BistateAttribute, "letter-value", "alphabetic", "traditional");
1580 }
1581 return qilNode;
1582 }
1584 return _f.Loop(qilIterator, _f.Conditional(_f.Or(_f.Eq(qilIterator, _f.String("alphabetic")), _f.Eq(qilIterator, _f.String("traditional"))), qilIterator, fwdCompat ? _f.String("default") : _f.Error(_lastScope.SourceLine, System.SR.Xslt_BistateAttribute, "letter-value", "alphabetic", "traditional")));
1585 }
1586 return _f.String("default");
1587 }
1588
1590 {
1592 if (qilNode == null)
1593 {
1594 qilNode = _f.String(string.Empty);
1595 }
1596 else if (qilNode.NodeType == QilNodeType.LiteralString)
1597 {
1598 string text = (QilLiteral)qilNode;
1599 if (text.Length != 1)
1600 {
1601 if (!fwdCompat)
1602 {
1603 ReportError(System.SR.Xslt_CharAttribute, "grouping-separator");
1604 }
1605 qilNode = _f.String(string.Empty);
1606 }
1607 }
1608 else
1609 {
1612 }
1613 return qilNode;
1614 }
1615
1617 {
1619 if (qilNode == null)
1620 {
1621 return _f.Double(0.0);
1622 }
1623 if (qilNode.NodeType == QilNodeType.LiteralString)
1624 {
1625 string s = (QilLiteral)qilNode;
1627 if (0.0 <= num && num <= 2147483647.0)
1628 {
1629 return _f.Double(num);
1630 }
1631 return _f.Double(0.0);
1632 }
1634 return _f.Loop(qilIterator, _f.Conditional(_f.And(_f.Lt(_f.Double(0.0), qilIterator), _f.Lt(qilIterator, _f.Double(2147483647.0))), qilIterator, _f.Double(0.0)));
1635 }
1636
1658
1660 {
1661 foreach (Template template in sheet.Templates)
1662 {
1663 if (template.Match == null)
1664 {
1665 continue;
1666 }
1667 EnterScope(template);
1668 QilNode qilNode = CompileMatchPattern(template.Match);
1669 if (qilNode.NodeType == QilNodeType.Sequence)
1670 {
1672 for (int i = 0; i < qilList.Count; i++)
1673 {
1674 sheet.AddTemplateMatch(template, (QilLoop)qilList[i]);
1675 }
1676 }
1677 else
1678 {
1679 sheet.AddTemplateMatch(template, (QilLoop)qilNode);
1680 }
1681 ExitScope();
1682 }
1683 sheet.SortTemplateMatches();
1684 Stylesheet[] imports = sheet.Imports;
1685 foreach (Stylesheet sheet2 in imports)
1686 {
1688 }
1689 }
1690
1715
1716 private void CreateGlobalVarPars()
1717 {
1719 {
1721 }
1723 {
1725 }
1726 }
1727
1729 {
1731 QilIterator qilIterator = ((varPar.NodeType != XslNodeType.Variable) ? _f.Parameter(null, varPar.Name, t) : _f.Let(_f.Unknown(t)));
1732 qilIterator.DebugName = varPar.Name.ToString();
1734 SetLineInfo(qilIterator, varPar.SourceLine);
1736 }
1737
1739 {
1740 _singlFocus.SetFocus(SingletonFocusType.InitialDocumentNode);
1742 {
1744 }
1746 {
1748 }
1749 _singlFocus.SetFocus(null);
1750 }
1751
1765
1767 {
1768 string text = ((e is XPathCompileException ex) ? ex.FormatDetailedMessage() : e.Message);
1770 }
1771
1776
1781
1782 private QilNode CompileXPathExpression(string expr)
1783 {
1786 if (expr == null)
1787 {
1789 }
1790 else
1791 {
1792 try
1793 {
1794 XPathScanner scanner = new XPathScanner(expr);
1796 }
1797 catch (XslLoadException ex)
1798 {
1799 if (_xslVersion != XslVersion.ForwardsCompatible)
1800 {
1802 }
1803 qilNode = _f.Error(_f.String(ex.Message));
1804 }
1805 }
1807 {
1808 qilNode = _f.Nop(qilNode);
1809 }
1810 return qilNode;
1811 }
1812
1814 {
1816 if (qilNode == null)
1817 {
1818 XPathCompileException ex = new XPathCompileException(expr, 0, expr.Length, System.SR.XPath_NodeSetExpected, (string[])null);
1819 if (_xslVersion != XslVersion.ForwardsCompatible)
1820 {
1822 }
1823 qilNode = _f.Error(_f.String(ex.Message));
1824 }
1825 return qilNode;
1826 }
1827
1828 private QilNode CompileXPathExpressionWithinAvt(string expr, ref int pos)
1829 {
1832 try
1833 {
1834 XPathScanner xPathScanner = new XPathScanner(expr, pos);
1836 pos = xPathScanner.LexStart + 1;
1837 }
1838 catch (XslLoadException ex)
1839 {
1840 if (_xslVersion != XslVersion.ForwardsCompatible)
1841 {
1843 }
1844 qilNode = _f.Error(_f.String(ex.Message));
1845 pos = expr.Length;
1846 }
1848 {
1849 qilNode = _f.Nop(qilNode);
1850 }
1851 return qilNode;
1852 }
1853
1855 {
1858 try
1859 {
1862 }
1863 catch (XslLoadException ex)
1864 {
1865 if (_xslVersion != XslVersion.ForwardsCompatible)
1866 {
1868 }
1871 }
1872 return qilNode;
1873 }
1874
1876 {
1878 try
1879 {
1882 }
1883 catch (XslLoadException ex)
1884 {
1885 if (_xslVersion != XslVersion.ForwardsCompatible)
1886 {
1888 }
1889 return _f.Error(_f.String(ex.Message));
1890 }
1891 }
1892
1894 {
1895 if (_keyMatchBuilder == null)
1896 {
1898 }
1900 if (pttrn == null)
1901 {
1902 return PhantomKeyMatch();
1903 }
1904 try
1905 {
1908 }
1909 catch (XslLoadException ex)
1910 {
1911 if (_xslVersion != XslVersion.ForwardsCompatible)
1912 {
1914 }
1915 return _f.Error(_f.String(ex.Message));
1916 }
1917 }
1918
1920 {
1921 string use = key.Use;
1924 if (use == null)
1925 {
1927 }
1928 else
1929 {
1930 try
1931 {
1934 }
1935 catch (XslLoadException ex)
1936 {
1937 if (_xslVersion != XslVersion.ForwardsCompatible)
1938 {
1940 }
1941 qilNode = _f.Error(_f.String(ex.Message));
1942 }
1943 }
1945 {
1946 qilNode = _f.Nop(qilNode);
1947 }
1948 return qilNode;
1949 }
1950
1952 {
1954 if (ignoreDefaultNs)
1955 {
1956 qilList.Add(_f.NamespaceDecl(_f.String(string.Empty), _f.String(string.Empty)));
1957 }
1959 while (enumerator.MoveNext())
1960 {
1961 CompilerScopeManager<QilIterator>.ScopeRecord current = enumerator.Current;
1962 string ncName = current.ncName;
1963 string nsUri = current.nsUri;
1964 if (!ignoreDefaultNs || ncName.Length != 0)
1965 {
1966 qilList.Add(_f.NamespaceDecl(_f.String(ncName), _f.String(nsUri)));
1967 }
1968 }
1970 }
1971
1973 {
1975 {
1976 return _f.Sequence();
1977 }
1978 return InvokeApplyFunction(sheet, node.Name, node.Content);
1979 }
1980
1981 private void SetArg(IList<XslNode> args, int pos, QilName name, QilNode value)
1982 {
1983 VarPar varPar;
1984 if (args.Count <= pos || args[pos].Name != name)
1985 {
1986 varPar = AstFactory.WithParam(name);
1987 args.Insert(pos, varPar);
1988 }
1989 else
1990 {
1991 varPar = (VarPar)args[pos];
1992 }
1994 }
1995
1997 {
1998 if (IsDebug)
1999 {
2000 flags = XslFlags.FocusFilter;
2001 }
2002 if ((flags & XslFlags.FocusFilter) != 0)
2003 {
2004 if (args == null || args.IsReadOnly)
2005 {
2006 args = new List<XslNode>(3);
2007 }
2008 int num = 0;
2009 if ((flags & XslFlags.Current) != 0)
2010 {
2012 }
2013 if ((flags & XslFlags.Position) != 0)
2014 {
2016 }
2017 if ((flags & XslFlags.Last) != 0)
2018 {
2020 }
2021 }
2022 return args;
2023 }
2024
2026 {
2028 {
2029 return false;
2030 }
2031 invokeArgs.Clear();
2032 for (int i = 0; i < formalArgs.Count; i++)
2033 {
2034 QilName name = ((QilParameter)formalArgs[i]).Name;
2035 XmlQueryType xmlType = formalArgs[i].XmlType;
2036 QilNode qilNode = null;
2037 for (int j = 0; j < actualArgs.Count; j++)
2038 {
2040 if (name.Equals(varPar.Name))
2041 {
2042 QilNode value = varPar.Value;
2043 XmlQueryType xmlType2 = value.XmlType;
2044 if (xmlType2 != xmlType && (!xmlType2.IsNode || !xmlType.IsNode || !xmlType2.IsSubtypeOf(xmlType)))
2045 {
2046 return false;
2047 }
2048 qilNode = value;
2049 break;
2050 }
2051 }
2052 if (qilNode == null)
2053 {
2054 return false;
2055 }
2057 }
2058 return true;
2059 }
2060
2062 {
2063 if (!sheet.ModeFlags.TryGetValue(mode, out var value))
2064 {
2065 value = XslFlags.None;
2066 }
2067 value |= XslFlags.Current;
2070 QilFunction qilFunction = null;
2071 if (!sheet.ApplyFunctions.TryGetValue(mode, out var value2))
2072 {
2073 List<QilFunction> list2 = (sheet.ApplyFunctions[mode] = new List<QilFunction>());
2074 value2 = list2;
2075 }
2076 foreach (QilFunction item in value2)
2077 {
2078 if (FillupInvokeArgs(item.Arguments, actualArgs, qilList))
2079 {
2080 qilFunction = item;
2081 break;
2082 }
2083 }
2084 if (qilFunction == null)
2085 {
2086 qilList.Clear();
2088 for (int i = 0; i < actualArgs.Count; i++)
2089 {
2091 qilList.Add(varPar.Value);
2096 }
2098 string text = ((mode.LocalName.Length == 0) ? string.Empty : (" mode=\"" + mode.QualifiedName + "\""));
2099 qilFunction.DebugName = ((sheet is RootLevel) ? "<xsl:apply-templates" : "<xsl:apply-imports") + text + ">";
2109 if (IsDebug)
2110 {
2112 }
2114 _curLoop = curLoop;
2118 }
2119 return _f.Invoke(qilFunction, qilList);
2120 }
2121
2122 public void ReportError(string res, params string[] args)
2123 {
2125 }
2126
2127 public void ReportWarning(string res, params string[] args)
2128 {
2130 }
2131
2132 private string ResolvePrefix(bool ignoreDefaultNs, string prefix)
2133 {
2134 if (ignoreDefaultNs && prefix.Length == 0)
2135 {
2136 return string.Empty;
2137 }
2139 if (text == null)
2140 {
2141 if (prefix.Length == 0)
2142 {
2143 text = string.Empty;
2144 }
2145 else
2146 {
2149 }
2150 }
2151 return text;
2152 }
2153
2155 {
2156 if (n.SourceLine == null)
2157 {
2158 SetLineInfo(n, lineInfo);
2159 }
2160 }
2161
2162 private static QilNode SetLineInfo(QilNode n, ISourceLineInfo lineInfo)
2163 {
2164 if (lineInfo != null && 0 < lineInfo.Start.Line && lineInfo.Start.LessOrEqual(lineInfo.End))
2165 {
2166 n.SourceLine = lineInfo;
2167 }
2168 return n;
2169 }
2170
2172 {
2174 qilIterator.DebugName = name.ToString();
2175 return _f.Loop(qilIterator, content);
2176 }
2177
2179 {
2180 if (n != null && nsList != null)
2181 {
2182 QilNode qilNode = GetNsVar(nsList);
2183 if (qilNode.XmlType.Cardinality == XmlQueryCardinality.One)
2184 {
2186 }
2188 }
2189 return n;
2190 }
2191
2193 {
2194 if (IsDebug)
2195 {
2196 content = AddDebugVariable(CloneName(_nameLast), GetLastPosition(), content);
2198 content = AddDebugVariable(CloneName(_nameCurrent), GetCurrentNode(), content);
2199 }
2200 return content;
2201 }
2202
2204 {
2205 return (QilName)name.ShallowClone(_f.BaseFactory);
2206 }
2207
2214
2216 {
2217 return GetCurrentNode();
2218 }
2219
2221 {
2222 return GetCurrentPosition();
2223 }
2224
2226 {
2227 return GetLastPosition();
2228 }
2229
2231 {
2233 }
2234
2236 {
2237 if (!_allowVariables)
2238 {
2240 }
2241 string uri = ResolvePrefixThrow(ignoreDefaultNs: true, prefix);
2242 QilNode qilNode = _scope.LookupVariable(name, uri);
2243 if (qilNode == null)
2244 {
2246 }
2247 XmlQueryType xmlType = qilNode.XmlType;
2248 if (qilNode.NodeType == QilNodeType.Parameter && xmlType.IsNode && xmlType.IsNotRtf && xmlType.MaybeMany && !xmlType.IsDod)
2249 {
2251 }
2252 return qilNode;
2253 }
2254
2255 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "Suppressing the warning for the ResolveFunction call on the Scripts since Scripts functionality is not supported by .NET Core")]
2257 {
2258 if (prefix.Length == 0)
2259 {
2260 if (FunctionTable.TryGetValue(name, out var value))
2261 {
2262 value.CastArguments(args, name, _f);
2263 switch (value.id)
2264 {
2265 case FuncId.Current:
2266 if (!_allowCurrent)
2267 {
2269 }
2270 return ((IFocus)this).GetCurrent();
2271 case FuncId.Key:
2272 if (!_allowKey)
2273 {
2275 }
2276 return CompileFnKey(args[0], args[1], env);
2277 case FuncId.Document:
2278 return CompileFnDocument(args[0], (args.Count > 1) ? args[1] : null);
2279 case FuncId.FormatNumber:
2280 return CompileFormatNumber(args[0], args[1], (args.Count > 2) ? args[2] : null);
2281 case FuncId.UnparsedEntityUri:
2282 return CompileUnparsedEntityUri(args[0]);
2283 case FuncId.GenerateId:
2284 return CompileGenerateId((args.Count > 0) ? args[0] : env.GetCurrent());
2285 case FuncId.SystemProperty:
2286 return CompileSystemProperty(args[0]);
2287 case FuncId.ElementAvailable:
2288 return CompileElementAvailable(args[0]);
2289 case FuncId.FunctionAvailable:
2290 return CompileFunctionAvailable(args[0]);
2291 default:
2292 return null;
2293 }
2294 }
2296 }
2298 if (text == "urn:schemas-microsoft-com:xslt")
2299 {
2300 switch (name)
2301 {
2302 case "node-set":
2304 return CompileMsNodeSet(args[0]);
2305 case "string-compare":
2308 case "utc":
2310 return _f.InvokeMsUtc(_f.ConvertToString(args[0]));
2311 case "format-date":
2312 case "format-time":
2314 return _f.InvokeMsFormatDateTime(_f.ConvertToString(args[0]), (1 < args.Count) ? _f.ConvertToString(args[1]) : _f.String(string.Empty), (2 < args.Count) ? _f.ConvertToString(args[2]) : _f.String(string.Empty), _f.Boolean(name == "format-date"));
2315 case "local-name":
2318 case "namespace-uri":
2320 return _f.InvokeMsNamespaceUri(_f.ConvertToString(args[0]), env.GetCurrent());
2321 case "number":
2323 return _f.InvokeMsNumber(args[0]);
2324 }
2325 }
2326 if (text == "http://exslt.org/common")
2327 {
2328 if (name == "node-set")
2329 {
2331 return CompileMsNodeSet(args[0]);
2332 }
2333 if (name == "object-type")
2334 {
2336 return EXslObjectType(args[0]);
2337 }
2338 }
2339 for (int i = 0; i < args.Count; i++)
2340 {
2342 }
2344 {
2346 if (xmlExtensionFunction != null)
2347 {
2349 }
2350 }
2352 {
2355 }
2356 return _f.XsltInvokeLateBound(_f.QName(name, text, prefix), args);
2357 }
2358
2360 {
2361 for (int i = 0; i < args.Count; i++)
2362 {
2363 XmlQueryType xmlArgumentType = scrFunc.GetXmlArgumentType(i);
2364 switch (xmlArgumentType.TypeCode)
2365 {
2366 case XmlTypeCode.Boolean:
2367 args[i] = _f.ConvertToBoolean(args[i]);
2368 break;
2369 case XmlTypeCode.Double:
2370 args[i] = _f.ConvertToNumber(args[i]);
2371 break;
2372 case XmlTypeCode.String:
2373 args[i] = _f.ConvertToString(args[i]);
2374 break;
2375 case XmlTypeCode.Node:
2377 break;
2378 }
2379 }
2380 return _f.XsltInvokeEarlyBound(name, scrFunc.Method, scrFunc.XmlReturnType, args);
2381 }
2382
2383 private string ResolvePrefixThrow(bool ignoreDefaultNs, string prefix)
2384 {
2385 if (ignoreDefaultNs && prefix.Length == 0)
2386 {
2387 return string.Empty;
2388 }
2390 if (text == null)
2391 {
2392 if (prefix.Length != 0)
2393 {
2395 }
2396 text = string.Empty;
2397 }
2398 return text;
2399 }
2400
2402 {
2404 dictionary.Add("current", new XPathBuilder.FunctionInfo<FuncId>(FuncId.Current, 0, 0, null));
2405 dictionary.Add("document", new XPathBuilder.FunctionInfo<FuncId>(FuncId.Document, 1, 2, s_argFnDocument));
2406 dictionary.Add("key", new XPathBuilder.FunctionInfo<FuncId>(FuncId.Key, 2, 2, s_argFnKey));
2407 dictionary.Add("format-number", new XPathBuilder.FunctionInfo<FuncId>(FuncId.FormatNumber, 2, 3, s_argFnFormatNumber));
2408 dictionary.Add("unparsed-entity-uri", new XPathBuilder.FunctionInfo<FuncId>(FuncId.UnparsedEntityUri, 1, 1, XPathBuilder.argString));
2409 dictionary.Add("generate-id", new XPathBuilder.FunctionInfo<FuncId>(FuncId.GenerateId, 0, 1, XPathBuilder.argNodeSet));
2410 dictionary.Add("system-property", new XPathBuilder.FunctionInfo<FuncId>(FuncId.SystemProperty, 1, 1, XPathBuilder.argString));
2411 dictionary.Add("element-available", new XPathBuilder.FunctionInfo<FuncId>(FuncId.ElementAvailable, 1, 1, XPathBuilder.argString));
2412 dictionary.Add("function-available", new XPathBuilder.FunctionInfo<FuncId>(FuncId.FunctionAvailable, 1, 1, XPathBuilder.argString));
2413 return dictionary;
2414 }
2415
2416 public static bool IsFunctionAvailable(string localName, string nsUri)
2417 {
2418 if (XPathBuilder.IsFunctionAvailable(localName, nsUri))
2419 {
2420 return true;
2421 }
2422 if (nsUri.Length == 0)
2423 {
2424 if (FunctionTable.ContainsKey(localName))
2425 {
2426 return localName != "unparsed-entity-uri";
2427 }
2428 return false;
2429 }
2430 if (nsUri == "urn:schemas-microsoft-com:xslt")
2431 {
2432 switch (localName)
2433 {
2434 default:
2435 return localName == "utc";
2436 case "node-set":
2437 case "format-date":
2438 case "format-time":
2439 case "local-name":
2440 case "namespace-uri":
2441 case "number":
2442 case "string-compare":
2443 return true;
2444 }
2445 }
2446 if (nsUri == "http://exslt.org/common")
2447 {
2448 if (!(localName == "node-set"))
2449 {
2450 return localName == "object-type";
2451 }
2452 return true;
2453 }
2454 return false;
2455 }
2456
2457 public static bool IsElementAvailable(XmlQualifiedName name)
2458 {
2459 if (name.Namespace == "http://www.w3.org/1999/XSL/Transform")
2460 {
2461 string name2 = name.Name;
2462 switch (name2)
2463 {
2464 default:
2465 return name2 == "variable";
2466 case "apply-imports":
2467 case "apply-templates":
2468 case "attribute":
2469 case "call-template":
2470 case "choose":
2471 case "comment":
2472 case "copy":
2473 case "copy-of":
2474 case "element":
2475 case "fallback":
2476 case "for-each":
2477 case "if":
2478 case "message":
2479 case "number":
2480 case "processing-instruction":
2481 case "text":
2482 case "value-of":
2483 return true;
2484 }
2485 }
2486 return false;
2487 }
2488
2497
2499 {
2500 if (name.NodeType == QilNodeType.LiteralString)
2501 {
2502 string text = (QilLiteral)name;
2503 _compiler.ParseQName(text, out var prefix, out var localName, default(ThrowErrorHelper));
2504 string uri = ResolvePrefixThrow(ignoreDefaultNs: true, prefix);
2505 QilName key2 = _f.QName(localName, uri, prefix);
2507 {
2509 }
2511 }
2512 if (_generalKey == null)
2513 {
2515 }
2516 QilIterator qilIterator = _f.Let(name);
2519 return _f.Loop(qilIterator, body);
2520 }
2521
2523 {
2524 if (defList.Count == 1)
2525 {
2526 return _f.Invoke(defList[0].Function, _f.ActualParameterList(env.GetCurrent(), key));
2527 }
2530 foreach (Key def in defList)
2531 {
2532 qilNode.Add(_f.Invoke(def.Function, _f.ActualParameterList(env.GetCurrent(), qilIterator)));
2533 }
2534 return _f.Loop(qilIterator, qilNode);
2535 }
2536
2538 {
2540 QilNode qilNode = null;
2541 foreach (Key def in defList)
2542 {
2543 qilNode = _f.Invoke(def.Function, _f.ActualParameterList(context, key));
2545 }
2546 if (defList.Count != 1)
2547 {
2548 return qilList;
2549 }
2550 return qilNode;
2551 }
2552
2569
2592
2594 {
2595 QilIterator n;
2596 QilNode baseUri = ((baseNode == null) ? _f.String(_lastScope.SourceLine.Uri) : ((!baseNode.XmlType.IsSingleton) ? _f.StrConcat(_f.Loop(n = _f.FirstNode(baseNode), _f.InvokeBaseUri(n))) : _f.InvokeBaseUri(baseNode)));
2597 return _f.DataSource(uri, baseUri);
2598 }
2599
2601 {
2603 if (formatName != null)
2604 {
2606 }
2607 else
2608 {
2610 formatName = _f.String(string.Empty);
2611 }
2612 if (xmlQualifiedName != null)
2613 {
2616 {
2618 }
2619 else
2620 {
2622 {
2624 }
2626 }
2627 if (formatPicture.NodeType == QilNodeType.LiteralString)
2628 {
2630 qilIterator.DebugName = _f.QName("formatter" + _formatterCnt++, "urn:schemas-microsoft-com:xslt-debug").ToString();
2633 }
2637 }
2642 }
2643
2645 {
2646 return _f.Error(_lastScope.SourceLine, System.SR.Xslt_UnsupportedXsltFunction, "unparsed-entity-uri");
2647 }
2648
2650 {
2651 if (n.XmlType.IsSingleton)
2652 {
2653 return _f.XsltGenerateId(n);
2654 }
2655 QilIterator expr;
2656 return _f.StrConcat(_f.Loop(expr = _f.FirstNode(n), _f.XsltGenerateId(expr)));
2657 }
2658
2660 {
2661 string qname = (QilLiteral)qilName;
2662 _compiler.ParseQName(qname, out var prefix, out var localName, default(ThrowErrorHelper));
2664 return new XmlQualifiedName(localName, ns);
2665 }
2666
2668 {
2669 if (name.NodeType == QilNodeType.LiteralString)
2670 {
2673 {
2675 if (xPathItem.ValueType == XsltConvert.StringType)
2676 {
2677 return _f.String(xPathItem.Value);
2678 }
2679 return _f.Double(xPathItem.ValueAsDouble);
2680 }
2681 name = _f.QName(xmlQualifiedName.Name, xmlQualifiedName.Namespace);
2682 }
2683 else
2684 {
2685 name = ResolveQNameDynamic(ignoreDefaultNs: true, name);
2686 }
2687 return _f.InvokeSystemProperty(name);
2688 }
2689
2691 {
2692 if (name.NodeType == QilNodeType.LiteralString)
2693 {
2696 {
2698 }
2699 name = _f.QName(xmlQualifiedName.Name, xmlQualifiedName.Namespace);
2700 }
2701 else
2702 {
2703 name = ResolveQNameDynamic(ignoreDefaultNs: false, name);
2704 }
2705 return _f.InvokeElementAvailable(name);
2706 }
2707
2709 {
2710 if (name.NodeType == QilNodeType.LiteralString)
2711 {
2713 if (EvaluateFuncCalls && (xmlQualifiedName.Namespace.Length == 0 || xmlQualifiedName.Namespace == "http://www.w3.org/1999/XSL/Transform"))
2714 {
2716 }
2717 name = _f.QName(xmlQualifiedName.Name, xmlQualifiedName.Namespace);
2718 }
2719 else
2720 {
2721 name = ResolveQNameDynamic(ignoreDefaultNs: true, name);
2722 }
2723 return _f.InvokeFunctionAvailable(name);
2724 }
2725
2727 {
2728 if (n.XmlType.IsNode && n.XmlType.IsNotRtf)
2729 {
2730 return n;
2731 }
2733 }
2734
2736 {
2738 {
2739 switch (n.XmlType.TypeCode)
2740 {
2741 case XmlTypeCode.Boolean:
2742 return _f.String("boolean");
2743 case XmlTypeCode.Double:
2744 return _f.String("number");
2745 case XmlTypeCode.String:
2746 return _f.String("string");
2747 }
2748 if (n.XmlType.IsNode && n.XmlType.IsNotRtf)
2749 {
2750 return _f.String("node-set");
2751 }
2752 }
2753 return _f.InvokeEXslObjectType(n);
2754 }
2755}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. IsReadOnly
void Add(TKey key, TValue value)
static string Xslt_XmlnsAttr
Definition SR.cs:1960
static string Xslt_UnknownXsltFunction
Definition SR.cs:1914
static string Xslt_InvalidVariable
Definition SR.cs:1902
static string Xslt_MissingAttribute
Definition SR.cs:1882
static string Xslt_ScriptsProhibited
Definition SR.cs:1986
static string Xslt_DocumentFuncProhibited
Definition SR.cs:1984
static string Xslt_BistateAttribute
Definition SR.cs:1886
static string Xslt_SingleRightBraceInAvt
Definition SR.cs:1892
static string XPath_NodeSetExpected
Definition SR.cs:1856
static string Xslt_CharAttribute
Definition SR.cs:1888
static string Xslt_InvalidCallTemplate
Definition SR.cs:1924
static string Xslt_NoAttributeSet
Definition SR.cs:1918
static string Xslt_InvalidPrefix
Definition SR.cs:1926
static string Xslt_CurrentNotAllowed
Definition SR.cs:1982
static string Xslt_UndefinedKey
Definition SR.cs:1920
static string Xslt_UnsupportedXsltFunction
Definition SR.cs:1916
static string Xslt_NoDecimalFormat
Definition SR.cs:1936
static string Xslt_DupLocalVariable
Definition SR.cs:1906
static string Xml_UserException
Definition SR.cs:14
static string Xslt_VariablesNotAllowed
Definition SR.cs:1980
static string Xslt_KeyNotAllowed
Definition SR.cs:1978
Definition SR.cs:7
override string ToString()
StringBuilder Append(char value, int repeatCount)
static bool IsCatchableException(Exception e)
static void Check(QilNode input)
QilList Sequence(IList< QilNode > values)
Definition QilFactory.cs:44
QilTernary Conditional(QilNode left, QilNode center, QilNode right)
override void Insert(int index, QilNode node)
Definition QilList.cs:78
override string ToString()
Definition QilName.cs:114
virtual XmlQueryType XmlType
Definition QilNode.cs:29
virtual void Add(QilNode node)
Definition QilNode.cs:121
QilIterator For(QilNode binding)
QilNode Filter(QilIterator variable, QilNode expr)
QilNode IsType(QilNode expr, XmlQueryType t)
QilSortKey SortKey(QilNode key, QilNode collation)
QilNode Invoke(QilFunction func, QilList args)
QilNode XsltInvokeLateBound(QilNode name, IList< QilNode > args)
QilNode AttributeCtor(QilNode name, QilNode val)
QilNode Before(QilNode left, QilNode right)
QilNode Loop(QilIterator variable, QilNode body)
QilNode Is(QilNode left, QilNode right)
QilNode Conditional(QilNode condition, QilNode trueBranch, QilNode falseBranch)
QilIterator Let(QilNode binding)
QilNode NodeRange(QilNode left, QilNode right)
QilNode XsltConvert(QilNode expr, XmlQueryType t)
QilNode XsltInvokeEarlyBound(QilNode name, MethodInfo d, XmlQueryType t, IList< QilNode > args)
QilNode And(QilNode left, QilNode right)
QilNode Or(QilNode left, QilNode right)
QilName QName(string local, string uri, string prefix)
QilNode ElementCtor(QilNode name, QilNode content)
QilNode DocOrderDistinct(QilNode collection)
QilNode Eq(QilNode left, QilNode right)
QilNode StrParseQName(QilNode str, QilNode ns)
QilNode XsltCopy(QilNode expr, QilNode content)
QilNode Lt(QilNode left, QilNode right)
QilNode Add(QilNode left, QilNode right)
QilNode DataSource(QilNode name, QilNode baseUri)
QilNode PICtor(QilNode name, QilNode content)
QilParameter Parameter(XmlQueryType t)
QilExpression QilExpression(QilNode root, QilFactory factory)
QilNode RtfCtor(QilNode content, QilNode baseUri)
QilFunction Function(QilList args, QilNode sideEffects, XmlQueryType resultType)
QilNode TypeAssert(QilNode expr, XmlQueryType t)
QilNode NamespaceDecl(QilNode prefix, QilNode uri)
static readonly Type StringType
static XPathItem SystemProperty(XmlQualifiedName name)
static double Round(double value)
static string LangToNameInternal(string lang, bool forwardCompatibility, IErrorHelper errorHelper)
static SourceLineInfo NoSource
static unsafe double StringToDouble(string s)
static void CheckArity(int minArgs, int maxArgs, string name, int numArgs)
static bool IsFunctionAvailable(string localName, string nsUri)
static readonly XmlTypeCode[] argString
static readonly XmlTypeCode[] argNodeSet
Node Parse(XPathScanner scanner, IXPathBuilder< Node > builder, LexKind endLex)
QilNode Error(string res, QilNode args)
static readonly XmlQueryType NodeSDod
static readonly XmlQueryType Namespace
static readonly XmlQueryType NamespaceS
static readonly XmlQueryType DoubleX
static readonly XmlQueryType Text
static readonly XmlQueryType QNameX
static readonly XmlQueryType StringX
static readonly XmlQueryType Attribute
static readonly XmlQueryType Node
static readonly XmlQueryType ContentS
static readonly XmlQueryType Element
static readonly XmlQueryType NodeS
static readonly XmlQueryType Comment
static readonly XmlQueryType NodeNotRtfS
static readonly XmlQueryType PI
static readonly XmlQueryType ItemS
static readonly XmlQueryType AnyAtomicType
static readonly XmlQueryType DocumentOrElement
static readonly XmlQueryType BooleanX
static XmlQueryType NodeChoice(XmlNodeKindFlags kinds)
static readonly XmlQueryType AttributeS
static readonly XmlQueryType Document
static readonly XmlQueryType NodeNotRtf
static readonly XmlQueryType Content
static string CreateMessage(ISourceLineInfo lineInfo, string res, params string[] args)
static VarPar WithParam(QilName name)
void AddVariable(QilName varName, V value)
bool IsLocalVariable(string localName, string uri)
V LookupVariable(string localName, string uri)
string LookupNamespace(string prefix, int from, int to)
Dictionary< QilName, AttributeSet > AttributeSets
Definition Compiler.cs:99
static string ConstructQName(string prefix, string localName)
Definition Compiler.cs:233
void ValidatePiName(string name, IErrorHelper errorHelper)
Definition Compiler.cs:274
Dictionary< QilName, Template > NamedTemplates
Definition Compiler.cs:97
bool IsPhantomName(QilName qname)
Definition Compiler.cs:300
void ReportWarning(ISourceLineInfo lineInfo, string res, params string[] args)
Definition Compiler.cs:337
List< VarPar > GlobalVars
Definition Compiler.cs:85
void ReportError(ISourceLineInfo lineInfo, string res, params string[] args)
Definition Compiler.cs:331
DecimalFormats DecimalFormats
Definition Compiler.cs:89
void ApplyNsAliases(ref string prefix, ref string nsUri)
Definition Compiler.cs:161
List< ProtoTemplate > AllTemplates
Definition Compiler.cs:93
bool ParseQName(string qname, out string prefix, out string localName, IErrorHelper errorHelper)
Definition Compiler.cs:242
List< VarPar > ExternalPars
Definition Compiler.cs:83
QilNode GenerateInvoke(QilFunction func, IList< XslNode > actualArgs)
QilNode BuildMatcher(QilIterator it, IList< XslNode > actualArgs, QilNode otherwise)
void CollectPatterns(StylesheetLevel sheet, QilName mode)
readonly string LetterValue
Definition Number.cs:17
readonly string GroupingSize
Definition Number.cs:21
readonly string Format
Definition Number.cs:13
readonly string Lang
Definition Number.cs:15
readonly string GroupingSeparator
Definition Number.cs:19
readonly string Count
Definition Number.cs:7
readonly string Value
Definition Number.cs:11
readonly string From
Definition Number.cs:9
void AddNamespace(string prefix, string uri)
QilNode FinishVariables(QilNode node, int varScope)
QilNode PlaceMarkerAny(QilNode countPattern, QilNode fromPattern)
QilIterator GetNsVar(QilList nsList)
QilNode GenerateScriptCall(QilName name, XmlExtensionFunction scrFunc, IList< QilNode > args)
QilNode CompileVariable(XslNode node)
QilNode CompileMatchPattern(string pttrn)
QilNode WrapLoopBody(ISourceLineInfo before, QilNode expr, ISourceLineInfo after)
QilNode CompileXPathExpression(string expr)
static readonly char[] s_curlyBraces
QilNode InvokeApplyFunction(StylesheetLevel sheet, QilName mode, IList< XslNode > actualArgs)
QilNode CompileCallTemplate(XslNodeEx node)
static readonly XmlTypeCode[] s_argFnKey
QilNode CompileFunctionAvailable(QilNode name)
QilNode ResolveQNameDynamic(bool ignoreDefaultNs, QilNode qilName)
void ReportErrorInXPath(XslLoadException e)
QilNode CompileInstructions(IList< XslNode > instructions, int from)
void CompileWithParam(VarPar withParam)
QilNode CompileElement(NodeCtor node)
readonly CompilerScopeManager< QilIterator > _scope
QilNode CompileXPathExpressionWithinAvt(string expr, ref int pos)
QilNode CompileLetterValueAttribute(string attValue, bool fwdCompat)
QilNode CompileSingleKey(List< Key > defList, QilIterator key, QilIterator context)
QilNode CompilePI(XslNode node)
QilNode CompileWhen(XslNode whenNode, QilNode otherwise)
QilIterator CompileGlobalVarPar(VarPar varPar)
QilNode CompileComment(XslNode node)
QilNode CompileGenerateId(QilNode n)
QilNode ExtractText(string source, ref int pos)
QilNode PlaceMarker(QilNode countPattern, QilNode fromPattern, bool multiple)
void ReportError(string res, params string[] args)
readonly XsltQilFactory _f
QilNode CompileLangToLcid(QilNode lang, bool fwdCompat)
QilNode CompileNop(XslNode node)
QilNode CompileCopyOf(XslNode node)
XmlQueryType ChooseBestType(VarPar var)
QilNode CompileCopy(XslNode copy)
QilNode CompileForEach(XslNodeEx node)
QilNode CompileInstructions(IList< XslNode > instructions, int from, QilList content)
QilNode CompileApplyImports(XslNode node)
QilNode CompileElementAvailable(QilNode name)
QilNode CompileChoose(XslNode node)
static readonly XmlTypeCode[] s_argFnDocument
readonly MatcherBuilder _matcherBuilder
QilNode CompileNumber(Number num)
QilExpression Compile(Compiler compiler)
void AddNsDecl(QilList content, string prefix, string nsUri)
QilNode CompileTextAvt(string avt)
static Dictionary< string, XPathBuilder.FunctionInfo< FuncId > > CreateFunctionTable()
QilNode CompileUnparsedEntityUri(QilNode n)
readonly VariableHelper _varHelper
QilNode CompileLangAttribute(string attValue, bool fwdCompat)
QilNode CompileSingleKey(QilNode name, QilNode key, IFocus env)
readonly InvokeGenerator _invkGen
readonly OutputScopeManager _outputScope
readonly ReferenceReplacer _refReplacer
QilNode CompileKeyMatch(string pttrn)
static QilNode SetLineInfo(QilNode n, ISourceLineInfo lineInfo)
QilNode CompileUseAttributeSet(XslNode node)
QilNode CompileAvt(string source)
QilNode CompileGroupingSizeAttribute(string attValue, bool fwdCompat)
QilNode CompileSingleKey(List< Key > defList, QilNode key, IFocus env)
void SetEnvironmentFlags(bool allowVariables, bool allowCurrent, bool allowKey)
QilNode CompileOrderAttribute(string attName, string attValue, string value0, string value1, bool fwdCompat)
QilNode CompileInstructions(IList< XslNode > instructions)
QilNode CompileFormatNumber(QilNode value, QilNode formatPicture, QilNode formatName)
QilNode AddDebugVariable(QilName name, QilNode value, QilNode content)
QilNode AddCurrentPositionLast(QilNode content)
QilNode CompileError(XslNode node)
QilNode CompileList(XslNode node)
readonly XPathParser< QilNode > _xpathParser
void SetArg(IList< XslNode > args, int pos, QilName name, QilNode value)
QilName CloneName(QilName name)
QilNode CompileValueOf(XslNode valueOf)
static readonly XmlTypeCode[] s_argFnFormatNumber
readonly HybridDictionary _prefixesInUse
void CompileDataTypeAttribute(string attValue, bool fwdCompat, ref QilNode select, out QilNode select2)
QilNode CompileStringAvt(string avt)
QilNode CompileValueOfDoe(XslNode valueOf)
QilNode CompileLiteralAttribute(XslNode node)
readonly StringBuilder _unescapedText
static Dictionary< string, XPathBuilder.FunctionInfo< FuncId > > FunctionTable
string ResolvePrefixThrow(bool ignoreDefaultNs, string prefix)
QilNode CompileVarParValue(XslNode node)
QilNode CompileNumberPattern(string pttrn)
QilNode CompileSingleDocument(QilNode uri, QilNode baseNode)
readonly XPathPatternParser _ptrnParser
static QilExpression CompileStylesheet(Compiler compiler)
QilNode GenerateApply(StylesheetLevel sheet, XslNode node)
QilNode MatchCountPattern(QilNode countPattern, QilIterator testNode)
void ReportWarning(string res, params string[] args)
QilNode CompileInstructions(IList< XslNode > instructions, QilList content)
readonly XPathBuilder _xpathBuilder
QilNode MatchPattern(QilNode pattern, QilIterator testNode)
QilNode CompileAttribute(NodeCtor node)
QilNode CompileIf(XslNode ifNode)
QilNode CompileSorts(IList< XslNode > content, ref LoopFocus parentLoop)
void CompileProtoTemplate(ProtoTemplate tmpl)
string ResolvePrefix(bool ignoreDefaultNs, string prefix)
bool FillupInvokeArgs(IList< QilNode > formalArgs, IList< XslNode > actualArgs, QilList invokeArgs)
QilNode CompileRootExpression(XslNode applyTmpls)
static bool IsElementAvailable(XmlQualifiedName name)
static bool IsFunctionAvailable(string localName, string nsUri)
QilList EnterScope(XslNode node)
readonly XPathPatternBuilder _ptrnBuilder
QilNode CompileFnKey(QilNode name, QilNode keys, IFocus env)
readonly XmlQueryType _elementOrDocumentType
readonly XmlQueryType _textOrAttributeType
XmlQualifiedName ResolveQNameThrow(bool ignoreDefaultNs, QilNode qilName)
QilNode CompileLiteralElement(XslNode node)
void CompileSort(Sort sort, QilList keyList, ref LoopFocus parentLoop)
QilNode CompileFnDocument(QilNode uris, QilNode baseNode)
QilNode CompileSystemProperty(QilNode name)
QilParameter CreateXslParam(QilName name, XmlQueryType xt)
readonly QilStrConcatenator _strConcat
IList< XslNode > AddRemoveImplicitArgs(IList< XslNode > args, XslFlags flags)
QilNode CompileMessage(XslNode node)
QilNode CompileMsNodeSet(QilNode n)
QilNode CompileGroupingSeparatorAttribute(string attValue, bool fwdCompat)
QilNode CompileApplyTemplates(XslNodeEx node)
void SetLineInfoCheck(QilNode n, ISourceLineInfo lineInfo)
void CompileAndSortMatches(Stylesheet sheet)
void CreateGlobalVarPar(VarPar varPar)
QilNode CompileLangAttributeToLcid(string attValue, bool fwdCompat)
QilNode CompileNodeSetExpression(string expr)
QilNode SetDebugNs(QilNode n, QilList nsList)
QilNode Replace(QilNode expr, QilReference lookFor, QilReference replaceBy)
TrimSafeDictionary ScriptClasses
Definition Scripts.cs:50
XmlExtensionFunction ResolveFunction(string name, string ns, int numArgs, IErrorHelper errorHelper)
Definition Scripts.cs:58
static void SetPriority(QilNode node, double priority)
QilNode Parse(XPathScanner scanner, IPatternBuilder ptrnBuilder)
XslFlags Analyze(Compiler compiler)
void Rewrite(Compiler compiler)
ISourceLineInfo SourceLine
Definition XslNode.cs:10
QilNode InvokeRegisterDecimalFormat(DecimalFormatDecl format)
QilNode InvokeMsStringCompare(QilNode x, QilNode y, QilNode lang, QilNode options)
QilNode InvokeLangToLcid(QilNode n, bool fwdCompat)
QilNode InvokeMsNamespaceUri(QilNode n, QilNode currentNode)
QilNode InvokeSystemProperty(QilNode n)
QilNode InvokeElementAvailable(QilNode n)
QilNode InvokeIsSameNodeSort(QilNode n1, QilNode n2)
QilNode InvokeMsFormatDateTime(QilNode datetime, QilNode format, QilNode lang, QilNode isDate)
QilNode InvokeFormatNumberStatic(QilNode value, QilNode decimalFormatIndex)
QilNode InvokeRegisterDecimalFormatter(QilNode formatPicture, DecimalFormatDecl format)
QilNode InvokeNumberFormat(QilNode value, QilNode format, QilNode lang, QilNode letterValue, QilNode groupingSeparator, QilNode groupingSize)
QilNode InvokeCheckScriptNamespace(string nsUri)
QilNode InvokeFormatNumberDynamic(QilNode value, QilNode formatPicture, QilNode decimalFormatName, QilNode errorMessageName)
QilNode InvokeOnCurrentNodeChanged(QilNode n)
QilNode InvokeFunctionAvailable(QilNode n)
QilNode ResolveFunction(string prefix, string name, IList< QilNode > args, IFocus env)
QilNode ResolveVariable(string prefix, string name)
string ResolvePrefix(string prefix)
bool LessOrEqual(Location that)
Definition Location.cs:19
void StartFocus(IList< QilNode > args, XslFlags flags)
void SetFocus(QilIterator current)
Definition LoopFocus.cs:24
QilLoop ConstructLoop(QilNode body)
Definition LoopFocus.cs:67
void Sort(QilNode sortKeys)
Definition LoopFocus.cs:58
void ReportError(string res, params string[] args)
void SetFocus(SingletonFocusType focusType)