9 writes to context
System.Private.Xml (9)
System\Xml\Schema\DtdValidator.cs (3)
502context = (ValidationState)_validationStack.Push(); 505context = new ValidationState(); 520context = (ValidationState?)_validationStack.Peek();
System\Xml\Schema\XdrValidator.cs (3)
653context = (ValidationState)_validationStack.Push(); 656context = new ValidationState(); 672context = (ValidationState?)_validationStack.Peek();
System\Xml\Schema\XsdValidator.cs (3)
776context = (ValidationState)_validationStack.Push(); 779context = new ValidationState(); 803context = (ValidationState?)_validationStack.Peek();
200 references to context
System.Private.Xml (200)
System\Xml\Schema\BaseValidator.cs (17)
171Debug.Assert(context != null); 172if (context.NeedValidateChildren) 174if (context.IsNill) 176SendValidationEvent(SR.Sch_ContentInNill, XmlSchemaValidator.QNameString(context.LocalName!, context.Namespace!)); 180ContentValidator contentValidator = context.ElementDecl!.ContentValidator!; 184ArrayList? names = contentValidator.ExpectedElements(context, false); 187SendValidationEvent(SR.Sch_InvalidTextInElement, XmlSchemaValidator.BuildElementName(context.LocalName!, context.Namespace!)); 192SendValidationEvent(SR.Sch_InvalidTextInElementExpecting, new string[] { XmlSchemaValidator.BuildElementName(context.LocalName!, context.Namespace!), XmlSchemaValidator.PrintExpectedElements(names, false) }); 209Debug.Assert(context != null); 210if (context.NeedValidateChildren) 212XmlSchemaContentType contentType = context.ElementDecl!.ContentValidator!.ContentType; 213if (context.IsNill) 215SendValidationEvent(SR.Sch_ContentInNill, XmlSchemaValidator.QNameString(context.LocalName!, context.Namespace!));
System\Xml\Schema\DtdValidator.cs (48)
109context!.ElementDecl != null && 110context.ElementDecl.IsDeclaredInExternal && 111context.ElementDecl.ContentValidator!.ContentType == XmlSchemaContentType.ElementOnly) 122if (context!.NeedValidateChildren) 124if (context!.ElementDecl!.ContentValidator == ContentValidator.Empty) 150if (context!.NeedValidateChildren) 153context.ElementDecl!.ContentValidator!.ValidateElement(elementName, context, out errorCode); 156XmlSchemaValidator.ElementValidationError(elementName, context, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null); 163if (context!.ElementDecl != null) 165Reader.SchemaTypeObject = context.ElementDecl.SchemaType; 167if (Reader.IsEmptyElement && context.ElementDecl.DefaultValueTyped != null) 169Reader.TypedValueObject = context.ElementDecl.DefaultValueTyped; 170context.IsNill = true; // reusing IsNill - what is this flag later used for?? 172if (context.ElementDecl.HasRequiredAttribute) 185SchemaAttDef? attnDef = context.ElementDecl!.GetAttDef(new XmlQualifiedName(reader.LocalName, reader.Prefix)); 188if (context.ElementDecl != null && context.ElementDecl.HasRequiredAttribute) 217if (context!.ElementDecl!.HasRequiredAttribute) 221context.ElementDecl.CheckAttributes(_attPresence, Reader.StandAlone); 230if (context.ElementDecl.Datatype != null) 245context!.ElementDecl = elementDecl; 248context.NeedValidateChildren = true; 249elementDecl.ContentValidator!.InitValidation(context); 253SendValidationEvent(SR.Sch_UndeclaredElement, XmlSchemaValidator.QNameString(context!.LocalName!, context.Namespace!)); 254context.ElementDecl = null; 272if (context!.ElementDecl != null) 274if (context.NeedValidateChildren) 276if (!context.ElementDecl.ContentValidator!.CompleteValidation(context)) 278XmlSchemaValidator.CompleteValidationError(context, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null); 296get { return context!.ElementDecl != null ? context.ElementDecl.ContentValidator!.PreserveWhitespace : false; } 316AddID(name, context!.LocalName!); 346XmlSchemaDatatype? dtype = isAttn ? attdef!.Datatype : context!.ElementDecl!.Datatype; 377SchemaDeclBase decl = isAttn ? (SchemaDeclBase)attdef! : (SchemaDeclBase)context!.ElementDecl!; 397SendValidationEvent(SR.Sch_FixedElementValue, XmlSchemaValidator.QNameString(context!.LocalName!, context.Namespace!)); 409SendValidationEvent(SR.Sch_ElementValueDataType, XmlSchemaValidator.QNameString(context!.LocalName!, context.Namespace!)); 503if (context == null) 506_validationStack.AddToTop(context); 508context.LocalName = elementName.Name; 509context.Namespace = elementName.Namespace; 510context.HasMatched = false; 511context.IsNill = false; 512context.NeedValidateChildren = false;
System\Xml\Schema\XdrValidator.cs (51)
109if (context!.NeedValidateChildren) 112context.ElementDecl!.ContentValidator!.ValidateElement(elementName, context, out errorCode); 115XmlSchemaValidator.ElementValidationError(elementName, context, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null); 155context!.ElementDecl = ThoroughGetElementDecl(); 156if (context.ElementDecl != null) 160context.NeedValidateChildren = true; 161context.ElementDecl.ContentValidator!.InitValidation(context); 172if (context!.ElementDecl != null) 174if (context.NeedValidateChildren) 176if (!context.ElementDecl.ContentValidator!.CompleteValidation(context)) 178XmlSchemaValidator.CompleteValidationError(context, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null); 230if (schemaInfo.TargetNamespaces.ContainsKey(context!.Namespace!)) 232SendValidationEvent(SR.Sch_UndeclaredElement, XmlSchemaValidator.QNameString(context.LocalName!, context.Namespace!)); 240if (context!.ElementDecl != null) 242if (context.ElementDecl.SchemaType != null) 244reader.SchemaTypeObject = context.ElementDecl.SchemaType; 248reader.SchemaTypeObject = context.ElementDecl.Datatype; 250if (reader.IsEmptyElement && !context.IsNill && context.ElementDecl.DefaultValueTyped != null) 252reader.TypedValueObject = context.ElementDecl.DefaultValueTyped; 253context.IsNill = true; // reusing IsNill 255if (this.context.ElementDecl.HasRequiredAttribute) 273SchemaAttDef? attnDef = schemaInfo!.GetAttributeXdr(context.ElementDecl, QualifiedName(reader.LocalName, reader.NamespaceURI)); 276if (context.ElementDecl != null && context.ElementDecl.HasRequiredAttribute) 302if (context!.ElementDecl!.HasDefaultAttribute) 304for (int i = 0; i < context.ElementDecl.DefaultAttDefs!.Count; ++i) 306reader.AddDefaultAttribute((SchemaAttDef)context.ElementDecl.DefaultAttDefs[i]); 310if (context.ElementDecl.HasRequiredAttribute) 314context.ElementDecl.CheckAttributes(_attPresence, reader.StandAlone); 323if (context.ElementDecl.Datatype != null) 406get { return context!.ElementDecl != null ? context.ElementDecl.ContentValidator!.PreserveWhitespace : false; } 423AddID(name, context!.LocalName); 464XmlSchemaDatatype? dtype = isAttn ? attdef!.Datatype : context!.ElementDecl!.Datatype; 501SchemaDeclBase decl = isAttn ? (SchemaDeclBase)attdef! : (SchemaDeclBase)context!.ElementDecl!; 536SendValidationEvent(SR.Sch_FixedElementValue, XmlSchemaValidator.QNameString(context!.LocalName!, context.Namespace!)); 548SendValidationEvent(SR.Sch_ElementValueDataType, XmlSchemaValidator.QNameString(context!.LocalName!, context.Namespace!)); 654if (context == null) 657_validationStack.AddToTop(context); 660context.LocalName = elementName.Name; 661context.Namespace = elementName.Namespace; 662context.HasMatched = false; 663context.IsNill = false; 664context.NeedValidateChildren = false;
System\Xml\Schema\XsdValidator.cs (84)
191if (context!.NeedValidateChildren) 193if (context.IsNill) 198particle = context.ElementDecl!.ContentValidator!.ValidateElement(elementName, context, out errorCode); 201_processContents = context.ProcessContents = XmlSchemaContentProcessing.Skip; 206XmlSchemaValidator.ElementValidationError(elementName, context, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null); 233SendValidationEvent(SR.Sch_UndeclaredElement, XmlSchemaValidator.QNameString(context!.LocalName!, context.Namespace!)); 237SendValidationEvent(SR.Sch_NoElementSchemaFound, XmlSchemaValidator.QNameString(context!.LocalName!, context.Namespace!), XmlSeverityType.Warning); 242context!.ElementDecl = elementDecl; 245if (context.ElementDecl != null) 248context.NeedValidateChildren = _processContents != XmlSchemaContentProcessing.Skip; 249context.ElementDecl.ContentValidator!.InitValidation(context); 329if (context!.ElementDecl != null) 331if (!context.IsNill) 333if (context.NeedValidateChildren) 335if (!context.ElementDecl.ContentValidator!.CompleteValidation(context)) 337XmlSchemaValidator.CompleteValidationError(context, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null); 341if (checkDatatype && !context.IsNill) 344if (!(stringValue.Length == 0 && context.ElementDecl.DefaultValueTyped != null)) 389SendValidationEvent(SR.Sch_AbstractElement, XmlSchemaValidator.QNameString(context!.LocalName!, context.Namespace!)); 415SendValidationEvent(SR.Sch_XsiTypeBlockedEx, new string?[] { xsiType.ToString(), XmlSchemaValidator.QNameString(context!.LocalName!, context.Namespace!) }); 427context!.IsNill = XmlConvert.ToBoolean(xsiNil); 428if (context.IsNill && elementDecl.DefaultValueTyped != null) 444if (context!.ElementDecl != null) 446if (context.ElementDecl.IsAbstract) 448SendValidationEvent(SR.Sch_AbstractElement, XmlSchemaValidator.QNameString(context.LocalName!, context.Namespace!)); 451reader.SchemaTypeObject = context.ElementDecl.SchemaType; 453if (reader.IsEmptyElement && !context.IsNill && context.ElementDecl.DefaultValueTyped != null) 455reader.TypedValueObject = UnWrapUnion(context.ElementDecl.DefaultValueTyped); 456context.IsNill = true; // reusing IsNill 462if (this.context.ElementDecl.HasRequiredAttribute || HasIdentityConstraints) 486SchemaAttDef? attnDef = schemaInfo!.GetAttributeXsd(context.ElementDecl, attQName, ref skipContents); 490if (context.ElementDecl != null && (context.ElementDecl.HasRequiredAttribute || _startIDConstraint != -1)) 509if (context.ElementDecl == null 535if (context!.ElementDecl!.HasDefaultAttribute) 537for (int i = 0; i < context.ElementDecl.DefaultAttDefs!.Count; ++i) 539SchemaAttDef attdef = (SchemaAttDef)context.ElementDecl.DefaultAttDefs[i]; 549if (context.ElementDecl.HasRequiredAttribute) 553context.ElementDecl.CheckAttributes(_attPresence, reader.StandAlone); 561if (context.ElementDecl.Datatype != null) 650get { return context!.ElementDecl != null ? context.ElementDecl.ContentValidator!.PreserveWhitespace : false; } 668AddID(name, context!.LocalName!); 695XmlSchemaDatatype? dtype = isAttn ? attdef!.Datatype : context!.ElementDecl!.Datatype; 721SchemaDeclBase decl = isAttn ? (SchemaDeclBase)attdef! : (SchemaDeclBase)context!.ElementDecl!; 730SendValidationEvent(SR.Sch_FixedElementValue, XmlSchemaValidator.QNameString(context!.LocalName!, context.Namespace!)); 747SendValidationEvent(SR.Sch_ElementValueDataType, XmlSchemaValidator.QNameString(context!.LocalName!, context.Namespace!)); 777if (context == null) 780_validationStack.AddToTop(context); 783context.LocalName = elementName.Name; 784context.Namespace = elementName.Namespace; 785context.HasMatched = false; 786context.IsNill = false; 787context.ProcessContents = _processContents; 788context.NeedValidateChildren = false; 789context.Constr = null; //resetting the constraints to be null incase context != null 804_processContents = context!.ProcessContents; 829if (context!.ElementDecl != null) 831if (context.ElementDecl.Constraints != null) 850context!.Constr = new ConstraintStruct[context.ElementDecl!.Constraints!.Length]; 852for (int i = 0; i < context.ElementDecl.Constraints.Length; ++i) 854context.Constr[id++] = new ConstraintStruct(context.ElementDecl.Constraints[i]); 859for (int i = 0; i < context.Constr.Length; ++i) 861if (context.Constr[i].constraint.Role == CompiledIdentityConstraint.ConstraintRole.Keyref) 876if (constraints[j].constraint.name == context.Constr[i].constraint.refer) 883context.Constr[i].qualifiedTable = constraints[j].keyrefTable; 896SendValidationEvent(SR.Sch_RefNotInScope, XmlSchemaValidator.QNameString(context.LocalName!, context.Namespace!)); 942if (context!.ElementDecl != null) 944if (context.ElementDecl.Datatype == null) 1056laxis.Ks[laxis.Column] = new TypedObject(reader.TypedValueObject, stringValue, context!.ElementDecl!.Datatype);