322 references to XslFlags
System.Private.Xml (322)
System\Xml\Xsl\Xslt\Focus.cs (4)
102
public void StartFocus(IList<QilNode> args,
XslFlags
flags)
106
if ((flags &
XslFlags
.Current) != 0)
111
if ((flags &
XslFlags
.Position) != 0)
116
if ((flags &
XslFlags
.Last) != 0)
System\Xml\Xsl\Xslt\QilGenerator.cs (35)
410
switch (var.Flags &
XslFlags
.TypeFilter)
412
case
XslFlags
.String: return T.StringX;
413
case
XslFlags
.Number: return T.DoubleX;
414
case
XslFlags
.Boolean: return T.BooleanX;
415
case
XslFlags
.Node: return T.NodeNotRtf;
416
case
XslFlags
.Nodeset: return T.NodeNotRtfS;
417
case
XslFlags
.Rtf: return T.Node;
418
case
XslFlags
.Node |
XslFlags
.Rtf: return T.Node;
419
case
XslFlags
.Node |
XslFlags
.Nodeset: return T.NodeNotRtfS;
420
case
XslFlags
.Nodeset |
XslFlags
.Rtf: return T.NodeS;
421
case
XslFlags
.Node |
XslFlags
.Nodeset |
XslFlags
.Rtf: return T.NodeS;
481
XslFlags
flags = !IsDebug ? tmpl.Flags :
XslFlags
.FullFocus;
484
if ((flags &
XslFlags
.Current) != 0)
488
if ((flags &
XslFlags
.Position) != 0)
492
if ((flags &
XslFlags
.Last) != 0)
537
if ((xslPar.DefValueFlags &
XslFlags
.HasCalls) == 0)
563
xslPar.Flags |= (template.Flags &
XslFlags
.FocusFilter);
565
_f.Boolean((xslPar.DefValueFlags &
XslFlags
.SideEffects) != 0),
598
_f.Boolean((tmpl.Flags &
XslFlags
.SideEffects) != 0),
648
_funcFocus.StartFocus(tmpl.Function.Arguments, !IsDebug ? tmpl.Flags :
XslFlags
.FullFocus);
2541
private IList<XslNode>? AddRemoveImplicitArgs(IList<XslNode>? args,
XslFlags
flags)
2546
flags =
XslFlags
.FullFocus;
2548
if ((flags &
XslFlags
.FocusFilter) != 0)
2555
if ((flags &
XslFlags
.Current) != 0) { SetArg(args, pos++, _nameCurrent, GetCurrentNode()); }
2556
if ((flags &
XslFlags
.Position) != 0) { SetArg(args, pos++, _namePosition, GetCurrentPosition()); }
2557
if ((flags &
XslFlags
.Last) != 0) { SetArg(args, pos++, _nameLast, GetLastPosition()); }
2624
XslFlags
flags;
2630
flags |=
XslFlags
.Current; // Due to recursive nature of Apply(Templates/Imports) we will need current node any way
2680
_f.Boolean((flags &
XslFlags
.SideEffects) != 0),
System\Xml\Xsl\Xslt\Stylesheet.cs (2)
21
public Dictionary<QilName,
XslFlags
> ModeFlags = new Dictionary<QilName,
XslFlags
>();
System\Xml\Xsl\Xslt\XslAst.cs (2)
83
public
XslFlags
Flags;
223
public
XslFlags
DefValueFlags;
System\Xml\Xsl\Xslt\XslAstAnalyzer.cs (270)
20
internal sealed class XslAstAnalyzer : XslVisitor<
XslFlags
>
91
public void PropagateFlag(
XslFlags
flag)
96
v.Flags &= ~
XslFlags
.Stop;
101
if ((v.Flags &
XslFlags
.Stop) == 0)
111
private void DepthFirstSearch(V v,
XslFlags
flag)
113
Debug.Assert((v.Flags &
XslFlags
.Stop) == 0, "Already visited this vertex");
114
v.Flags |= (flag |
XslFlags
.Stop);
117
if ((u.Flags &
XslFlags
.Stop) == 0)
143
public
XslFlags
Analyze(Compiler compiler)
163
par.Flags |=
XslFlags
.AnyType;
171
XslFlags
result =
XslFlags
.None;
197
if ((par.Flags &
XslFlags
.MayBeDefault) != 0)
206
for (int flag = (int)
XslFlags
.Rtf; flag != 0; flag >>= 1)
208
_dataFlow!.PropagateFlag((
XslFlags
)flag);
223
if ((result &
XslFlags
.Current) != 0)
225
_revCall0Graph!.PropagateFlag(
XslFlags
.Current);
227
if ((result &
XslFlags
.Position) != 0)
229
_revCall0Graph!.PropagateFlag(
XslFlags
.Position);
231
if ((result &
XslFlags
.Last) != 0)
233
_revCall0Graph!.PropagateFlag(
XslFlags
.Last);
235
if ((result &
XslFlags
.SideEffects) != 0)
265
private static void FillModeFlags(Dictionary<QilName,
XslFlags
> parentModeFlags, Stylesheet sheet)
274
foreach (KeyValuePair<QilName,
XslFlags
> modeFlag in sheet.ModeFlags)
276
XslFlags
modeFlags;
287
XslFlags
templateFlags = tmpl.Flags & (
XslFlags
.FocusFilter |
XslFlags
.SideEffects);
290
XslFlags
modeFlags;
300
protected override
XslFlags
Visit(XslNode node)
303
XslFlags
result = base.Visit(node);
312
(result &
XslFlags
.TypeFilter & ~
XslFlags
.Rtf) == 0,
318
protected override
XslFlags
VisitChildren(XslNode node)
320
XslFlags
result =
XslFlags
.None;
329
protected override
XslFlags
VisitAttributeSet(AttributeSet node)
337
protected override
XslFlags
VisitTemplate(Template node)
345
protected override
XslFlags
VisitApplyImports(XslNode node)
351
return
XslFlags
.HasCalls |
XslFlags
.Current |
XslFlags
.Rtf;
354
protected override
XslFlags
VisitApplyTemplates(XslNode node)
357
XslFlags
result = ProcessExpr(node.Select);
378
modePar.Flags |= instr.Flags &
XslFlags
.TypeFilter;
388
return
XslFlags
.HasCalls |
XslFlags
.Rtf | result;
391
protected override
XslFlags
VisitAttribute(NodeCtor node)
394
XslFlags
.Rtf |
401
protected override
XslFlags
VisitCallTemplate(XslNode node)
403
XslFlags
result =
XslFlags
.None;
478
par.Flags |= found.Flags &
XslFlags
.TypeFilter;
484
par.Flags |=
XslFlags
.MayBeDefault;
489
return
XslFlags
.HasCalls |
XslFlags
.Rtf | result;
494
protected override
XslFlags
VisitComment(XslNode node)
496
return
XslFlags
.Rtf | VisitChildren(node);
499
protected override
XslFlags
VisitCopy(XslNode node)
503
return
XslFlags
.Current |
XslFlags
.Rtf | VisitChildren(node);
506
protected override
XslFlags
VisitCopyOf(XslNode node)
508
return
XslFlags
.Rtf | ProcessExpr(node.Select!);
511
protected override
XslFlags
VisitElement(NodeCtor node)
516
XslFlags
.Rtf |
523
protected override
XslFlags
VisitError(XslNode node)
525
return (VisitChildren(node) & ~
XslFlags
.TypeFilter) |
XslFlags
.SideEffects;
528
protected override
XslFlags
VisitForEach(XslNode node)
530
XslFlags
result = ProcessExpr(node.Select!);
541
result |= Visit(child) & ~
XslFlags
.FocusFilter;
548
protected override
XslFlags
VisitIf(XslNode node)
563
protected override
XslFlags
VisitLiteralAttribute(XslNode node)
566
XslFlags
.Rtf |
572
protected override
XslFlags
VisitLiteralElement(XslNode node)
574
return
XslFlags
.Rtf | VisitChildren(node);
577
protected override
XslFlags
VisitMessage(XslNode node)
579
return (VisitChildren(node) & ~
XslFlags
.TypeFilter) |
XslFlags
.SideEffects;
584
protected override
XslFlags
VisitNumber(Number node)
587
XslFlags
.Rtf |
590
(node.Value != null ? ProcessExpr(node.Value) :
XslFlags
.Current) |
601
protected override
XslFlags
VisitPI(XslNode node)
604
XslFlags
.Rtf |
610
protected override
XslFlags
VisitSort(Sort node)
615
ProcessExpr(node.Select!) & ~
XslFlags
.FocusFilter |
623
protected override
XslFlags
VisitText(Text node)
625
return
XslFlags
.Rtf | VisitChildren(node);
628
protected override
XslFlags
VisitUseAttributeSet(XslNode node)
644
return
XslFlags
.HasCalls |
XslFlags
.Rtf;
647
protected override
XslFlags
VisitValueOf(XslNode node)
649
return
XslFlags
.Rtf | ProcessExpr(node.Select!);
652
protected override
XslFlags
VisitValueOfDoe(XslNode node)
654
return
XslFlags
.Rtf | ProcessExpr(node.Select!);
657
protected override
XslFlags
VisitParam(VarPar node)
664
node.Flags |=
XslFlags
.MayBeDefault;
676
return node.DefValueFlags & ~
XslFlags
.TypeFilter;
679
protected override
XslFlags
VisitVariable(VarPar node)
682
return node.Flags & ~
XslFlags
.TypeFilter;
685
protected override
XslFlags
VisitWithParam(VarPar node)
688
return node.Flags & ~
XslFlags
.TypeFilter;
691
private
XslFlags
ProcessVarPar(VarPar node)
693
XslFlags
result;
707
result = _xpathAnalyzer!.Analyze(node.Select) | VisitChildren(node) |
XslFlags
.AnyType;
722
result =
XslFlags
.Rtf | VisitChildren(node);
727
result =
XslFlags
.String;
734
private
XslFlags
ProcessExpr(string expr)
736
return _xpathAnalyzer!.Analyze(expr) & ~
XslFlags
.TypeFilter;
740
private
XslFlags
ProcessAvt(string? avt)
742
return _xpathAnalyzer!.AnalyzeAvt(avt) & ~
XslFlags
.TypeFilter;
746
private
XslFlags
ProcessPattern(string? pattern)
749
return _xpathAnalyzer!.Analyze(pattern) & ~
XslFlags
.TypeFilter & ~
XslFlags
.FocusFilter;
776
t.Flags &= ~
XslFlags
.Stop;
780
t.Flags &= ~
XslFlags
.Stop;
785
if ((t.Flags &
XslFlags
.Stop) == 0)
787
if ((t.Flags &
XslFlags
.SideEffects) != 0)
795
if ((t.Flags &
XslFlags
.Stop) == 0)
797
if ((t.Flags &
XslFlags
.SideEffects) != 0)
807
Debug.Assert((t.Flags &
XslFlags
.Stop) == 0, "Already visited this vertex");
808
t.Flags |= (
XslFlags
.SideEffects |
XslFlags
.Stop);
812
if ((u.Flags &
XslFlags
.Stop) == 0)
816
Debug.Assert((u.Flags &
XslFlags
.SideEffects) ==
XslFlags
.SideEffects, "Flag was not set on an adjacent vertex");
820
if ((u.Flags &
XslFlags
.Stop) == 0)
824
Debug.Assert((u.Flags &
XslFlags
.SideEffects) ==
XslFlags
.SideEffects, "Flag was not set on an adjacent vertex");
835
if ((u.Flags &
XslFlags
.Stop) == 0)
839
Debug.Assert((u.Flags &
XslFlags
.SideEffects) ==
XslFlags
.SideEffects, "Flag was not set on an adjacent vertex");
853
internal sealed class XPathAnalyzer : IXPathBuilder<
XslFlags
>
855
private readonly XPathParser<
XslFlags
> _xpathParser = new XPathParser<
XslFlags
>();
877
public
XslFlags
Analyze(string? xpathExpr)
882
return
XslFlags
.None;
889
XslFlags
result = _xpathParser.Parse(scanner, this, LexKind.Eof);
892
result |=
XslFlags
.Current;
898
return
XslFlags
.AnyType |
XslFlags
.FullFocus;
902
public
XslFlags
AnalyzeAvt(string? source)
907
return
XslFlags
.None;
912
XslFlags
result =
XslFlags
.None;
936
result |=
XslFlags
.Current;
938
return result & ~
XslFlags
.TypeFilter;
942
return
XslFlags
.FullFocus;
975
public
XslFlags
EndBuild(
XslFlags
result)
980
public
XslFlags
String(string value)
983
return
XslFlags
.String;
986
public
XslFlags
Number(double value)
989
return
XslFlags
.Number;
992
private static readonly
XslFlags
[] s_operatorType = {
993
/*Unknown */
XslFlags
.AnyType,
994
/*Or */
XslFlags
.Boolean,
995
/*And */
XslFlags
.Boolean,
996
/*Eq */
XslFlags
.Boolean,
997
/*Ne */
XslFlags
.Boolean,
998
/*Lt */
XslFlags
.Boolean,
999
/*Le */
XslFlags
.Boolean,
1000
/*Gt */
XslFlags
.Boolean,
1001
/*Ge */
XslFlags
.Boolean,
1002
/*Plus */
XslFlags
.Number,
1003
/*Minus */
XslFlags
.Number,
1004
/*Multiply */
XslFlags
.Number,
1005
/*Divide */
XslFlags
.Number,
1006
/*Modulo */
XslFlags
.Number,
1007
/*UnaryMinus*/
XslFlags
.Number,
1008
/*Union */
XslFlags
.Nodeset,
1011
public
XslFlags
Operator(XPathOperator op,
XslFlags
left,
XslFlags
right)
1015
XslFlags
result = (left | right) & ~
XslFlags
.TypeFilter;
1019
public
XslFlags
Axis(XPathAxis xpathAxis, XPathNodeType nodeType, string? prefix, string? name)
1024
return
XslFlags
.Current |
XslFlags
.Node;
1028
return
XslFlags
.Current |
XslFlags
.Nodeset;
1033
public
XslFlags
JoinStep(
XslFlags
left,
XslFlags
right)
1036
return (left & ~
XslFlags
.TypeFilter) |
XslFlags
.Nodeset; // "ex:Foo(position())/Bar"
1040
public
XslFlags
Predicate(
XslFlags
nodeset,
XslFlags
predicate, bool isReverseStep)
1043
return (nodeset & ~
XslFlags
.TypeFilter) |
XslFlags
.Nodeset | (predicate &
XslFlags
.SideEffects); // "ex:Foo(position())[Bar]"
1046
public
XslFlags
Variable(string prefix, string name)
1051
return
XslFlags
.AnyType;
1053
return
XslFlags
.None;
1059
public
XslFlags
Function(string prefix, string name, IList<
XslFlags
> args)
1063
XslFlags
argsFlags =
XslFlags
.None;
1064
foreach (
XslFlags
t in args)
1069
XslFlags
funcFlags =
XslFlags
.None;
1090
funcFlags |=
XslFlags
.Current;
1103
funcFlags |=
XslFlags
.Current;
1114
case "node-set": funcFlags =
XslFlags
.Nodeset; break;
1115
case "string-compare": funcFlags =
XslFlags
.Number; break;
1116
case "utc": funcFlags =
XslFlags
.String; break;
1117
case "format-date": funcFlags =
XslFlags
.String; break;
1118
case "format-time": funcFlags =
XslFlags
.String; break;
1119
case "local-name": funcFlags =
XslFlags
.String; break;
1120
case "namespace-uri": funcFlags =
XslFlags
.String |
XslFlags
.Current; break;
1121
case "number": funcFlags =
XslFlags
.Number; break;
1128
case "node-set": funcFlags =
XslFlags
.Nodeset; break;
1129
case "object-type": funcFlags =
XslFlags
.String; break;
1133
if (funcFlags ==
XslFlags
.None)
1136
funcFlags =
XslFlags
.AnyType;
1145
funcFlags =
XslFlags
.String;
1149
funcFlags =
XslFlags
.Number;
1153
funcFlags =
XslFlags
.Boolean;
1157
funcFlags =
XslFlags
.Node;
1161
funcFlags =
XslFlags
.Nodeset;
1165
funcFlags =
XslFlags
.AnyType;
1169
funcFlags =
XslFlags
.Nodeset;
1177
funcFlags |=
XslFlags
.SideEffects;
1181
return (argsFlags & ~
XslFlags
.TypeFilter) | funcFlags;
1185
private static readonly
XslFlags
[] s_XPathFunctionFlags = {
1186
/*Last */
XslFlags
.Number |
XslFlags
.Last,
1187
/*Position */
XslFlags
.Number |
XslFlags
.Position,
1188
/*Count */
XslFlags
.Number,
1189
/*LocalName */
XslFlags
.String, // | XslFlags.Current if 0 args
1190
/*NamespaceUri */
XslFlags
.String, // | XslFlags.Current if 0 args
1191
/*Name */
XslFlags
.String, // | XslFlags.Current if 0 args
1192
/*String */
XslFlags
.String, // | XslFlags.Current if 0 args
1193
/*Number */
XslFlags
.Number, // | XslFlags.Current if 0 args
1194
/*Boolean */
XslFlags
.Boolean,
1195
/*True */
XslFlags
.Boolean,
1196
/*False */
XslFlags
.Boolean,
1197
/*Not */
XslFlags
.Boolean,
1198
/*Id */
XslFlags
.Nodeset |
XslFlags
.Current,
1199
/*Concat */
XslFlags
.String,
1200
/*StartsWith */
XslFlags
.Boolean,
1201
/*Contains */
XslFlags
.Boolean,
1202
/*SubstringBefore */
XslFlags
.String,
1203
/*SubstringAfter */
XslFlags
.String,
1204
/*Substring */
XslFlags
.String,
1205
/*StringLength */
XslFlags
.Number, // | XslFlags.Current if 0 args
1206
/*Normalize */
XslFlags
.String, // | XslFlags.Current if 0 args
1207
/*Translate */
XslFlags
.String,
1208
/*Lang */
XslFlags
.Boolean |
XslFlags
.Current,
1209
/*Sum */
XslFlags
.Number,
1210
/*Floor */
XslFlags
.Number,
1211
/*Ceiling */
XslFlags
.Number,
1212
/*Round */
XslFlags
.Number,
1217
private static readonly
XslFlags
[] s_xsltFunctionFlags = {
1218
/*Current */
XslFlags
.Node, // xsltCurrentNeeded = true
1219
/*Document */
XslFlags
.Nodeset,
1220
/*Key */
XslFlags
.Nodeset |
XslFlags
.Current,
1221
/*FormatNumber */
XslFlags
.String,
1222
/*UnparsedEntityUri */
XslFlags
.String, // | XslFlags.Current if it is implemented
1223
/*GenerateId */
XslFlags
.String, // | XslFlags.Current if 0 args
1224
/*SystemProperty */
XslFlags
.String |
XslFlags
.Number,
1225
/*ElementAvailable */
XslFlags
.Boolean,
1226
/*FunctionAvailable */
XslFlags
.Boolean,
System\Xml\Xsl\Xslt\XslFlags.cs (9)
19
AnyType =
XslFlags
.String |
XslFlags
.Number |
XslFlags
.Boolean |
XslFlags
.Node |
XslFlags
.Nodeset |
XslFlags
.Rtf,
27
FullFocus =
XslFlags
.Current |
XslFlags
.Position |
XslFlags
.Last,