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