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; 452elementDecl.ContentValidator!.InitValidation(_context); 462schemaInfo.IsNil = _context.IsNill; 463schemaInfo.Validity = _context.Validity; 514SchemaElementDecl? currentElementDecl = _context.ElementDecl; 713SchemaElementDecl? currentElementDecl = _context.ElementDecl; 716_context.CheckRequiredAttribute = false; 720schemaInfo?.Validity = _context.Validity; 742if (_context.NeedValidateChildren) 744if (_context.IsNill) 746SendValidationEvent(SR.Sch_ContentInNill, QNameString(_context.LocalName!, _context.Namespace!)); 749XmlSchemaContentType contentType = _context.ElementDecl!.ContentValidator!.ContentType; 773ArrayList? names = _context.ElementDecl.ContentValidator.ExpectedParticles(_context, false, _schemaSet); 776SendValidationEvent(SR.Sch_InvalidTextInElement, BuildElementName(_context.LocalName!, _context.Namespace!)); 781SendValidationEvent(SR.Sch_InvalidTextInElementExpecting, new string[] { BuildElementName(_context.LocalName!, _context.Namespace!), PrintExpectedElements(names, true) }); 786if (_context.ElementDecl.DefaultValueTyped != null) 821if (_context.NeedValidateChildren) 823if (_context.IsNill) 825SendValidationEvent(SR.Sch_ContentInNill, QNameString(_context.LocalName!, _context.Namespace!)); 828XmlSchemaContentType contentType = _context.ElementDecl!.ContentValidator!.ContentType; 847if (_context.ElementDecl.DefaultValueTyped != null) 894SchemaElementDecl? currentElementDecl = _context.ElementDecl; 906schemaInfo.IsNil = _context.IsNill; 907schemaInfo.IsDefault = _context.IsDefault; 908Debug.Assert(_context.Validity != XmlSchemaValidity.Valid); 909schemaInfo.Validity = _context.Validity; 911_context.ValidationSkipped = true; 954if (_context.ElementDecl != null) 956ArrayList? expected = _context.ElementDecl.ContentValidator!.ExpectedParticles(_context, false, _schemaSet); 976SchemaElementDecl? elementDecl = _context.ElementDecl; 1018SchemaElementDecl? currentElementDecl = _context.ElementDecl; 1040SendValidationEvent(SR.Sch_DefaultAttributeNotApplied, new string[2] { attdef.Name.ToString(), QNameString(_context.LocalName!, _context.Namespace!) }); 1114if (_context.ElementDecl == null) 1118return _context.ElementDecl.ContentValidator!.ContentType; 1140return (_processContents == XmlSchemaContentProcessing.Strict || _processContents == XmlSchemaContentProcessing.Lax) && _context.ElementDecl != null && !_context.ValidationSkipped; 1151if (!_compiledSchemaInfo.Contains(_context.Namespace!)) 1174SchemaElementDecl? contextElementDecl = _context.ElementDecl; 1183if (_context.CheckRequiredAttribute && contextElementDecl.HasRequiredAttribute) 1187if (!_context.IsNill) 1189if (_context.NeedValidateChildren) 1227if (!contextElementDecl.ContentValidator.CompleteValidation(_context)) 1229CompleteValidationError(_context, _eventHandler, _nsResolver, _sourceUriString, _positionInfo.LineNumber, _positionInfo.LinePosition, _schemaSet); 1230_context.Validity = XmlSchemaValidity.Invalid; 1249schemaInfo.IsNil = _context.IsNill; 1250schemaInfo.IsDefault = _context.IsDefault; 1251if (_context.Validity == XmlSchemaValidity.NotKnown && StrictlyAssessed) 1253_context.Validity = XmlSchemaValidity.Valid; 1255schemaInfo.Validity = _context.Validity; 1311if (_context.NeedValidateChildren) 1313if (_context.IsNill) 1315SendValidationEvent(SR.Sch_ContentInNill, QNameString(_context.LocalName!, _context.Namespace!)); 1318ContentValidator contentValidator = _context.ElementDecl!.ContentValidator!; 1319if (contentValidator.ContentType == XmlSchemaContentType.Mixed && _context.ElementDecl.Presence == SchemaDeclBase.Use.Fixed) 1321SendValidationEvent(SR.Sch_ElementInMixedWithFixed, QNameString(_context.LocalName!, _context.Namespace!)); 1330particle = _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 1377ElementValidationError(elementName, _context, _eventHandler, _nsResolver, _sourceUriString, _positionInfo.LineNumber, _positionInfo.LinePosition, _schemaSet); 1379_processContents = _context.ProcessContents = XmlSchemaContentProcessing.Skip; 1419if (!_context.IsNill) 1421SchemaElementDecl currentElementDecl = _context.ElementDecl!; 1424SchemaElementDecl? declBeforeXsi = _context.ElementDeclBeforeXsi; 1431SendValidationEvent(SR.Sch_InvalidElementDefaultValue, new string[] { currentElementDecl.DefaultValueRaw, QNameString(_context.LocalName!, _context.Namespace!) }); 1435_context.IsDefault = true; 1440_context.IsDefault = true; 1467if (!_context.IsNill) 1469SchemaElementDecl currentElementDecl = _context.ElementDecl!; 1477SendValidationEvent(SR.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(_context.LocalName!, _context.Namespace!), stringValue, GetTypeName(decl), exception.Message }, exception); 1483SendValidationEvent(SR.Sch_FixedElementValue, QNameString(_context.LocalName!, _context.Namespace!)); 1519[MemberNotNull(nameof(_context))] 1523if (_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); 1662if (_context.IsNill && elementDecl.Presence == SchemaDeclBase.Use.Fixed) 1678SendValidationEvent(SR.Sch_AbstractElement, QNameString(_context.LocalName!, _context.Namespace!)); 1714SendValidationEvent(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; 1746SendValidationEvent(SR.Sch_UndeclaredElement, QNameString(_context.LocalName!, _context.Namespace!)); 1750SendValidationEvent(SR.Sch_NoElementSchemaFound, QNameString(_context.LocalName!, _context.Namespace!), XmlSeverityType.Warning); 1756if (_context.ElementDecl!.IsAbstract) 1758SendValidationEvent(SR.Sch_AbstractElement, QNameString(_context.LocalName!, _context.Namespace!)); 1765if (ProcessIdentityConstraints && _context.ElementDecl!.Constraints != null) 1815SchemaElementDecl elementDecl = _context.ElementDecl!; 1817if (_context.IsNill) 1823_context.IsDefault = true; 1904_IDs.Add(name, _context.LocalName); 1968SchemaDeclBase decl = (_context.ElementDecl as SchemaDeclBase)!; 1976SendValidationEvent(SR.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(_context.LocalName!, _context.Namespace!), stringValue, GetTypeName(decl), exception.Message }, exception); 1984SendValidationEvent(SR.Sch_FixedElementValue, QNameString(_context.LocalName!, _context.Namespace!)); 2109SchemaElementDecl? beforeXsiDecl = _context.ElementDeclBeforeXsi; 2110SchemaElementDecl currentDecl = _context.ElementDecl!; 2154SchemaElementDecl currentElementDecl = _context.ElementDecl!; 2155_context.Constr = new ConstraintStruct[currentElementDecl.Constraints!.Length]; 2159_context.Constr[id++] = new ConstraintStruct(currentElementDecl.Constraints[i]); 2164for (int i = 0; i < _context.Constr.Length; ++i) 2166if (_context.Constr[i].constraint.Role == CompiledIdentityConstraint.ConstraintRole.Keyref) 2181if (constraintStructures[j].constraint.name == _context.Constr[i].constraint.refer) 2188_context.Constr[i].qualifiedTable = constraintStructures[j].keyrefTable; 2201SendValidationEvent(SR.Sch_RefNotInScope, QNameString(_context.LocalName!, _context.Namespace!)); 2215SchemaElementDecl? currentElementDecl = _context.ElementDecl; 2216string localName = _context.LocalName!; 2217string? namespaceUri = _context.Namespace; 2318string localName = _context.LocalName!; 2319string? namespaceUri = _context.Namespace; 2854_context.Validity = XmlSchemaValidity.Invalid;