3 writes to _context
System.Private.Xml (3)
System\Xml\Schema\XmlSchemaValidator.cs (3)
1522
_context
= (ValidationState)_validationStack.Push();
1525
_context
= new ValidationState();
1553
_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;
720
schemaInfo?.Validity =
_context
.Validity;
742
if (
_context
.NeedValidateChildren)
744
if (
_context
.IsNill)
746
SendValidationEvent(SR.Sch_ContentInNill, QNameString(
_context
.LocalName!,
_context
.Namespace!));
749
XmlSchemaContentType contentType =
_context
.ElementDecl!.ContentValidator!.ContentType;
773
ArrayList? names =
_context
.ElementDecl.ContentValidator.ExpectedParticles(
_context
, false, _schemaSet);
776
SendValidationEvent(SR.Sch_InvalidTextInElement, BuildElementName(
_context
.LocalName!,
_context
.Namespace!));
781
SendValidationEvent(SR.Sch_InvalidTextInElementExpecting, new string[] { BuildElementName(
_context
.LocalName!,
_context
.Namespace!), PrintExpectedElements(names, true) });
786
if (
_context
.ElementDecl.DefaultValueTyped != null)
821
if (
_context
.NeedValidateChildren)
823
if (
_context
.IsNill)
825
SendValidationEvent(SR.Sch_ContentInNill, QNameString(
_context
.LocalName!,
_context
.Namespace!));
828
XmlSchemaContentType contentType =
_context
.ElementDecl!.ContentValidator!.ContentType;
847
if (
_context
.ElementDecl.DefaultValueTyped != null)
894
SchemaElementDecl? currentElementDecl =
_context
.ElementDecl;
906
schemaInfo.IsNil =
_context
.IsNill;
907
schemaInfo.IsDefault =
_context
.IsDefault;
908
Debug.Assert(
_context
.Validity != XmlSchemaValidity.Valid);
909
schemaInfo.Validity =
_context
.Validity;
911
_context
.ValidationSkipped = true;
954
if (
_context
.ElementDecl != null)
956
ArrayList? expected =
_context
.ElementDecl.ContentValidator!.ExpectedParticles(
_context
, false, _schemaSet);
976
SchemaElementDecl? elementDecl =
_context
.ElementDecl;
1018
SchemaElementDecl? currentElementDecl =
_context
.ElementDecl;
1040
SendValidationEvent(SR.Sch_DefaultAttributeNotApplied, new string[2] { attdef.Name.ToString(), QNameString(
_context
.LocalName!,
_context
.Namespace!) });
1114
if (
_context
.ElementDecl == null)
1118
return
_context
.ElementDecl.ContentValidator!.ContentType;
1140
return (_processContents == XmlSchemaContentProcessing.Strict || _processContents == XmlSchemaContentProcessing.Lax) &&
_context
.ElementDecl != null && !
_context
.ValidationSkipped;
1151
if (!_compiledSchemaInfo.Contains(
_context
.Namespace!))
1174
SchemaElementDecl? contextElementDecl =
_context
.ElementDecl;
1183
if (
_context
.CheckRequiredAttribute && contextElementDecl.HasRequiredAttribute)
1187
if (!
_context
.IsNill)
1189
if (
_context
.NeedValidateChildren)
1227
if (!contextElementDecl.ContentValidator.CompleteValidation(
_context
))
1229
CompleteValidationError(
_context
, _eventHandler, _nsResolver, _sourceUriString, _positionInfo.LineNumber, _positionInfo.LinePosition, _schemaSet);
1230
_context
.Validity = XmlSchemaValidity.Invalid;
1249
schemaInfo.IsNil =
_context
.IsNill;
1250
schemaInfo.IsDefault =
_context
.IsDefault;
1251
if (
_context
.Validity == XmlSchemaValidity.NotKnown && StrictlyAssessed)
1253
_context
.Validity = XmlSchemaValidity.Valid;
1255
schemaInfo.Validity =
_context
.Validity;
1311
if (
_context
.NeedValidateChildren)
1313
if (
_context
.IsNill)
1315
SendValidationEvent(SR.Sch_ContentInNill, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1318
ContentValidator contentValidator =
_context
.ElementDecl!.ContentValidator!;
1319
if (contentValidator.ContentType == XmlSchemaContentType.Mixed &&
_context
.ElementDecl.Presence == SchemaDeclBase.Use.Fixed)
1321
SendValidationEvent(SR.Sch_ElementInMixedWithFixed, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1330
particle =
_context
.ElementDecl.ContentValidator!.ValidateElement(head,
_context
, out errorCode);
1339
_processContents =
_context
.ProcessContents = XmlSchemaContentProcessing.Skip;
1367
_processContents =
_context
.ProcessContents = XmlSchemaContentProcessing.Skip;
1372
_context
.NeedValidateChildren = true; //This will be reset to false once member match is not found
1377
ElementValidationError(elementName,
_context
, _eventHandler, _nsResolver, _sourceUriString, _positionInfo.LineNumber, _positionInfo.LinePosition, _schemaSet);
1379
_processContents =
_context
.ProcessContents = XmlSchemaContentProcessing.Skip;
1419
if (!
_context
.IsNill)
1421
SchemaElementDecl currentElementDecl =
_context
.ElementDecl!;
1424
SchemaElementDecl? declBeforeXsi =
_context
.ElementDeclBeforeXsi;
1431
SendValidationEvent(SR.Sch_InvalidElementDefaultValue, new string[] { currentElementDecl.DefaultValueRaw, QNameString(
_context
.LocalName!,
_context
.Namespace!) });
1435
_context
.IsDefault = true;
1440
_context
.IsDefault = true;
1467
if (!
_context
.IsNill)
1469
SchemaElementDecl currentElementDecl =
_context
.ElementDecl!;
1477
SendValidationEvent(SR.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(
_context
.LocalName!,
_context
.Namespace!), stringValue, GetTypeName(decl), exception.Message }, exception);
1483
SendValidationEvent(SR.Sch_FixedElementValue, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1519
[MemberNotNull(nameof(
_context
))]
1523
if (
_context
== null)
1526
_validationStack.AddToTop(
_context
);
1528
_context
.LocalName = elementName.Name;
1529
_context
.Namespace = elementName.Namespace;
1530
_context
.HasMatched = false;
1531
_context
.IsNill = false;
1532
_context
.IsDefault = false;
1533
_context
.CheckRequiredAttribute = true;
1534
_context
.ValidationSkipped = false;
1535
_context
.Validity = XmlSchemaValidity.NotKnown;
1536
_context
.NeedValidateChildren = false;
1537
_context
.ProcessContents = _processContents;
1538
_context
.ElementDeclBeforeXsi = null;
1539
_context
.Constr = null; //resetting the constraints to be null incase context != null
1557
_context
.Validity = XmlSchemaValidity.Invalid;
1561
_context
.ValidationSkipped = true;
1564
_processContents =
_context
.ProcessContents;
1661
_context
.IsNill = XmlConvert.ToBoolean(xsiNil);
1662
if (
_context
.IsNill && elementDecl.Presence == SchemaDeclBase.Use.Fixed)
1678
SendValidationEvent(SR.Sch_AbstractElement, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1714
SendValidationEvent(SR.Sch_XsiTypeBlockedEx, new string?[] { xsiTypeName.ToString(), QNameString(
_context
.LocalName!,
_context
.Namespace!) });
1727
_context
.ElementDeclBeforeXsi = elementDecl;
1739
_processContents =
_context
.ProcessContents = XmlSchemaContentProcessing.Skip;
1740
_context
.NeedValidateChildren = false;
1744
_processContents =
_context
.ProcessContents = XmlSchemaContentProcessing.Skip;
1745
_context
.NeedValidateChildren = false;
1746
SendValidationEvent(SR.Sch_UndeclaredElement, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1750
SendValidationEvent(SR.Sch_NoElementSchemaFound, QNameString(
_context
.LocalName!,
_context
.Namespace!), XmlSeverityType.Warning);
1756
if (
_context
.ElementDecl!.IsAbstract)
1758
SendValidationEvent(SR.Sch_AbstractElement, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1765
if (ProcessIdentityConstraints &&
_context
.ElementDecl!.Constraints != null)
1815
SchemaElementDecl elementDecl =
_context
.ElementDecl!;
1817
if (
_context
.IsNill)
1823
_context
.IsDefault = true;
1904
_IDs.Add(name,
_context
.LocalName);
1968
SchemaDeclBase decl = (
_context
.ElementDecl as SchemaDeclBase)!;
1976
SendValidationEvent(SR.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(
_context
.LocalName!,
_context
.Namespace!), stringValue, GetTypeName(decl), exception.Message }, exception);
1984
SendValidationEvent(SR.Sch_FixedElementValue, QNameString(
_context
.LocalName!,
_context
.Namespace!));
2109
SchemaElementDecl? beforeXsiDecl =
_context
.ElementDeclBeforeXsi;
2110
SchemaElementDecl currentDecl =
_context
.ElementDecl!;
2154
SchemaElementDecl currentElementDecl =
_context
.ElementDecl!;
2155
_context
.Constr = new ConstraintStruct[currentElementDecl.Constraints!.Length];
2159
_context
.Constr[id++] = new ConstraintStruct(currentElementDecl.Constraints[i]);
2164
for (int i = 0; i <
_context
.Constr.Length; ++i)
2166
if (
_context
.Constr[i].constraint.Role == CompiledIdentityConstraint.ConstraintRole.Keyref)
2181
if (constraintStructures[j].constraint.name ==
_context
.Constr[i].constraint.refer)
2188
_context
.Constr[i].qualifiedTable = constraintStructures[j].keyrefTable;
2201
SendValidationEvent(SR.Sch_RefNotInScope, QNameString(
_context
.LocalName!,
_context
.Namespace!));
2215
SchemaElementDecl? currentElementDecl =
_context
.ElementDecl;
2216
string localName =
_context
.LocalName!;
2217
string? namespaceUri =
_context
.Namespace;
2318
string localName =
_context
.LocalName!;
2319
string? namespaceUri =
_context
.Namespace;
2854
_context
.Validity = XmlSchemaValidity.Invalid;