Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ InternalValidateEndElement()

object System.Xml.Schema.XmlSchemaValidator.InternalValidateEndElement ( XmlSchemaInfo schemaInfo,
object typedValue )
inlineprivate

Definition at line 1118 of file XmlSchemaValidator.cs.

1119 {
1120 if (_validationStack.Length <= 1)
1121 {
1123 }
1124 CheckStateTransition(ValidatorState.EndElement, s_methodNames[9]);
1125 SchemaElementDecl elementDecl = _context.ElementDecl;
1126 XmlSchemaSimpleType memberType = null;
1127 XmlSchemaType schemaType = null;
1128 XmlSchemaElement schemaElement = null;
1129 string text = string.Empty;
1130 if (elementDecl != null)
1131 {
1132 if (_context.CheckRequiredAttribute && elementDecl.HasRequiredAttribute)
1133 {
1135 }
1137 {
1138 switch (elementDecl.ContentValidator.ContentType)
1139 {
1140 case XmlSchemaContentType.TextOnly:
1141 if (typedValue == null)
1142 {
1144 typedValue = ValidateAtomicValue(text, out memberType);
1145 }
1146 else
1147 {
1148 typedValue = ValidateAtomicValue(typedValue, out memberType);
1149 }
1150 break;
1151 case XmlSchemaContentType.Mixed:
1152 if (elementDecl.DefaultValueTyped != null && typedValue == null)
1153 {
1155 typedValue = CheckMixedValueConstraint(text);
1156 }
1157 break;
1158 case XmlSchemaContentType.ElementOnly:
1159 if (typedValue != null)
1160 {
1162 }
1163 break;
1164 }
1165 if (!elementDecl.ContentValidator.CompleteValidation(_context))
1166 {
1168 _context.Validity = XmlSchemaValidity.Invalid;
1169 }
1170 }
1172 {
1173 XmlSchemaType xmlSchemaType = ((memberType == null) ? elementDecl.SchemaType : memberType);
1174 EndElementIdentityConstraints(typedValue, text, xmlSchemaType.Datatype);
1175 }
1176 schemaType = elementDecl.SchemaType;
1178 }
1179 if (schemaInfo != null)
1180 {
1181 schemaInfo.SchemaType = schemaType;
1186 if (_context.Validity == XmlSchemaValidity.NotKnown && StrictlyAssessed)
1187 {
1188 _context.Validity = XmlSchemaValidity.Valid;
1189 }
1191 }
1192 Pop();
1193 return typedValue;
1194 }
static string Sch_InvalidEndElementCallTyped
Definition SR.cs:1188
static string Sch_InvalidEndElementMultiple
Definition SR.cs:1190
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
override string ToString()
void CheckStateTransition(ValidatorState toState, string methodName)
void CheckRequiredAttributes(SchemaElementDecl currentElementDecl)
object ValidateAtomicValue(string stringValue, out XmlSchemaSimpleType memberType)
static void CompleteValidationError(ValidationState context, ValidationEventHandler eventHandler, object sender, string sourceUri, int lineNo, int linePos, XmlSchemaSet schemaSet)
void EndElementIdentityConstraints(object typedValue, string stringValue, XmlSchemaDatatype datatype)
object CheckMixedValueConstraint(string elementValue)
readonly IXmlNamespaceResolver _nsResolver

References System.Xml.Schema.XmlSchemaValidator._context, System.Xml.Schema.XmlSchemaValidator._eventHandler, System.Xml.Schema.XmlSchemaValidator._nsResolver, System.Xml.Schema.XmlSchemaValidator._positionInfo, System.Xml.Schema.XmlSchemaValidator._schemaSet, System.Xml.Schema.XmlSchemaValidator._sourceUriString, System.Xml.Schema.XmlSchemaValidator._textValue, System.Xml.Schema.XmlSchemaValidator._validationStack, System.Xml.Schema.XmlSchemaValidator.CheckMixedValueConstraint(), System.Xml.Schema.ValidationState.CheckRequiredAttribute, System.Xml.Schema.XmlSchemaValidator.CheckRequiredAttributes(), System.Xml.Schema.XmlSchemaValidator.CheckStateTransition(), System.Xml.Schema.XmlSchemaValidator.CompleteValidationError(), System.Xml.Dictionary, System.Xml.Schema.ValidationState.ElementDecl, System.Xml.Schema.XmlSchemaValidator.EndElementIdentityConstraints(), System.SR.Format(), System.Xml.Schema.XmlSchemaValidator.GetSchemaElement(), System.Xml.Schema.XmlSchemaValidator.HasIdentityConstraints, System.Xml.Schema.ValidationState.IsDefault, System.Xml.Schema.ValidationState.IsNill, System.Xml.HWStack.Length, System.Xml.IXmlLineInfo.LineNumber, System.Xml.IXmlLineInfo.LinePosition, System.Xml.Schema.ValidationState.NeedValidateChildren, System.Xml.Schema.XmlSchemaValidator.Pop(), System.Xml.Schema.XmlSchemaValidator.s_methodNames, System.SR.Sch_InvalidEndElementCallTyped, System.SR.Sch_InvalidEndElementMultiple, System.Xml.Schema.XmlSchemaValidator.StrictlyAssessed, System.text, System.Text.StringBuilder.ToString(), System.Xml.Schema.XmlSchemaValidator.ValidateAtomicValue(), and System.Xml.Schema.ValidationState.Validity.

Referenced by System.Xml.Schema.XmlSchemaValidator.ValidateEndElement(), and System.Xml.Schema.XmlSchemaValidator.ValidateEndElement().