3 writes to _context
System.Private.Xml (3)
System\Xml\Schema\XmlSchemaValidator.cs (3)
1529
_context
= (ValidationState)_validationStack.Push();
1532
_context
= new ValidationState();
1560
_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!;
1476
SendValidationEvent(SR.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(
_context
.LocalName!,
_context
.Namespace!), TruncateValueForErrorMessage(stringValue), GetTypeName(decl), exception.Message }, exception);
1482
SendValidationEvent(SR.Sch_FixedElementValue, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1526
[MemberNotNull(nameof(
_context
))]
1530
if (
_context
== null)
1533
_validationStack.AddToTop(
_context
);
1535
_context
.LocalName = elementName.Name;
1536
_context
.Namespace = elementName.Namespace;
1537
_context
.HasMatched = false;
1538
_context
.IsNill = false;
1539
_context
.IsDefault = false;
1540
_context
.CheckRequiredAttribute = true;
1541
_context
.ValidationSkipped = false;
1542
_context
.Validity = XmlSchemaValidity.NotKnown;
1543
_context
.NeedValidateChildren = false;
1544
_context
.ProcessContents = _processContents;
1545
_context
.ElementDeclBeforeXsi = null;
1546
_context
.Constr = null; //resetting the constraints to be null incase context != null
1564
_context
.Validity = XmlSchemaValidity.Invalid;
1568
_context
.ValidationSkipped = true;
1571
_processContents =
_context
.ProcessContents;
1668
_context
.IsNill = XmlConvert.ToBoolean(xsiNil);
1669
if (
_context
.IsNill && elementDecl.Presence == SchemaDeclBase.Use.Fixed)
1685
SendValidationEvent(SR.Sch_AbstractElement, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1721
SendValidationEvent(SR.Sch_XsiTypeBlockedEx, new string?[] { xsiTypeName.ToString(), QNameString(
_context
.LocalName!,
_context
.Namespace!) });
1734
_context
.ElementDeclBeforeXsi = elementDecl;
1746
_processContents =
_context
.ProcessContents = XmlSchemaContentProcessing.Skip;
1747
_context
.NeedValidateChildren = false;
1751
_processContents =
_context
.ProcessContents = XmlSchemaContentProcessing.Skip;
1752
_context
.NeedValidateChildren = false;
1753
SendValidationEvent(SR.Sch_UndeclaredElement, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1757
SendValidationEvent(SR.Sch_NoElementSchemaFound, QNameString(
_context
.LocalName!,
_context
.Namespace!), XmlSeverityType.Warning);
1763
if (
_context
.ElementDecl!.IsAbstract)
1765
SendValidationEvent(SR.Sch_AbstractElement, QNameString(
_context
.LocalName!,
_context
.Namespace!));
1772
if (ProcessIdentityConstraints &&
_context
.ElementDecl!.Constraints != null)
1822
SchemaElementDecl elementDecl =
_context
.ElementDecl!;
1824
if (
_context
.IsNill)
1830
_context
.IsDefault = true;
1911
_IDs.Add(name,
_context
.LocalName);
1975
SchemaDeclBase decl = (
_context
.ElementDecl as SchemaDeclBase)!;
1983
SendValidationEvent(SR.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(
_context
.LocalName!,
_context
.Namespace!), TruncateValueForErrorMessage(stringValue), GetTypeName(decl), exception.Message }, exception);
1991
SendValidationEvent(SR.Sch_FixedElementValue, QNameString(
_context
.LocalName!,
_context
.Namespace!));
2116
SchemaElementDecl? beforeXsiDecl =
_context
.ElementDeclBeforeXsi;
2117
SchemaElementDecl currentDecl =
_context
.ElementDecl!;
2161
SchemaElementDecl currentElementDecl =
_context
.ElementDecl!;
2162
_context
.Constr = new ConstraintStruct[currentElementDecl.Constraints!.Length];
2166
_context
.Constr[id++] = new ConstraintStruct(currentElementDecl.Constraints[i]);
2171
for (int i = 0; i <
_context
.Constr.Length; ++i)
2173
if (
_context
.Constr[i].constraint.Role == CompiledIdentityConstraint.ConstraintRole.Keyref)
2188
if (constraintStructures[j].constraint.name ==
_context
.Constr[i].constraint.refer)
2195
_context
.Constr[i].qualifiedTable = constraintStructures[j].keyrefTable;
2208
SendValidationEvent(SR.Sch_RefNotInScope, QNameString(
_context
.LocalName!,
_context
.Namespace!));
2222
SchemaElementDecl? currentElementDecl =
_context
.ElementDecl;
2223
string localName =
_context
.LocalName!;
2224
string? namespaceUri =
_context
.Namespace;
2325
string localName =
_context
.LocalName!;
2326
string? namespaceUri =
_context
.Namespace;
2861
_context
.Validity = XmlSchemaValidity.Invalid;