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