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; 452elementDecl.ContentValidator!.InitValidation(_context); 462schemaInfo.IsNil = _context.IsNill; 463schemaInfo.Validity = _context.Validity; 514SchemaElementDecl? currentElementDecl = _context.ElementDecl; 713SchemaElementDecl? currentElementDecl = _context.ElementDecl; 716_context.CheckRequiredAttribute = false; 721schemaInfo.Validity = _context.Validity; 744if (_context.NeedValidateChildren) 746if (_context.IsNill) 748SendValidationEvent(SR.Sch_ContentInNill, QNameString(_context.LocalName!, _context.Namespace!)); 751XmlSchemaContentType contentType = _context.ElementDecl!.ContentValidator!.ContentType; 775ArrayList? names = _context.ElementDecl.ContentValidator.ExpectedParticles(_context, false, _schemaSet); 778SendValidationEvent(SR.Sch_InvalidTextInElement, BuildElementName(_context.LocalName!, _context.Namespace!)); 783SendValidationEvent(SR.Sch_InvalidTextInElementExpecting, new string[] { BuildElementName(_context.LocalName!, _context.Namespace!), PrintExpectedElements(names, true) }); 788if (_context.ElementDecl.DefaultValueTyped != null) 823if (_context.NeedValidateChildren) 825if (_context.IsNill) 827SendValidationEvent(SR.Sch_ContentInNill, QNameString(_context.LocalName!, _context.Namespace!)); 830XmlSchemaContentType contentType = _context.ElementDecl!.ContentValidator!.ContentType; 849if (_context.ElementDecl.DefaultValueTyped != null) 896SchemaElementDecl? currentElementDecl = _context.ElementDecl; 908schemaInfo.IsNil = _context.IsNill; 909schemaInfo.IsDefault = _context.IsDefault; 910Debug.Assert(_context.Validity != XmlSchemaValidity.Valid); 911schemaInfo.Validity = _context.Validity; 913_context.ValidationSkipped = true; 956if (_context.ElementDecl != null) 958ArrayList? expected = _context.ElementDecl.ContentValidator!.ExpectedParticles(_context, false, _schemaSet); 978SchemaElementDecl? elementDecl = _context.ElementDecl; 1020SchemaElementDecl? currentElementDecl = _context.ElementDecl; 1042SendValidationEvent(SR.Sch_DefaultAttributeNotApplied, new string[2] { attdef.Name.ToString(), QNameString(_context.LocalName!, _context.Namespace!) }); 1116if (_context.ElementDecl == null) 1120return _context.ElementDecl.ContentValidator!.ContentType; 1142return (_processContents == XmlSchemaContentProcessing.Strict || _processContents == XmlSchemaContentProcessing.Lax) && _context.ElementDecl != null && !_context.ValidationSkipped; 1153if (!_compiledSchemaInfo.Contains(_context.Namespace!)) 1176SchemaElementDecl? contextElementDecl = _context.ElementDecl; 1185if (_context.CheckRequiredAttribute && contextElementDecl.HasRequiredAttribute) 1189if (!_context.IsNill) 1191if (_context.NeedValidateChildren) 1229if (!contextElementDecl.ContentValidator.CompleteValidation(_context)) 1231CompleteValidationError(_context, _eventHandler, _nsResolver, _sourceUriString, _positionInfo.LineNumber, _positionInfo.LinePosition, _schemaSet); 1232_context.Validity = XmlSchemaValidity.Invalid; 1251schemaInfo.IsNil = _context.IsNill; 1252schemaInfo.IsDefault = _context.IsDefault; 1253if (_context.Validity == XmlSchemaValidity.NotKnown && StrictlyAssessed) 1255_context.Validity = XmlSchemaValidity.Valid; 1257schemaInfo.Validity = _context.Validity; 1313if (_context.NeedValidateChildren) 1315if (_context.IsNill) 1317SendValidationEvent(SR.Sch_ContentInNill, QNameString(_context.LocalName!, _context.Namespace!)); 1320ContentValidator contentValidator = _context.ElementDecl!.ContentValidator!; 1321if (contentValidator.ContentType == XmlSchemaContentType.Mixed && _context.ElementDecl.Presence == SchemaDeclBase.Use.Fixed) 1323SendValidationEvent(SR.Sch_ElementInMixedWithFixed, QNameString(_context.LocalName!, _context.Namespace!)); 1332particle = _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 1379ElementValidationError(elementName, _context, _eventHandler, _nsResolver, _sourceUriString, _positionInfo.LineNumber, _positionInfo.LinePosition, _schemaSet); 1381_processContents = _context.ProcessContents = XmlSchemaContentProcessing.Skip; 1421if (!_context.IsNill) 1423SchemaElementDecl currentElementDecl = _context.ElementDecl!; 1426SchemaElementDecl? declBeforeXsi = _context.ElementDeclBeforeXsi; 1433SendValidationEvent(SR.Sch_InvalidElementDefaultValue, new string[] { currentElementDecl.DefaultValueRaw, QNameString(_context.LocalName!, _context.Namespace!) }); 1437_context.IsDefault = true; 1442_context.IsDefault = true; 1469if (!_context.IsNill) 1471SchemaElementDecl currentElementDecl = _context.ElementDecl!; 1479SendValidationEvent(SR.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(_context.LocalName!, _context.Namespace!), stringValue, GetTypeName(decl), exception.Message }, exception); 1485SendValidationEvent(SR.Sch_FixedElementValue, QNameString(_context.LocalName!, _context.Namespace!)); 1521[MemberNotNull(nameof(_context))] 1525if (_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); 1664if (_context.IsNill && elementDecl.Presence == SchemaDeclBase.Use.Fixed) 1680SendValidationEvent(SR.Sch_AbstractElement, QNameString(_context.LocalName!, _context.Namespace!)); 1716SendValidationEvent(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; 1748SendValidationEvent(SR.Sch_UndeclaredElement, QNameString(_context.LocalName!, _context.Namespace!)); 1752SendValidationEvent(SR.Sch_NoElementSchemaFound, QNameString(_context.LocalName!, _context.Namespace!), XmlSeverityType.Warning); 1758if (_context.ElementDecl!.IsAbstract) 1760SendValidationEvent(SR.Sch_AbstractElement, QNameString(_context.LocalName!, _context.Namespace!)); 1767if (ProcessIdentityConstraints && _context.ElementDecl!.Constraints != null) 1817SchemaElementDecl elementDecl = _context.ElementDecl!; 1819if (_context.IsNill) 1825_context.IsDefault = true; 1906_IDs.Add(name, _context.LocalName); 1970SchemaDeclBase decl = (_context.ElementDecl as SchemaDeclBase)!; 1978SendValidationEvent(SR.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(_context.LocalName!, _context.Namespace!), stringValue, GetTypeName(decl), exception.Message }, exception); 1986SendValidationEvent(SR.Sch_FixedElementValue, QNameString(_context.LocalName!, _context.Namespace!)); 2114SchemaElementDecl? beforeXsiDecl = _context.ElementDeclBeforeXsi; 2115SchemaElementDecl currentDecl = _context.ElementDecl!; 2159SchemaElementDecl currentElementDecl = _context.ElementDecl!; 2160_context.Constr = new ConstraintStruct[currentElementDecl.Constraints!.Length]; 2164_context.Constr[id++] = new ConstraintStruct(currentElementDecl.Constraints[i]); 2169for (int i = 0; i < _context.Constr.Length; ++i) 2171if (_context.Constr[i].constraint.Role == CompiledIdentityConstraint.ConstraintRole.Keyref) 2186if (constraintStructures[j].constraint.name == _context.Constr[i].constraint.refer) 2193_context.Constr[i].qualifiedTable = constraintStructures[j].keyrefTable; 2206SendValidationEvent(SR.Sch_RefNotInScope, QNameString(_context.LocalName!, _context.Namespace!)); 2220SchemaElementDecl? currentElementDecl = _context.ElementDecl; 2221string localName = _context.LocalName!; 2222string? namespaceUri = _context.Namespace; 2323string localName = _context.LocalName!; 2324string? namespaceUri = _context.Namespace; 2859_context.Validity = XmlSchemaValidity.Invalid;