10 writes to context
dotnet-svcutil-lib (10)
FrameworkFork\Microsoft.Xml\Xml\schema\dtdvalidator.cs (3)
503
context
= (ValidationState)_validationStack.Push();
506
context
= new ValidationState();
521
context
= (ValidationState)_validationStack.Peek();
FrameworkFork\Microsoft.Xml\Xml\schema\xdrvalidator.cs (3)
656
context
= (ValidationState)_validationStack.Push();
659
context
= new ValidationState();
674
context
= (ValidationState)_validationStack.Peek();
FrameworkFork\Microsoft.Xml\Xml\schema\xsdvalidator.cs (4)
128
set {
context
= value; }
795
context
= (ValidationState)_validationStack.Push();
798
context
= new ValidationState();
821
context
= (ValidationState)_validationStack.Peek();
198 references to context
dotnet-svcutil-lib (198)
FrameworkFork\Microsoft.Xml\Xml\schema\basevalidator.cs (15)
167
if (
context
.NeedValidateChildren)
169
if (
context
.IsNill)
171
SendValidationEvent(ResXml.Sch_ContentInNill, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
174
ContentValidator contentValidator =
context
.ElementDecl.ContentValidator;
178
ArrayList names = contentValidator.ExpectedElements(
context
, false);
181
SendValidationEvent(ResXml.Sch_InvalidTextInElement, XmlSchemaValidator.BuildElementName(
context
.LocalName,
context
.Namespace));
186
SendValidationEvent(ResXml.Sch_InvalidTextInElementExpecting, new string[] { XmlSchemaValidator.BuildElementName(
context
.LocalName,
context
.Namespace), XmlSchemaValidator.PrintExpectedElements(names, false) });
202
if (
context
.NeedValidateChildren)
204
XmlSchemaContentType contentType =
context
.ElementDecl.ContentValidator.ContentType;
205
if (
context
.IsNill)
207
SendValidationEvent(ResXml.Sch_ContentInNill, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
FrameworkFork\Microsoft.Xml\Xml\schema\dtdvalidator.cs (48)
106
context
.ElementDecl != null &&
107
context
.ElementDecl.IsDeclaredInExternal &&
108
context
.ElementDecl.ContentValidator.ContentType == XmlSchemaContentType.ElementOnly)
119
if (
context
.NeedValidateChildren)
121
if (
context
.ElementDecl.ContentValidator == ContentValidator.Empty)
147
if (
context
.NeedValidateChildren)
150
context
.ElementDecl.ContentValidator.ValidateElement(elementName,
context
, out errorCode);
153
XmlSchemaValidator.ElementValidationError(elementName,
context
, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
160
if (
context
.ElementDecl != null)
162
Reader.SchemaTypeObject =
context
.ElementDecl.SchemaType;
164
if (Reader.IsEmptyElement &&
context
.ElementDecl.DefaultValueTyped != null)
166
Reader.TypedValueObject =
context
.ElementDecl.DefaultValueTyped;
167
context
.IsNill = true; // reusing IsNill - what is this flag later used for??
169
if (
context
.ElementDecl.HasRequiredAttribute)
182
SchemaAttDef attnDef =
context
.ElementDecl.GetAttDef(new XmlQualifiedName(reader.LocalName, reader.Prefix));
185
if (
context
.ElementDecl != null &&
context
.ElementDecl.HasRequiredAttribute)
214
if (
context
.ElementDecl.HasRequiredAttribute)
218
context
.ElementDecl.CheckAttributes(_attPresence, Reader.StandAlone);
227
if (
context
.ElementDecl.Datatype != null)
242
context
.ElementDecl = elementDecl;
245
context
.NeedValidateChildren = true;
246
elementDecl.ContentValidator.InitValidation(
context
);
250
SendValidationEvent(ResXml.Sch_UndeclaredElement, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
251
context
.ElementDecl = null;
269
if (
context
.ElementDecl != null)
271
if (
context
.NeedValidateChildren)
273
if (!
context
.ElementDecl.ContentValidator.CompleteValidation(
context
))
275
XmlSchemaValidator.CompleteValidationError(
context
, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
293
get { return
context
.ElementDecl != null ?
context
.ElementDecl.ContentValidator.PreserveWhitespace : false; }
313
AddID(name,
context
.LocalName);
343
XmlSchemaDatatype dtype = isAttn ? attdef.Datatype :
context
.ElementDecl.Datatype;
374
SchemaDeclBase decl = isAttn ? (SchemaDeclBase)attdef : (SchemaDeclBase)
context
.ElementDecl;
394
SendValidationEvent(ResXml.Sch_FixedElementValue, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
406
SendValidationEvent(ResXml.Sch_ElementValueDataType, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
504
if (
context
== null)
507
_validationStack.AddToTop(
context
);
509
context
.LocalName = elementName.Name;
510
context
.Namespace = elementName.Namespace;
511
context
.HasMatched = false;
512
context
.IsNill = false;
513
context
.NeedValidateChildren = false;
FrameworkFork\Microsoft.Xml\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);
154
context
.ElementDecl = ThoroughGetElementDecl();
155
if (
context
.ElementDecl != null)
159
context
.NeedValidateChildren = true;
160
context
.ElementDecl.ContentValidator.InitValidation(
context
);
170
if (
context
.ElementDecl != null)
172
if (
context
.NeedValidateChildren)
174
if (!
context
.ElementDecl.ContentValidator.CompleteValidation(
context
))
176
XmlSchemaValidator.CompleteValidationError(
context
, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
228
if (schemaInfo.TargetNamespaces.ContainsKey(
context
.Namespace))
230
SendValidationEvent(ResXml.Sch_UndeclaredElement, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
238
if (
context
.ElementDecl != null)
240
if (
context
.ElementDecl.SchemaType != null)
242
reader.SchemaTypeObject =
context
.ElementDecl.SchemaType;
246
reader.SchemaTypeObject =
context
.ElementDecl.Datatype;
248
if (reader.IsEmptyElement && !
context
.IsNill &&
context
.ElementDecl.DefaultValueTyped != null)
250
reader.TypedValueObject =
context
.ElementDecl.DefaultValueTyped;
251
context
.IsNill = true; // reusing IsNill
253
if (this.
context
.ElementDecl.HasRequiredAttribute)
271
SchemaAttDef attnDef = schemaInfo.GetAttributeXdr(
context
.ElementDecl, QualifiedName(reader.LocalName, reader.NamespaceURI));
274
if (
context
.ElementDecl != null &&
context
.ElementDecl.HasRequiredAttribute)
300
if (
context
.ElementDecl.HasDefaultAttribute)
302
for (int i = 0; i <
context
.ElementDecl.DefaultAttDefs.Count; ++i)
304
reader.AddDefaultAttribute((SchemaAttDef)
context
.ElementDecl.DefaultAttDefs[i]);
307
if (
context
.ElementDecl.HasRequiredAttribute)
311
context
.ElementDecl.CheckAttributes(_attPresence, reader.StandAlone);
319
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;
500
SchemaDeclBase decl = isAttn ? (SchemaDeclBase)attdef : (SchemaDeclBase)
context
.ElementDecl;
535
SendValidationEvent(ResXml.Sch_FixedElementValue, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
547
SendValidationEvent(ResXml.Sch_ElementValueDataType, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
657
if (
context
== null)
660
_validationStack.AddToTop(
context
);
662
context
.LocalName = elementName.Name;
663
context
.Namespace = elementName.Namespace;
664
context
.HasMatched = false;
665
context
.IsNill = false;
666
context
.NeedValidateChildren = false;
FrameworkFork\Microsoft.Xml\Xml\schema\xsdvalidator.cs (84)
194
if (
context
.NeedValidateChildren)
196
if (
context
.IsNill)
201
particle =
context
.ElementDecl.ContentValidator.ValidateElement(elementName,
context
, out errorCode);
204
_processContents =
context
.ProcessContents = XmlSchemaContentProcessing.Skip;
209
XmlSchemaValidator.ElementValidationError(elementName,
context
, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
236
SendValidationEvent(ResXml.Sch_UndeclaredElement, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
240
SendValidationEvent(ResXml.Sch_NoElementSchemaFound, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace), XmlSeverityType.Warning);
245
context
.ElementDecl = elementDecl;
248
if (
context
.ElementDecl != null)
251
context
.NeedValidateChildren = _processContents != XmlSchemaContentProcessing.Skip;
252
context
.ElementDecl.ContentValidator.InitValidation(
context
);
334
if (
context
.ElementDecl != null)
336
if (!
context
.IsNill)
338
if (
context
.NeedValidateChildren)
340
if (!
context
.ElementDecl.ContentValidator.CompleteValidation(
context
))
342
XmlSchemaValidator.CompleteValidationError(
context
, EventHandler, reader, reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
346
if (checkDatatype && !
context
.IsNill)
349
if (!(stringValue.Length == 0 &&
context
.ElementDecl.DefaultValueTyped != null))
397
SendValidationEvent(ResXml.Sch_AbstractElement, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
423
SendValidationEvent(ResXml.Sch_XsiTypeBlockedEx, new string[] { xsiType.ToString(), XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace) });
435
context
.IsNill = XmlConvert.ToBoolean(xsiNil);
436
if (
context
.IsNill && elementDecl.DefaultValueTyped != null)
452
if (
context
.ElementDecl != null)
454
if (
context
.ElementDecl.IsAbstract)
456
SendValidationEvent(ResXml.Sch_AbstractElement, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
459
reader.SchemaTypeObject =
context
.ElementDecl.SchemaType;
461
if (reader.IsEmptyElement && !
context
.IsNill &&
context
.ElementDecl.DefaultValueTyped != null)
463
reader.TypedValueObject = UnWrapUnion(
context
.ElementDecl.DefaultValueTyped);
464
context
.IsNill = true; // reusing IsNill
470
if (this.
context
.ElementDecl.HasRequiredAttribute || HasIdentityConstraints)
494
SchemaAttDef attnDef = schemaInfo.GetAttributeXsd(
context
.ElementDecl, attQName, ref skipContents);
498
if (
context
.ElementDecl != null && (
context
.ElementDecl.HasRequiredAttribute || _startIDConstraint != -1))
517
if (
context
.ElementDecl == null
543
if (
context
.ElementDecl.HasDefaultAttribute)
545
for (int i = 0; i <
context
.ElementDecl.DefaultAttDefs.Count; ++i)
547
SchemaAttDef attdef = (SchemaAttDef)
context
.ElementDecl.DefaultAttDefs[i];
557
if (
context
.ElementDecl.HasRequiredAttribute)
561
context
.ElementDecl.CheckAttributes(_attPresence, reader.StandAlone);
569
if (
context
.ElementDecl.Datatype != null)
666
get { return
context
.ElementDecl != null ?
context
.ElementDecl.ContentValidator.PreserveWhitespace : false; }
684
AddID(name,
context
.LocalName);
711
XmlSchemaDatatype dtype = isAttn ? attdef.Datatype :
context
.ElementDecl.Datatype;
737
SchemaDeclBase decl = isAttn ? (SchemaDeclBase)attdef : (SchemaDeclBase)
context
.ElementDecl;
746
SendValidationEvent(ResXml.Sch_FixedElementValue, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
763
SendValidationEvent(ResXml.Sch_ElementValueDataType, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
796
if (
context
== null)
799
_validationStack.AddToTop(
context
);
801
context
.LocalName = elementName.Name;
802
context
.Namespace = elementName.Namespace;
803
context
.HasMatched = false;
804
context
.IsNill = false;
805
context
.ProcessContents = _processContents;
806
context
.NeedValidateChildren = false;
807
context
.Constr = null; //resetting the constraints to be null incase context != null
822
_processContents =
context
.ProcessContents;
847
if (
context
.ElementDecl != null)
849
if (
context
.ElementDecl.Constraints != null)
868
context
.Constr = new ConstraintStruct[
context
.ElementDecl.Constraints.Length];
870
for (int i = 0; i <
context
.ElementDecl.Constraints.Length; ++i)
872
context
.Constr[id++] = new ConstraintStruct(
context
.ElementDecl.Constraints[i]);
877
for (int i = 0; i <
context
.Constr.Length; ++i)
879
if (
context
.Constr[i].constraint.Role == CompiledIdentityConstraint.ConstraintRole.Keyref)
894
if (constraints[j].constraint.name ==
context
.Constr[i].constraint.refer)
901
context
.Constr[i].qualifiedTable = constraints[j].keyrefTable;
914
SendValidationEvent(ResXml.Sch_RefNotInScope, XmlSchemaValidator.QNameString(
context
.LocalName,
context
.Namespace));
960
if (
context
.ElementDecl != null)
962
if (
context
.ElementDecl.Datatype == null)
1073
laxis.Ks[laxis.Column] = new TypedObject(reader.TypedValueObject, stringValue,
context
.ElementDecl.Datatype);