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

◆ ValidateAtomicValue() [1/2]

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

Definition at line 1389 of file XmlSchemaValidator.cs.

1390 {
1391 object typedValue = null;
1392 memberType = null;
1393 if (!_context.IsNill)
1394 {
1395 SchemaElementDecl elementDecl = _context.ElementDecl;
1396 SchemaDeclBase schemaDeclBase = elementDecl;
1397 XmlSchemaDatatype datatype = elementDecl.Datatype;
1398 Exception ex = datatype.TryParseValue(parsedValue, _nameTable, _nsResolver, out typedValue);
1399 if (ex != null)
1400 {
1401 string text = parsedValue as string;
1402 if (text == null)
1403 {
1404 text = XmlSchemaDatatype.ConcatenatedToString(parsedValue);
1405 }
1407 {
1408 QNameString(_context.LocalName, _context.Namespace),
1409 text,
1410 GetTypeName(schemaDeclBase),
1411 ex.Message
1412 }, ex);
1413 return null;
1414 }
1415 if (!schemaDeclBase.CheckValue(typedValue))
1416 {
1418 }
1419 if (datatype.Variety == XmlSchemaDatatypeVariety.Union)
1420 {
1421 XsdSimpleValue xsdSimpleValue = typedValue as XsdSimpleValue;
1422 memberType = xsdSimpleValue.XmlType;
1423 typedValue = xsdSimpleValue.TypedValue;
1424 datatype = memberType.Datatype;
1425 }
1426 CheckTokenizedTypes(datatype, typedValue, attrValue: false);
1427 }
1428 return typedValue;
1429 }
static string Sch_FixedElementValue
Definition SR.cs:494
static string Sch_ElementValueDataTypeDetailed
Definition SR.cs:580
Definition SR.cs:7
void CheckTokenizedTypes(XmlSchemaDatatype dtype, object typedValue, bool attrValue)
static string QNameString(string localName, string ns)
readonly IXmlNamespaceResolver _nsResolver

References System.Xml.Schema.XmlSchemaValidator._context, System.Xml.Schema.XmlSchemaValidator._nameTable, System.Xml.Schema.XmlSchemaValidator._nsResolver, System.Xml.Schema.XmlSchemaValidator.CheckTokenizedTypes(), System.Xml.Schema.XmlSchemaDatatype.ConcatenatedToString(), System.Xml.Dictionary, System.Xml.Schema.ValidationState.ElementDecl, System.Xml.Schema.ValidationState.IsNill, System.Xml.Schema.ValidationState.LocalName, System.Xml.Schema.ValidationState.Namespace, System.Xml.Schema.XmlSchemaValidator.QNameString(), System.SR.Sch_ElementValueDataTypeDetailed, System.SR.Sch_FixedElementValue, System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(), System.text, System.Xml.Schema.XmlSchemaDatatype.TryParseValue(), and System.Xml.Schema.XmlSchemaDatatype.Variety.