Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ ValidateAtomicValue() [2/2]

object System.Xml.Schema.XmlSchemaValidator.ValidateAtomicValue ( string stringValue,
out XmlSchemaSimpleType memberType )
inlineprivate

Definition at line 1340 of file XmlSchemaValidator.cs.

1341 {
1342 object typedValue = null;
1343 memberType = null;
1344 if (!_context.IsNill)
1345 {
1346 SchemaElementDecl elementDecl = _context.ElementDecl;
1347 if (stringValue.Length == 0 && elementDecl.DefaultValueTyped != null)
1348 {
1351 {
1352 Exception ex = elementDecl.Datatype.TryParseValue(elementDecl.DefaultValueRaw, _nameTable, _nsResolver, out typedValue);
1353 if (ex != null)
1354 {
1356 {
1357 elementDecl.DefaultValueRaw,
1358 QNameString(_context.LocalName, _context.Namespace)
1359 });
1360 }
1361 else
1362 {
1363 _context.IsDefault = true;
1364 }
1365 }
1366 else
1367 {
1368 _context.IsDefault = true;
1369 typedValue = elementDecl.DefaultValueTyped;
1370 }
1371 }
1372 else
1373 {
1374 typedValue = CheckElementValue(stringValue);
1375 }
1376 XsdSimpleValue xsdSimpleValue = typedValue as XsdSimpleValue;
1377 XmlSchemaDatatype datatype = elementDecl.Datatype;
1378 if (xsdSimpleValue != null)
1379 {
1380 memberType = xsdSimpleValue.XmlType;
1381 typedValue = xsdSimpleValue.TypedValue;
1382 datatype = memberType.Datatype;
1383 }
1384 CheckTokenizedTypes(datatype, typedValue, attrValue: false);
1385 }
1386 return typedValue;
1387 }
static string Sch_InvalidElementDefaultValue
Definition SR.cs:582
Definition SR.cs:7
object CheckElementValue(string stringValue)
void CheckTokenizedTypes(XmlSchemaDatatype dtype, object typedValue, bool attrValue)
readonly IXmlNamespaceResolver _nsResolver

References System.Xml.Schema.XmlSchemaValidator._context, System.Xml.Schema.XmlSchemaValidator._nameTable, System.Xml.Schema.XmlSchemaValidator._nsResolver, System.Xml.Schema.XmlSchemaValidator.CheckElementValue(), System.Xml.Schema.XmlSchemaValidator.CheckTokenizedTypes(), System.Xml.Dictionary, System.Xml.Schema.ValidationState.ElementDecl, System.Xml.Schema.ValidationState.ElementDeclBeforeXsi, System.Xml.Schema.ValidationState.IsNill, System.SR.Sch_InvalidElementDefaultValue, and System.Xml.Schema.XmlSchemaValidator.SendValidationEvent().

Referenced by System.Xml.Schema.XmlSchemaValidator.InternalValidateEndElement().