10 writes to context
System.Xml (10)
System\Xml\Schema\DtdValidator.cs (3)
415
context
= (ValidationState)validationStack.Push();
417
context
= new ValidationState();
430
context
= (ValidationState)validationStack.Peek();
System\Xml\Schema\XdrValidator.cs (3)
537
context
= (ValidationState)validationStack.Push();
539
context
= new ValidationState();
552
context
= (ValidationState)validationStack.Peek();
System\Xml\Schema\XsdValidator.cs (4)
116
set {
context
= value; }
652
context
= (ValidationState)validationStack.Push();
654
context
= new ValidationState();
674
context
= (ValidationState)validationStack.Peek();
198 references to context
System.Xml (198)
System\Xml\Schema\BaseValidator.cs (15)
142
if (
context
.NeedValidateChildren) {
143
if (
context
.IsNill) {
144
SendValidationEvent(Res.Sch_ContentInNill, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
147
ContentValidator contentValidator =
context
.ElementDecl.ContentValidator;
150
ArrayList names = contentValidator.ExpectedElements(
context
, false);
152
SendValidationEvent(Res.Sch_InvalidTextInElement, XmlSchemaValidator.BuildElementName(
context
.LocalName,
context
.Namespace));
156
SendValidationEvent(Res.Sch_InvalidTextInElementExpecting, new string[] { XmlSchemaValidator.BuildElementName(
context
.LocalName,
context
.Namespace), XmlSchemaValidator.PrintExpectedElements(names, false) });
169
if (
context
.NeedValidateChildren) {
170
XmlSchemaContentType contentType =
context
.ElementDecl.ContentValidator.ContentType;
171
if (
context
.IsNill) {
172
SendValidationEvent(Res.Sch_ContentInNill, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
System\Xml\Schema\DtdValidator.cs (48)
96
context
.ElementDecl != null &&
97
context
.ElementDecl.IsDeclaredInExternal &&
98
context
.ElementDecl.ContentValidator.ContentType == XmlSchemaContentType.ElementOnly) {
107
if (
context
.NeedValidateChildren ) {
108
if (
context
.ElementDecl.ContentValidator == ContentValidator.Empty) {
130
if (
context
.NeedValidateChildren) { //i think i can get away with removing this if cond since won't make this call for documentelement
132
context
.ElementDecl.ContentValidator.ValidateElement(elementName,
context
, out errorCode);
134
XmlSchemaValidator.ElementValidationError(elementName,
context
, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
140
if (
context
.ElementDecl != null) {
141
Reader.SchemaTypeObject =
context
.ElementDecl.SchemaType;
143
if (Reader.IsEmptyElement &&
context
.ElementDecl.DefaultValueTyped != null) {
144
Reader.TypedValueObject =
context
.ElementDecl.DefaultValueTyped;
145
context
.IsNill = true; // reusing IsNill - what is this flag later used for??
147
if (
context
.ElementDecl.HasRequiredAttribute ) {
156
SchemaAttDef attnDef =
context
.ElementDecl.GetAttDef( new XmlQualifiedName( reader.LocalName, reader.Prefix) );
158
if (
context
.ElementDecl != null &&
context
.ElementDecl.HasRequiredAttribute) {
183
if (
context
.ElementDecl.HasRequiredAttribute) {
185
context
.ElementDecl.CheckAttributes(attPresence, Reader.StandAlone);
193
if (
context
.ElementDecl.Datatype != null) {
205
context
.ElementDecl = elementDecl;
208
context
.NeedValidateChildren = true;
209
elementDecl.ContentValidator.InitValidation(
context
);
212
SendValidationEvent(Res.Sch_UndeclaredElement, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
213
context
.ElementDecl = null;
227
if (
context
.ElementDecl != null) {
228
if (
context
.NeedValidateChildren) {
229
if(!
context
.ElementDecl.ContentValidator.CompleteValidation(
context
)) {
230
XmlSchemaValidator.CompleteValidationError(
context
, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
247
get { return
context
.ElementDecl != null ?
context
.ElementDecl.ContentValidator.PreserveWhitespace : false; }
262
AddID(name,
context
.LocalName);
288
XmlSchemaDatatype dtype = isAttn ? attdef.Datatype :
context
.ElementDecl.Datatype;
313
SchemaDeclBase decl = isAttn ? (SchemaDeclBase)attdef : (SchemaDeclBase)
context
.ElementDecl;
328
SendValidationEvent(Res.Sch_FixedElementValue, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
337
SendValidationEvent(Res.Sch_ElementValueDataType, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
416
if (
context
== null) {
418
validationStack.AddToTop(
context
);
420
context
.LocalName = elementName.Name;
421
context
.Namespace = elementName.Namespace;
422
context
.HasMatched = false;
423
context
.IsNill = false;
424
context
.NeedValidateChildren = false;
System\Xml\Schema\XdrValidator.cs (51)
95
if (
context
.NeedValidateChildren) {
97
context
.ElementDecl.ContentValidator.ValidateElement(elementName,
context
, out errorCode);
99
XmlSchemaValidator.ElementValidationError(elementName,
context
, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
130
context
.ElementDecl = ThoroughGetElementDecl();
131
if (
context
.ElementDecl != null) {
134
context
.NeedValidateChildren = true;
135
context
.ElementDecl.ContentValidator.InitValidation(
context
);
143
if (
context
.ElementDecl != null) {
144
if (
context
.NeedValidateChildren) {
145
if(!
context
.ElementDecl.ContentValidator.CompleteValidation(
context
)) {
146
XmlSchemaValidator.CompleteValidationError(
context
, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
191
if(schemaInfo.TargetNamespaces.ContainsKey(
context
.Namespace)) {
192
SendValidationEvent(Res.Sch_UndeclaredElement, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
199
if (
context
.ElementDecl != null) {
200
if (
context
.ElementDecl.SchemaType != null) {
201
reader.SchemaTypeObject =
context
.ElementDecl.SchemaType;
204
reader.SchemaTypeObject =
context
.ElementDecl.Datatype;
206
if (reader.IsEmptyElement && !
context
.IsNill &&
context
.ElementDecl.DefaultValueTyped != null) {
207
reader.TypedValueObject =
context
.ElementDecl.DefaultValueTyped;
208
context
.IsNill = true; // reusing IsNill
210
if (this.
context
.ElementDecl.HasRequiredAttribute) {
223
SchemaAttDef attnDef = schemaInfo.GetAttributeXdr(
context
.ElementDecl, QualifiedName(reader.LocalName, reader.NamespaceURI));
225
if (
context
.ElementDecl != null &&
context
.ElementDecl.HasRequiredAttribute) {
248
if (
context
.ElementDecl.HasDefaultAttribute) {
249
for (int i = 0; i <
context
.ElementDecl.DefaultAttDefs.Count; ++i) {
250
reader.AddDefaultAttribute((SchemaAttDef)
context
.ElementDecl.DefaultAttDefs[i]);
253
if (
context
.ElementDecl.HasRequiredAttribute) {
255
context
.ElementDecl.CheckAttributes(attPresence, reader.StandAlone);
263
if (
context
.ElementDecl.Datatype != null) {
335
get { return
context
.ElementDecl != null ?
context
.ElementDecl.ContentValidator.PreserveWhitespace : false; }
348
AddID(name,
context
.LocalName);
383
XmlSchemaDatatype dtype = isAttn ? attdef.Datatype :
context
.ElementDecl.Datatype;
412
SchemaDeclBase decl = isAttn ? (SchemaDeclBase)attdef : (SchemaDeclBase)
context
.ElementDecl;
438
SendValidationEvent(Res.Sch_FixedElementValue, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
447
SendValidationEvent(Res.Sch_ElementValueDataType, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
538
if (
context
== null) {
540
validationStack.AddToTop(
context
);
542
context
.LocalName = elementName.Name;
543
context
.Namespace = elementName.Namespace;
544
context
.HasMatched = false;
545
context
.IsNill = false;
546
context
.NeedValidateChildren = false;
System\Xml\Schema\XsdValidator.cs (84)
169
if (
context
.NeedValidateChildren) {
170
if (
context
.IsNill) {
174
particle =
context
.ElementDecl.ContentValidator.ValidateElement(elementName,
context
, out errorCode);
176
processContents =
context
.ProcessContents = XmlSchemaContentProcessing.Skip;
180
XmlSchemaValidator.ElementValidationError(elementName,
context
, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
201
SendValidationEvent(Res.Sch_UndeclaredElement, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
204
SendValidationEvent(Res.Sch_NoElementSchemaFound, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace), XmlSeverityType.Warning);
209
context
.ElementDecl = elementDecl;
212
if (
context
.ElementDecl != null) {
214
context
.NeedValidateChildren = processContents != XmlSchemaContentProcessing.Skip;
215
context
.ElementDecl.ContentValidator.InitValidation(
context
);
280
if (
context
.ElementDecl != null) {
281
if (!
context
.IsNill) {
282
if (
context
.NeedValidateChildren) {
283
if(!
context
.ElementDecl.ContentValidator.CompleteValidation(
context
)) {
284
XmlSchemaValidator.CompleteValidationError(
context
, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
288
if (checkDatatype && !
context
.IsNill) {
290
if(!(stringValue.Length == 0 &&
context
.ElementDecl.DefaultValueTyped != null)) {
328
SendValidationEvent(Res.Sch_AbstractElement, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
348
SendValidationEvent(Res.Sch_XsiTypeBlockedEx, new string[] { xsiType.ToString(), XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace) });
357
context
.IsNill = XmlConvert.ToBoolean(xsiNil);
358
if (
context
.IsNill && elementDecl.DefaultValueTyped != null) {
371
if (
context
.ElementDecl != null) {
372
if (
context
.ElementDecl.IsAbstract) {
373
SendValidationEvent(Res.Sch_AbstractElement, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
376
reader.SchemaTypeObject =
context
.ElementDecl.SchemaType;
378
if (reader.IsEmptyElement && !
context
.IsNill &&
context
.ElementDecl.DefaultValueTyped != null) {
379
reader.TypedValueObject = UnWrapUnion(
context
.ElementDecl.DefaultValueTyped);
380
context
.IsNill = true; // reusing IsNill
385
if (this.
context
.ElementDecl.HasRequiredAttribute || HasIdentityConstraints) {
403
SchemaAttDef attnDef = schemaInfo.GetAttributeXsd(
context
.ElementDecl, attQName, ref skipContents);
406
if (
context
.ElementDecl != null && (
context
.ElementDecl.HasRequiredAttribute || this.startIDConstraint != -1)) {
422
if (
context
.ElementDecl == null
444
if (
context
.ElementDecl.HasDefaultAttribute) {
445
for (int i = 0; i <
context
.ElementDecl.DefaultAttDefs.Count; ++i) {
446
SchemaAttDef attdef = (SchemaAttDef)
context
.ElementDecl.DefaultAttDefs[i];
455
if (
context
.ElementDecl.HasRequiredAttribute) {
457
context
.ElementDecl.CheckAttributes(attPresence, reader.StandAlone);
465
if (
context
.ElementDecl.Datatype != null) {
547
get { return
context
.ElementDecl != null ?
context
.ElementDecl.ContentValidator.PreserveWhitespace : false; }
561
AddID(name,
context
.LocalName);
585
XmlSchemaDatatype dtype = isAttn ? attdef.Datatype :
context
.ElementDecl.Datatype;
606
SchemaDeclBase decl = isAttn ? (SchemaDeclBase)attdef : (SchemaDeclBase)
context
.ElementDecl;
612
SendValidationEvent(Res.Sch_FixedElementValue, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
625
SendValidationEvent(Res.Sch_ElementValueDataType, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
653
if (
context
== null) {
655
validationStack.AddToTop(
context
);
657
context
.LocalName = elementName.Name;
658
context
.Namespace = elementName.Namespace;
659
context
.HasMatched = false;
660
context
.IsNill = false;
661
context
.ProcessContents = processContents;
662
context
.NeedValidateChildren = false;
663
context
.Constr = null; //resetting the constraints to be null incase context != null
675
processContents =
context
.ProcessContents;
696
if (
context
.ElementDecl != null) {
697
if (
context
.ElementDecl.Constraints != null) {
712
context
.Constr = new ConstraintStruct[
context
.ElementDecl.Constraints.Length];
714
for (int i = 0; i <
context
.ElementDecl.Constraints.Length; ++i) {
715
context
.Constr[id++] = new ConstraintStruct (
context
.ElementDecl.Constraints[i]);
720
for (int i = 0; i <
context
.Constr.Length; ++i) {
721
if (
context
.Constr[i].constraint.Role == CompiledIdentityConstraint.ConstraintRole.Keyref ) {
732
if (constraints[j].constraint.name ==
context
.Constr[i].constraint.refer) {
737
context
.Constr[i].qualifiedTable = constraints[j].keyrefTable;
748
SendValidationEvent(Res.Sch_RefNotInScope, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
787
if (
context
.ElementDecl != null) { // nextElement can be null when xml/xsd are not valid
788
if (
context
.ElementDecl.Datatype == null) {
879
laxis.Ks[laxis.Column] = new TypedObject(reader.TypedValueObject,stringValue,
context
.ElementDecl.Datatype);