3 writes to _context
System.Private.Xml (3)
System\Xml\Schema\XmlSchemaValidator.cs (3)
1524
_context
= (ValidationState)_validationStack.Push();
1527
_context
= new ValidationState();
1555
_context
= (ValidationState)_validationStack.Peek()!;
150 references to _context
System.Private.Xml (150)
System\Xml\Schema\XmlSchemaValidator.cs (150)
195
[MemberNotNull(nameof(
_context
))]
417
_context
.Validity = XmlSchemaValidity.Invalid;
443
_context
.ElementDecl = elementDecl;
450
_context
.NeedValidateChildren = _processContents != XmlSchemaContentProcessing.Skip;
452
elementDecl.ContentValidator!.InitValidation(
_context
);
462
schemaInfo.IsNil =
_context
.IsNill;
463
schemaInfo.Validity =
_context
.Validity;
514
SchemaElementDecl? currentElementDecl =
_context
.ElementDecl;
713
SchemaElementDecl? currentElementDecl =
_context
.ElementDecl;
716
_context
.CheckRequiredAttribute = false;
721
schemaInfo.Validity =
_context
.Validity;
744
if (
_context
.NeedValidateChildren)
746
if (
_context
.IsNill)
748
SendValidationEvent(SR.Sch_ContentInNill, QNameString(
_context
.LocalName!,
_context
.Namespace!));
751
XmlSchemaContentType contentType =
_context
.ElementDecl!.ContentValidator!.ContentType;
775
ArrayList? names =
_context
.ElementDecl.ContentValidator.ExpectedParticles(
_context
, false, _schemaSet);
778
SendValidationEvent(SR.Sch_InvalidTextInElement, BuildElementName(
_context
.LocalName!,
_context
.Namespace!));
783
SendValidationEvent(SR.Sch_InvalidTextInElementExpecting, new string[] { BuildElementName(
_context
.LocalName!,
_context
.Namespace!), PrintExpectedElements(names, true) });
788
if (
_context
.ElementDecl.DefaultValueTyped != null)
823
if (
_context
.NeedValidateChildren)
825
if (
_context
.IsNill)
827
SendValidationEvent(SR.Sch_ContentInNill, QNameString(
_context
.LocalName!,
_context
.Namespace!));
830
XmlSchemaContentType contentType =
_context
.ElementDecl!.ContentValidator!.ContentType;
849
if (
_context
.ElementDecl.DefaultValueTyped != null)
896
SchemaElementDecl? currentElementDecl =
_context
.ElementDecl;
908
schemaInfo.IsNil =
_context
.IsNill;
909
schemaInfo.IsDefault =
_context
.IsDefault;
910
Debug.Assert(
_context
.Validity != XmlSchemaValidity.Valid);
911
schemaInfo.Validity =
_context
.Validity;
913
_context
.ValidationSkipped = true;
956
if (
_context
.ElementDecl != null)
958
ArrayList? expected =
_context
.ElementDecl.ContentValidator!.ExpectedParticles(
_context
, false, _schemaSet);
978
SchemaElementDecl? elementDecl =
_context
.ElementDecl;
1020
SchemaElementDecl? currentElementDecl =
_context
.ElementDecl;
1042
SendValidationEvent(SR.Sch_DefaultAttributeNotApplied, new string[2] { attdef.Name.ToString(), QNameString(
_context
.LocalName!,
_context
.Namespace!) });
1116
if (
_context
.ElementDecl == null)
1120
return
_context
.ElementDecl.ContentValidator!.ContentType;
1142
return (_processContents == XmlSchemaContentProcessing.Strict || _processContents == XmlSchemaContentProcessing.Lax) &&
_context
.ElementDecl != null && !
_context
.ValidationSkipped;
1153
if (!_compiledSchemaInfo.Contains(
_context
.Namespace!))
1176
SchemaElementDecl? contextElementDecl =
_context
.ElementDecl;
1185
if (
_context
.CheckRequiredAttribute && contextElementDecl.HasRequiredAttribute)
1189
if (!
_context
.IsNill)
1191
if (
_context
.NeedValidateChildren)
1229
if (!contextElementDecl.ContentValidator.CompleteValidation(
_context
))
1231
CompleteValidationError(
_context
, _eventHandler, _nsResolver, _sourceUriString, _positionInfo.LineNumber, _positionInfo.LinePosition, _schemaSet);
1232
_context
.Validity = XmlSchemaValidity.Invalid;
1251
schemaInfo.IsNil =
_context
.IsNill;
1252
schemaInfo.IsDefault =
_context
.IsDefault;
1253
if (
_context
.Validity == XmlSchemaValidity.NotKnown && StrictlyAssessed)
1255
_context
.Validity = XmlSchemaValidity.Valid;
1257
schemaInfo.Validity =
_context
.Validity;
1313
if (
_context
.NeedValidateChildren)
1315
if (
_context
.IsNill)
1317
SendValidationEvent(SR.Sch_ContentInNill, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1320
ContentValidator contentValidator =
_context
.ElementDecl!.ContentValidator!;
1321
if (contentValidator.ContentType == XmlSchemaContentType.Mixed &&
_context
.ElementDecl.Presence == SchemaDeclBase.Use.Fixed)
1323
SendValidationEvent(SR.Sch_ElementInMixedWithFixed, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1332
particle =
_context
.ElementDecl.ContentValidator!.ValidateElement(head,
_context
, out errorCode);
1341
_processContents =
_context
.ProcessContents = XmlSchemaContentProcessing.Skip;
1369
_processContents =
_context
.ProcessContents = XmlSchemaContentProcessing.Skip;
1374
_context
.NeedValidateChildren = true; //This will be reset to false once member match is not found
1379
ElementValidationError(elementName,
_context
, _eventHandler, _nsResolver, _sourceUriString, _positionInfo.LineNumber, _positionInfo.LinePosition, _schemaSet);
1381
_processContents =
_context
.ProcessContents = XmlSchemaContentProcessing.Skip;
1421
if (!
_context
.IsNill)
1423
SchemaElementDecl currentElementDecl =
_context
.ElementDecl!;
1426
SchemaElementDecl? declBeforeXsi =
_context
.ElementDeclBeforeXsi;
1433
SendValidationEvent(SR.Sch_InvalidElementDefaultValue, new string[] { currentElementDecl.DefaultValueRaw, QNameString(
_context
.LocalName!,
_context
.Namespace!) });
1437
_context
.IsDefault = true;
1442
_context
.IsDefault = true;
1469
if (!
_context
.IsNill)
1471
SchemaElementDecl currentElementDecl =
_context
.ElementDecl!;
1479
SendValidationEvent(SR.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(
_context
.LocalName!,
_context
.Namespace!), stringValue, GetTypeName(decl), exception.Message }, exception);
1485
SendValidationEvent(SR.Sch_FixedElementValue, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1521
[MemberNotNull(nameof(
_context
))]
1525
if (
_context
== null)
1528
_validationStack.AddToTop(
_context
);
1530
_context
.LocalName = elementName.Name;
1531
_context
.Namespace = elementName.Namespace;
1532
_context
.HasMatched = false;
1533
_context
.IsNill = false;
1534
_context
.IsDefault = false;
1535
_context
.CheckRequiredAttribute = true;
1536
_context
.ValidationSkipped = false;
1537
_context
.Validity = XmlSchemaValidity.NotKnown;
1538
_context
.NeedValidateChildren = false;
1539
_context
.ProcessContents = _processContents;
1540
_context
.ElementDeclBeforeXsi = null;
1541
_context
.Constr = null; //resetting the constraints to be null incase context != null
1559
_context
.Validity = XmlSchemaValidity.Invalid;
1563
_context
.ValidationSkipped = true;
1566
_processContents =
_context
.ProcessContents;
1663
_context
.IsNill = XmlConvert.ToBoolean(xsiNil);
1664
if (
_context
.IsNill && elementDecl.Presence == SchemaDeclBase.Use.Fixed)
1680
SendValidationEvent(SR.Sch_AbstractElement, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1716
SendValidationEvent(SR.Sch_XsiTypeBlockedEx, new string?[] { xsiTypeName.ToString(), QNameString(
_context
.LocalName!,
_context
.Namespace!) });
1729
_context
.ElementDeclBeforeXsi = elementDecl;
1741
_processContents =
_context
.ProcessContents = XmlSchemaContentProcessing.Skip;
1742
_context
.NeedValidateChildren = false;
1746
_processContents =
_context
.ProcessContents = XmlSchemaContentProcessing.Skip;
1747
_context
.NeedValidateChildren = false;
1748
SendValidationEvent(SR.Sch_UndeclaredElement, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1752
SendValidationEvent(SR.Sch_NoElementSchemaFound, QNameString(
_context
.LocalName!,
_context
.Namespace!), XmlSeverityType.Warning);
1758
if (
_context
.ElementDecl!.IsAbstract)
1760
SendValidationEvent(SR.Sch_AbstractElement, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1767
if (ProcessIdentityConstraints &&
_context
.ElementDecl!.Constraints != null)
1817
SchemaElementDecl elementDecl =
_context
.ElementDecl!;
1819
if (
_context
.IsNill)
1825
_context
.IsDefault = true;
1906
_IDs.Add(name,
_context
.LocalName);
1970
SchemaDeclBase decl = (
_context
.ElementDecl as SchemaDeclBase)!;
1978
SendValidationEvent(SR.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(
_context
.LocalName!,
_context
.Namespace!), stringValue, GetTypeName(decl), exception.Message }, exception);
1986
SendValidationEvent(SR.Sch_FixedElementValue, QNameString(
_context
.LocalName!,
_context
.Namespace!));
2114
SchemaElementDecl? beforeXsiDecl =
_context
.ElementDeclBeforeXsi;
2115
SchemaElementDecl currentDecl =
_context
.ElementDecl!;
2159
SchemaElementDecl currentElementDecl =
_context
.ElementDecl!;
2160
_context
.Constr = new ConstraintStruct[currentElementDecl.Constraints!.Length];
2164
_context
.Constr[id++] = new ConstraintStruct(currentElementDecl.Constraints[i]);
2169
for (int i = 0; i <
_context
.Constr.Length; ++i)
2171
if (
_context
.Constr[i].constraint.Role == CompiledIdentityConstraint.ConstraintRole.Keyref)
2186
if (constraintStructures[j].constraint.name ==
_context
.Constr[i].constraint.refer)
2193
_context
.Constr[i].qualifiedTable = constraintStructures[j].keyrefTable;
2206
SendValidationEvent(SR.Sch_RefNotInScope, QNameString(
_context
.LocalName!,
_context
.Namespace!));
2220
SchemaElementDecl? currentElementDecl =
_context
.ElementDecl;
2221
string localName =
_context
.LocalName!;
2222
string? namespaceUri =
_context
.Namespace;
2323
string localName =
_context
.LocalName!;
2324
string? namespaceUri =
_context
.Namespace;
2859
_context
.Validity = XmlSchemaValidity.Invalid;