3 writes to context
System.Xml (3)
System\Xml\Schema\XmlSchemaValidator.cs (3)
1291context = (ValidationState)validationStack.Push(); 1293context = new ValidationState(); 1318context = (ValidationState)validationStack.Peek();
148 references to context
System.Xml (148)
System\Xml\Schema\XmlSchemaValidator.cs (148)
392context.Validity = XmlSchemaValidity.Invalid; 413context.ElementDecl = elementDecl; 419context.NeedValidateChildren = processContents != XmlSchemaContentProcessing.Skip; 421elementDecl.ContentValidator.InitValidation(context); 430schemaInfo.IsNil = context.IsNill; 431schemaInfo.Validity = context.Validity; 481SchemaElementDecl currentElementDecl = context.ElementDecl; 652SchemaElementDecl currentElementDecl = context.ElementDecl; 654context.CheckRequiredAttribute = false; 658schemaInfo.Validity = context.Validity; 680if (context.NeedValidateChildren) { 681if (context.IsNill) { 682SendValidationEvent(Res.Sch_ContentInNill, QNameString(context.LocalName, context.Namespace)); 685XmlSchemaContentType contentType = context.ElementDecl.ContentValidator.ContentType; 705ArrayList names = context.ElementDecl.ContentValidator.ExpectedParticles(context, false, schemaSet); 707SendValidationEvent(Res.Sch_InvalidTextInElement, BuildElementName(context.LocalName, context.Namespace)); 711SendValidationEvent(Res.Sch_InvalidTextInElementExpecting, new string[] { BuildElementName(context.LocalName, context.Namespace), PrintExpectedElements(names, true) }); 716if (context.ElementDecl.DefaultValueTyped != null) { 747if (context.NeedValidateChildren) { 748if (context.IsNill) { 749SendValidationEvent(Res.Sch_ContentInNill, QNameString(context.LocalName, context.Namespace)); 751XmlSchemaContentType contentType = context.ElementDecl.ContentValidator.ContentType; 767if (context.ElementDecl.DefaultValueTyped != null) { 805SchemaElementDecl currentElementDecl = context.ElementDecl; 815schemaInfo.IsNil = context.IsNill; 816schemaInfo.IsDefault = context.IsDefault; 817Debug.Assert(context.Validity != XmlSchemaValidity.Valid); 818schemaInfo.Validity = context.Validity; 820context.ValidationSkipped = true; 851if (context.ElementDecl != null) { 852ArrayList expected = context.ElementDecl.ContentValidator.ExpectedParticles(context, false, schemaSet); 862SchemaElementDecl elementDecl = context.ElementDecl; 889SchemaElementDecl currentElementDecl = context.ElementDecl; 905SendValidationEvent(Res.Sch_DefaultAttributeNotApplied, new string[2] { attdef.Name.ToString(), QNameString(context.LocalName, context.Namespace)}); 966if (context.ElementDecl == null) { 969return context.ElementDecl.ContentValidator.ContentType; 986return (processContents == XmlSchemaContentProcessing.Strict || processContents == XmlSchemaContentProcessing.Lax) && context.ElementDecl != null && !context.ValidationSkipped; 994if (!compiledSchemaInfo.Contains(context.Namespace)) { 1012SchemaElementDecl contextElementDecl = context.ElementDecl; 1020if (context.CheckRequiredAttribute && contextElementDecl.HasRequiredAttribute) { 1023if (!context.IsNill) { 1024if (context.NeedValidateChildren) { 1055if(!contextElementDecl.ContentValidator.CompleteValidation(context)) { 1056CompleteValidationError(context, eventHandler, nsResolver, sourceUriString, positionInfo.LineNumber, positionInfo.LinePosition, schemaSet); 1057context.Validity = XmlSchemaValidity.Invalid; 1073schemaInfo.IsNil = context.IsNill; 1074schemaInfo.IsDefault = context.IsDefault; 1075if (context.Validity == XmlSchemaValidity.NotKnown && StrictlyAssessed) { 1076context.Validity = XmlSchemaValidity.Valid; 1078schemaInfo.Validity = context.Validity; 1124if (context.NeedValidateChildren) { 1125if (context.IsNill) { 1126SendValidationEvent(Res.Sch_ContentInNill, QNameString(context.LocalName, context.Namespace)); 1129ContentValidator contentValidator = context.ElementDecl.ContentValidator; 1130if (contentValidator.ContentType == XmlSchemaContentType.Mixed && context.ElementDecl.Presence == SchemaDeclBase.Use.Fixed) { //Mixed with default or fixed 1131SendValidationEvent(Res.Sch_ElementInMixedWithFixed, QNameString(context.LocalName, context.Namespace)); 1139particle = context.ElementDecl.ContentValidator.ValidateElement(head, context, out errorCode); 1146processContents = context.ProcessContents = XmlSchemaContentProcessing.Skip; 1169processContents = context.ProcessContents = XmlSchemaContentProcessing.Skip; 1173context.NeedValidateChildren = true; //This will be reset to false once member match is not found 1177ElementValidationError(elementName, context, eventHandler, nsResolver, sourceUriString, positionInfo.LineNumber, positionInfo.LinePosition, schemaSet); 1179processContents = context.ProcessContents = XmlSchemaContentProcessing.Skip; 1211SchemaElementDecl currentElementDecl = context.ElementDecl; 1212if (!context.IsNill) { 1214SchemaElementDecl declBeforeXsi = context.ElementDeclBeforeXsi; 1219SendValidationEvent(Res.Sch_InvalidElementDefaultValue, new string[] { currentElementDecl.DefaultValueRaw, QNameString(context.LocalName, context.Namespace) }); 1222context.IsDefault = true; 1226context.IsDefault = true; 1247SchemaElementDecl currentElementDecl = context.ElementDecl; 1249if (!context.IsNill) { 1258SendValidationEvent(Res.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(context.LocalName, context.Namespace), stringValue, GetTypeName(decl), exception.Message }, exception); 1262SendValidationEvent(Res.Sch_FixedElementValue, QNameString(context.LocalName, context.Namespace)); 1292if (context == null) { 1294validationStack.AddToTop(context); 1296context.LocalName = elementName.Name; 1297context.Namespace = elementName.Namespace; 1298context.HasMatched = false; 1299context.IsNill = false; 1300context.IsDefault = false; 1301context.CheckRequiredAttribute = true; 1302context.ValidationSkipped = false; 1303context.Validity = XmlSchemaValidity.NotKnown; 1304context.NeedValidateChildren = false; 1305context.ProcessContents = processContents; 1306context.ElementDeclBeforeXsi = null; 1307context.Constr = null; //resetting the constraints to be null incase context != null 1320context.Validity = XmlSchemaValidity.Invalid; 1323context.ValidationSkipped = true; 1325processContents = context.ProcessContents; 1398context.IsNill = XmlConvert.ToBoolean(xsiNil); 1399if (context.IsNill && elementDecl.Presence == SchemaDeclBase.Use.Fixed) { 1411SendValidationEvent(Res.Sch_AbstractElement, QNameString(context.LocalName, context.Namespace)); 1442SendValidationEvent(Res.Sch_XsiTypeBlockedEx, new string[] { xsiTypeName.ToString(), QNameString(context.LocalName, context.Namespace) }); 1453context.ElementDeclBeforeXsi = elementDecl; 1463processContents = context.ProcessContents = XmlSchemaContentProcessing.Skip; 1464context.NeedValidateChildren = false; 1467processContents = context.ProcessContents = XmlSchemaContentProcessing.Skip; 1468context.NeedValidateChildren = false; 1469SendValidationEvent(Res.Sch_UndeclaredElement, QNameString(context.LocalName, context.Namespace)); 1472SendValidationEvent(Res.Sch_NoElementSchemaFound, QNameString(context.LocalName, context.Namespace), XmlSeverityType.Warning); 1477if (context.ElementDecl.IsAbstract) { 1478SendValidationEvent(Res.Sch_AbstractElement, QNameString(context.LocalName, context.Namespace)); 1484if (ProcessIdentityConstraints && context.ElementDecl.Constraints != null) { 1526SchemaElementDecl elementDecl = context.ElementDecl; 1528if (context.IsNill) { //Nil and fixed is error; Nil and default is compile time error 1532context.IsDefault = true; 1600IDs.Add(name, context.LocalName); 1654SchemaDeclBase decl = context.ElementDecl as SchemaDeclBase; 1661SendValidationEvent(Res.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(context.LocalName, context.Namespace), stringValue, GetTypeName(decl), exception.Message }, exception); 1665SendValidationEvent(Res.Sch_FixedElementValue, QNameString(context.LocalName, context.Namespace)); 1774SchemaElementDecl beforeXsiDecl = context.ElementDeclBeforeXsi; 1775SchemaElementDecl currentDecl = context.ElementDecl; 1808SchemaElementDecl currentElementDecl = context.ElementDecl; 1809context.Constr = new ConstraintStruct[currentElementDecl.Constraints.Length]; 1813context.Constr[id++] = new ConstraintStruct(currentElementDecl.Constraints[i]); 1818for (int i = 0; i < context.Constr.Length; ++i) { 1819if ( context.Constr[i].constraint.Role == CompiledIdentityConstraint.ConstraintRole.Keyref ) { 1830if (constraintStructures[j].constraint.name == context.Constr[i].constraint.refer) { 1835context.Constr[i].qualifiedTable = constraintStructures[j].keyrefTable; 1846SendValidationEvent(Res.Sch_RefNotInScope, QNameString(context.LocalName, context.Namespace)); 1859SchemaElementDecl currentElementDecl = context.ElementDecl; 1860string localName = context.LocalName; 1861string namespaceUri = context.Namespace; 1944string localName = context.LocalName; 1945string namespaceUri = context.Namespace; 2371context.Validity = XmlSchemaValidity.Invalid;