2 writes to _input
System.Private.Xml (2)
System\Xml\Xsl\Xslt\XsltLoader.cs (2)
244
_input
= new XsltInput(reader, _compiler, _atoms);
285
_input
= prevInput;
326 references to _input
System.Private.Xml (326)
System\Xml\Xsl\Xslt\XsltLoader.cs (326)
241
XsltInput prevInput =
_input
;
278
_input
.BuildReaderLineInfo()
293
if (!
_input
.FindStylesheetElement())
298
Debug.Assert(
_input
.NodeType == XmlNodeType.Element);
299
if (
_input
.IsXsltNamespace())
302
_input
.IsKeyword(_atoms.Stylesheet) ||
303
_input
.IsKeyword(_atoms.Transform)
311
_input
.SkipNode();
318
_input
.Finish();
323
Debug.Assert(!
_input
.IsXsltNamespace());
327
_curTemplate = F.Template(/*name:*/null, /*match:*/"/", /*mode:*/nullMode, /*priority:*/double.NaN,
_input
.XslVersion);
330
_input
.CanHaveApplyImports = true;
355
Debug.Assert(
_input
.IsXsltNamespace() && (
_input
.IsKeyword(_atoms.Stylesheet) ||
_input
.IsKeyword(_atoms.Transform)));
356
ContextInfo ctxInfo =
_input
.GetAttributes(_stylesheetAttributes);
361
QName parentName =
_input
.ElementName;
362
if (
_input
.MoveToFirstChild())
368
switch (
_input
.NodeType)
371
if (
_input
.IsXsltNamespace())
373
if (
_input
.IsKeyword(_atoms.Import))
377
ReportError(/*[XT0200]*/SR.Xslt_NotAtTop,
_input
.QualifiedName, parentName);
378
_input
.SkipNode();
386
else if (
_input
.IsKeyword(_atoms.Include))
390
else if (
_input
.IsKeyword(_atoms.StripSpace))
394
else if (
_input
.IsKeyword(_atoms.PreserveSpace))
398
else if (
_input
.IsKeyword(_atoms.Output))
402
else if (
_input
.IsKeyword(_atoms.Key))
406
else if (
_input
.IsKeyword(_atoms.DecimalFormat))
410
else if (
_input
.IsKeyword(_atoms.NamespaceAlias))
414
else if (
_input
.IsKeyword(_atoms.AttributeSet))
418
else if (
_input
.IsKeyword(_atoms.Variable))
422
else if (
_input
.IsKeyword(_atoms.Param))
426
else if (
_input
.IsKeyword(_atoms.Template))
440
_input
.GetVersionAttribute();
441
if (!
_input
.ForwardCompatibility)
443
ReportError(/*[XT_003]*/SR.Xslt_UnexpectedElement,
_input
.QualifiedName, parentName);
445
_input
.SkipNode();
448
else if (
_input
.IsNs(_atoms.UrnMsxsl) &&
_input
.IsKeyword(_atoms.Script))
454
if (
_input
.IsNullNamespace())
456
ReportError(/*[XT0130]*/SR.Xslt_NullNsAtTopLevel,
_input
.LocalName);
459
_input
.SkipNode();
468
Debug.Assert(
_input
.NodeType == XmlNodeType.Text);
472
} while (
_input
.MoveToNextSibling());
482
_input
.GetAttributes(_importIncludeAttributes);
484
if (
_input
.MoveToXsltAttribute(0, "href"))
487
Uri uri = ResolveUri(
_input
.Value,
_input
.BaseUri!);
492
ReportError(/*[XT0210]*/SR.Xslt_CircularInclude,
_input
.Value);
511
_input
.GetAttributes(_importIncludeAttributes);
513
if (
_input
.MoveToXsltAttribute(0, "href"))
515
Uri uri = ResolveUri(
_input
.Value,
_input
.BaseUri!);
520
ReportError(/*[XT0180]*/SR.Xslt_CircularInclude,
_input
.Value);
538
ContextInfo ctxInfo =
_input
.GetAttributes(_loadStripSpaceAttributes);
541
if (
_input
.MoveToXsltAttribute(0, _atoms.Elements))
543
ParseWhitespaceRules(
_input
.Value, false);
550
ContextInfo ctxInfo =
_input
.GetAttributes(_loadStripSpaceAttributes);
553
if (
_input
.MoveToXsltAttribute(0, _atoms.Elements))
555
ParseWhitespaceRules(
_input
.Value, true);
581
_input
.GetAttributes(_outputAttributes);
591
if (
_input
.MoveToXsltAttribute(1, "method"))
597
XmlQualifiedName? method = ParseOutputMethod(
_input
.Value, out outputMethod);
598
if (_compiler.ExitForwardsCompatible(
_input
.ForwardCompatibility) && method != null)
614
if (
_input
.MoveToXsltAttribute(3, "cdata-section-elements"))
618
string[] qnames = XmlConvert.SplitString(
_input
.Value);
624
if (_compiler.ExitForwardsCompatible(
_input
.ForwardCompatibility))
630
if (
_input
.MoveToXsltAttribute(4, "doctype-public"))
634
if (currentPrec == output.DocTypePublicPrec && settings.DocTypePublic !=
_input
.Value)
638
settings.DocTypePublic =
_input
.Value;
643
if (
_input
.MoveToXsltAttribute(5, "doctype-system"))
647
if (currentPrec == output.DocTypeSystemPrec && settings.DocTypeSystem !=
_input
.Value)
651
settings.DocTypeSystem =
_input
.Value;
656
if (
_input
.MoveToXsltAttribute(6, "encoding"))
663
Encoding encoding = Encoding.GetEncoding(
_input
.Value);
664
if (currentPrec == output.EncodingPrec && output.Encoding !=
_input
.Value)
669
output.Encoding =
_input
.Value;
674
if (!
_input
.ForwardCompatibility)
676
ReportWarning(/*[XT_004]*/SR.Xslt_InvalidEncoding,
_input
.Value);
703
if (
_input
.MoveToXsltAttribute(10, "media-type"))
707
if (currentPrec == output.MediaTypePrec && settings.MediaType !=
_input
.Value)
711
settings.MediaType =
_input
.Value;
716
if (
_input
.MoveToXsltAttribute(11, "normalization-form"))
757
if (
_input
.MoveToXsltAttribute(16, "version"))
761
if (currentPrec == output.VersionPrec && output.Version !=
_input
.Value)
767
output.Version =
_input
.Value;
851
ContextInfo ctxInfo =
_input
.GetAttributes(_keyAttributes);
859
_input
.MoveToElement();
867
_input
.SkipNode();
892
Key key = (Key)SetInfo(F.Key(keyName, match, use,
_input
.XslVersion), null, ctxInfo);
924
ContextInfo ctxInfo =
_input
.GetAttributes(_decimalFormatAttributes);
928
if (
_input
.MoveToXsltAttribute(0, "name"))
931
name = ResolveQName(/*ignoreDefaultNs:*/true,
_input
.Value);
932
if (!_compiler.ExitForwardsCompatible(
_input
.ForwardCompatibility))
944
if (
_input
.MoveToXsltAttribute(1, "infinity"))
946
infinity =
_input
.Value;
950
if (
_input
.MoveToXsltAttribute(2, "NaN"))
952
nan =
_input
.Value;
972
bool dummy =
_input
.MoveToXsltAttribute(3 + j, _decimalFormatAttributes[3 + j].name) ||
_input
.MoveToXsltAttribute(3 + i, _decimalFormatAttributes[3 + i].name);
984
_input
.MoveToXsltAttribute(1, "infinity");
986
_input
.MoveToXsltAttribute(2, "NaN");
990
_input
.MoveToXsltAttribute(3 + idx, _decimalFormatAttributes[3 + idx].name);
1010
ContextInfo ctxInfo =
_input
.GetAttributes(_namespaceAliasAttributes);
1017
if (
_input
.MoveToXsltAttribute(0, "stylesheet-prefix"))
1019
if (
_input
.Value.Length == 0)
1025
stylesheetNsUri =
_input
.LookupXmlNamespace(
_input
.Value == "#default" ? string.Empty :
_input
.Value);
1029
if (
_input
.MoveToXsltAttribute(1, "result-prefix"))
1031
if (
_input
.Value.Length == 0)
1037
resultPrefix =
_input
.Value == "#default" ? string.Empty :
_input
.Value;
1038
resultNsUri =
_input
.LookupXmlNamespace(resultPrefix);
1052
_input
.MoveToElement();
1063
ContextInfo ctxInfo =
_input
.GetAttributes(_attributeSetAttributes);
1084
if (
_input
.MoveToXsltAttribute(1, "use-attribute-sets"))
1089
QName parentName =
_input
.ElementName;
1090
if (
_input
.MoveToFirstChild())
1094
switch (
_input
.NodeType)
1098
if (
_input
.IsXsltKeyword(_atoms.Attribute))
1104
ReportError(/*[XT_006]*/SR.Xslt_UnexpectedElement,
_input
.QualifiedName, parentName);
1105
_input
.SkipNode();
1112
Debug.Assert(
_input
.NodeType == XmlNodeType.Text);
1116
} while (
_input
.MoveToNextSibling());
1124
Debug.Assert(
_input
.CanHaveApplyImports == false);
1142
ContextInfo ctxInfo =
_input
.GetAttributes(_templateAttributes);
1148
if (
_input
.MoveToXsltAttribute(2, "priority"))
1150
priority = XPathConvert.StringToDouble(
_input
.Value);
1151
if (double.IsNaN(priority) && !
_input
.ForwardCompatibility)
1153
ReportError(/*[XT0530]*/SR.Xslt_InvalidAttrValue, "priority",
_input
.Value);
1160
CheckError(!
_input
.AttributeExists(1, "name"), /*[XT_007]*/SR.Xslt_BothMatchNameAbsent);
1161
CheckError(
_input
.AttributeExists(3, "mode"), /*[XT_008]*/SR.Xslt_ModeWithoutMatch);
1163
if (
_input
.AttributeExists(2, "priority"))
1176
if (
_input
.MoveToXsltAttribute(4, "as"))
1181
_curTemplate = F.Template(name, match, mode, priority,
_input
.XslVersion);
1184
_input
.CanHaveApplyImports = (match != null);
1287
ContextInfo ctxInfo =
_input
.GetAttributes(_scriptAttributes);
1292
if (
_input
.MoveToXsltAttribute(0, "implements-prefix"))
1294
if (
_input
.Value.Length == 0)
1296
ReportError(/*[XT_009]*/SR.Xslt_EmptyAttrValue, "implements-prefix",
_input
.Value);
1300
scriptNs =
_input
.LookupXmlNamespace(
_input
.Value);
1315
_input
.SkipNode();
1369
QName parentName =
_input
.ElementName;
1370
if (
_input
.MoveToFirstChild())
1378
switch (
_input
.NodeType)
1381
string nspace =
_input
.NamespaceUri;
1382
string name =
_input
.LocalName;
1399
ReportError(error,
_input
.QualifiedName, parentName);
1401
_input
.SkipNode();
1450
result = SetLineInfo(F.Text(
_input
.Value),
_input
.BuildLineInfo());
1455
Debug.Assert(
_input
.NodeType == XmlNodeType.Text);
1460
} while (
_input
.MoveToNextSibling());
1468
QName parentName =
_input
.ElementName;
1471
if (
_input
.MoveToFirstChild())
1476
switch (
_input
.NodeType)
1479
if (
_input
.IsXsltKeyword(_atoms.WithParam))
1485
else if (flags == InstructionFlags.AllowSort &&
_input
.IsXsltKeyword(_atoms.Sort))
1489
else if (flags == InstructionFlags.AllowFallback &&
_input
.IsXsltKeyword(_atoms.Fallback))
1495
ReportError(/*[XT_016]*/SR.Xslt_UnexpectedElement,
_input
.QualifiedName, parentName);
1496
_input
.SkipNode();
1503
Debug.Assert(
_input
.NodeType == XmlNodeType.Text);
1507
} while (
_input
.MoveToNextSibling());
1515
ContextInfo ctxInfo =
_input
.GetAttributes();
1516
if (!
_input
.CanHaveApplyImports)
1519
_input
.SkipNode();
1525
ctxInfo.SaveExtendedLineInfo(
_input
);
1532
if (!
_input
.ForwardCompatibility)
1549
return SetInfo(F.ApplyImports(/*Mode:*/_curTemplate!.Mode, _curStylesheet,
_input
.XslVersion), content, ctxInfo);
1559
ContextInfo ctxInfo =
_input
.GetAttributes(_applyTemplatesAttributes);
1565
ctxInfo.SaveExtendedLineInfo(
_input
);
1566
return SetInfo(F.ApplyTemplates(mode, select, ctxInfo,
_input
.XslVersion),
1578
ContextInfo ctxInfo =
_input
.GetAttributes(_callTemplateAttributes);
1582
ctxInfo.SaveExtendedLineInfo(
_input
);
1597
ContextInfo ctxInfo =
_input
.GetAttributes(_copyAttributes);
1605
if (
_input
.MoveToXsltAttribute(2, "use-attribute-sets"))
1624
ContextInfo ctxInfo =
_input
.GetAttributes(_copyOfAttributes);
1633
return SetInfo(F.CopyOf(select,
_input
.XslVersion), null, ctxInfo);
1640
_input
.GetAttributes();
1641
_input
.SkipNode();
1650
ContextInfo ctxInfo =
_input
.GetAttributes(_ifAttributes);
1653
return SetInfo(F.If(test,
_input
.XslVersion), LoadInstructions(), ctxInfo);
1658
ContextInfo ctxInfo =
_input
.GetAttributes();
1664
QName parentName =
_input
.ElementName;
1665
if (
_input
.MoveToFirstChild())
1669
switch (
_input
.NodeType)
1673
if (Ref.Equal(
_input
.NamespaceUri, _atoms.UriXsl))
1675
if (Ref.Equal(
_input
.LocalName, _atoms.When))
1680
_input
.SkipNode();
1689
else if (Ref.Equal(
_input
.LocalName, _atoms.Otherwise))
1694
_input
.SkipNode();
1706
ReportError(/*[XT_020]*/SR.Xslt_UnexpectedElement,
_input
.QualifiedName, parentName);
1707
_input
.SkipNode();
1716
Debug.Assert(
_input
.NodeType == XmlNodeType.Text);
1720
} while (
_input
.MoveToNextSibling());
1728
ContextInfo ctxInfo =
_input
.GetAttributes();
1737
ContextInfo ctxInfo =
_input
.GetAttributes(_forEachAttributes);
1741
_input
.CanHaveApplyImports = false;
1743
ctxInfo.SaveExtendedLineInfo(
_input
);
1745
return SetInfo(F.ForEach(select, ctxInfo,
_input
.XslVersion),
1758
ContextInfo ctxInfo =
_input
.GetAttributes(_messageAttributes);
1770
content.Insert(0, F.CopyOf(select,
_input
.XslVersion));
1793
ContextInfo ctxInfo =
_input
.GetAttributes(_numberAttributes);
1799
if (
_input
.MoveToXsltAttribute(2, "level"))
1801
switch (
_input
.Value)
1807
if (!
_input
.ForwardCompatibility)
1809
ReportError(/*[XT_022]*/SR.Xslt_InvalidAttrValue, "level",
_input
.Value);
1831
_input
.XslVersion
1845
ContextInfo ctxInfo =
_input
.GetAttributes(_valueOfAttributes);
1862
_input
.SkipNode();
1870
CheckError(select == null && content.Count == 0, /*[???]*/SR.Xslt_NoSelectNoContent,
_input
.ElementName);
1877
return SetInfo(F.XslNode(doe ? XslNodeType.ValueOfDoe : XslNodeType.ValueOf, null, select,
_input
.XslVersion),
1914
string localName =
_input
.LocalName;
1922
ContextInfo ctxInfo =
_input
.GetAttributes(
1944
if (!
_input
.ForwardCompatibility)
1958
VarPar result = F.VarPar(nodeType, name, select,
_input
.XslVersion);
1970
ContextInfo ctxInfo =
_input
.GetAttributes(_commentAttributes);
1979
QName parentName =
_input
.ElementName;
1998
ContextInfo ctxInfo =
_input
.GetAttributes(_processingInstructionAttributes);
2003
return SetInfo(F.PI(name,
_input
.XslVersion), LoadContent(select != null), ctxInfo);
2012
ContextInfo ctxInfo =
_input
.GetAttributes(_textAttributes);
2020
QName parentName =
_input
.ElementName;
2021
if (
_input
.MoveToFirstChild())
2025
switch (
_input
.NodeType)
2031
content.Add(F.Text(
_input
.Value, hints));
2034
Debug.Assert(
_input
.NodeType == XmlNodeType.Element);
2035
ReportError(/*[XT_023]*/SR.Xslt_UnexpectedElement,
_input
.QualifiedName, parentName);
2036
_input
.SkipNode();
2039
} while (
_input
.MoveToNextSibling());
2058
ContextInfo ctxInfo =
_input
.GetAttributes(_elementAttributes);
2071
if (
_input
.MoveToXsltAttribute(3, "use-attribute-sets"))
2075
return SetInfo(F.Element(name, ns,
_input
.XslVersion),
2092
ContextInfo ctxInfo =
_input
.GetAttributes(_attributeAttributes);
2106
return SetInfo(F.Attribute(name, ns,
_input
.XslVersion), LoadContent(select != null), ctxInfo);
2122
ContextInfo ctxInfo =
_input
.GetAttributes(_sortAttributes);
2153
return SetInfo(F.Sort(select, lang, dataType, order, caseOrder,
_input
.XslVersion),
2480
Debug.Assert(
_input
.NodeType == XmlNodeType.Element);
2481
string prefix =
_input
.Prefix;
2482
string name =
_input
.LocalName;
2483
string nsUri =
_input
.NamespaceUri;
2485
ContextInfo ctxInfo =
_input
.GetLiteralAttributes(asStylesheet);
2487
if (
_input
.IsExtensionNamespace(nsUri))
2495
for (int i = 1;
_input
.MoveToLiteralAttribute(i); i++)
2497
if (
_input
.IsXsltNamespace() &&
_input
.IsKeyword(_atoms.UseAttributeSets))
2503
for (int i = 1;
_input
.MoveToLiteralAttribute(i); i++)
2505
if (!
_input
.IsXsltNamespace())
2507
XslNode att = F.LiteralAttribute(F.QName(
_input
.LocalName,
_input
.NamespaceUri,
_input
.Prefix),
_input
.Value,
_input
.XslVersion);
2547
if (_compiler.IsDebug && !
_input
.IsEmptyElement)
2549
AddInstruction(content, SetLineInfo(F.Nop(),
_input
.BuildLineInfo()));
2556
_input
.GetVersionAttribute();
2557
if (!
_input
.ForwardCompatibility)
2559
ReportError(/*[XT_026]*/SR.Xslt_UnexpectedElement,
_input
.QualifiedName, parentName);
2560
_input
.SkipNode();
2565
ContextInfo ctxInfo =
_input
.GetAttributes();
2566
List<XslNode> fallbacks = LoadFallbacks(
_input
.LocalName);
2573
_input
.MoveToElement();
2574
ISourceLineInfo extElmLineInfo =
_input
.BuildNameLineInfo();
2577
if (
_input
.MoveToFirstChild())
2581
if (
_input
.IsXsltKeyword(_atoms.Fallback))
2583
ContextInfo ctxInfo =
_input
.GetAttributes();
2588
_input
.SkipNode();
2590
} while (
_input
.MoveToNextSibling());
2612
if (!
_input
.MoveToXsltAttribute(attNum, "mode"))
2618
string qname =
_input
.Value;
2638
if (!_compiler.ExitForwardsCompatible(
_input
.ForwardCompatibility))
2650
if (!
_input
.MoveToXsltAttribute(attNum, "mode"))
2655
string modeList =
_input
.Value;
2711
if (!_compiler.ExitForwardsCompatible(
_input
.ForwardCompatibility))
2731
if (
_input
.MoveToXsltAttribute(attNum, "collation"))
2760
namespaceName =
_input
.LookupXmlNamespace(prefix)!;
2773
bool required =
_input
.IsRequiredAttribute(attNum);
2779
if (
_input
.MoveToXsltAttribute(attNum, "name"))
2782
if (ResolveQName(/*ignoreDefaultNs:*/true,
_input
.Value, out localName, out namespaceName, out prefix))
2789
_compiler.ExitForwardsCompatible(
_input
.ForwardCompatibility);
2800
Debug.Assert(
_input
.IsRequiredAttribute(attNum), "It happened that @name as NCName is always required attribute");
2801
if (
_input
.MoveToXsltAttribute(attNum, "name"))
2803
return
_input
.Value;
2843
namespaceName =
_input
.LookupXmlNamespace(prefix) ?? _compiler.CreatePhantomNamespace();
2879
if (!
_input
.ForwardCompatibility)
2890
Debug.Assert(
_input
.LocalName == "use-attribute-sets", "we are positioned on this attribute");
2894
foreach (string qname in XmlConvert.SplitString(
_input
.Value))
2896
AddInstruction(list, SetLineInfo(F.UseAttributeSet(CreateXPathQName(qname)),
_input
.BuildLineInfo()));
2898
if (!_compiler.ExitForwardsCompatible(
_input
.ForwardCompatibility))
2908
if (
_input
.MoveToXsltAttribute(attNum, "use-character-maps"))
2911
foreach (string qname in XmlConvert.SplitString(
_input
.Value))
2915
if (!_compiler.ExitForwardsCompatible(
_input
.ForwardCompatibility))
2925
if (
_input
.MoveToXsltAttribute(attNum, attName))
2927
return
_input
.Value;
2934
if (
_input
.MoveToXsltAttribute(attNum, attName))
2936
if (
_input
.Value.Length == 1)
2938
return
_input
.Value[0];
2942
if (
_input
.IsRequiredAttribute(attNum) || !
_input
.ForwardCompatibility)
2954
Debug.Assert(!
_input
.IsRequiredAttribute(attNum), "All Yes/No attributes are optional.");
2955
if (
_input
.MoveToXsltAttribute(attNum, attName))
2957
switch (
_input
.Value)
2962
if (!
_input
.ForwardCompatibility)
2974
Debug.Assert(!
_input
.IsRequiredAttribute(attNum), "All 'type' attributes are optional.");
2975
if (
_input
.MoveToXsltAttribute(attNum, "type"))
2983
Debug.Assert(!
_input
.IsRequiredAttribute(attNum), "All 'validation' attributes are optional.");
2985
if (
_input
.MoveToXsltAttribute(attNum, attributeName))
2987
string value =
_input
.Value;
3000
else if (!
_input
.ForwardCompatibility)
3009
Debug.Assert(!
_input
.IsRequiredAttribute(attNum), "All 'input-type-validation' attributes are optional.");
3010
if (
_input
.MoveToXsltAttribute(attNum, "input-type-annotations"))
3012
string value =
_input
.Value;
3029
if (!
_input
.ForwardCompatibility)
3040
_input
.MoveToElement();
3041
QName parentName =
_input
.ElementName;
3056
if (
_input
.MoveToFirstChild())
3061
if (
_input
.NodeType != XmlNodeType.Whitespace)
3063
result ??=
_input
.BuildNameLineInfo();
3064
_input
.SkipNode();
3066
} while (
_input
.MoveToNextSibling());
3142
_compiler.ReportError(
_input
.BuildNameLineInfo(), res, args);
3147
_compiler.ReportWarning(
_input
.BuildNameLineInfo(), res, args);
3152
if (!
_input
.ForwardCompatibility)
3162
_compiler.ReportError(
_input
.BuildNameLineInfo(), res, args);