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

◆ CheckValue()

void System.Xml.Schema.DtdValidator.CheckValue ( string value,
SchemaAttDef attdef )
inlineprivate

Definition at line 323 of file DtdValidator.cs.

324 {
325 try
326 {
328 bool flag = attdef != null;
329 XmlSchemaDatatype xmlSchemaDatatype = (flag ? attdef.Datatype : context.ElementDecl.Datatype);
330 if (xmlSchemaDatatype == null)
331 {
332 return;
333 }
334 if (xmlSchemaDatatype.TokenizedType != 0)
335 {
336 value = value.Trim();
337 }
338 object obj = xmlSchemaDatatype.ParseValue(value, base.NameTable, s_namespaceManager);
342 {
343 if (xmlSchemaDatatype.Variety == XmlSchemaDatatypeVariety.List)
344 {
345 string[] array = (string[])obj;
346 for (int i = 0; i < array.Length; i++)
347 {
349 }
350 }
351 else
352 {
353 ProcessTokenizedType(xmlSchemaDatatype.TokenizedType, (string)obj);
354 }
355 }
356 SchemaDeclBase schemaDeclBase = (flag ? ((SchemaDeclBase)attdef) : ((SchemaDeclBase)context.ElementDecl));
357 if (schemaDeclBase.Values != null && !schemaDeclBase.CheckEnumeration(obj))
358 {
359 if (xmlSchemaDatatype.TokenizedType == XmlTokenizedType.NOTATION)
360 {
362 }
363 else
364 {
366 }
367 }
368 if (!schemaDeclBase.CheckValue(obj))
369 {
370 if (flag)
371 {
373 }
374 else
375 {
377 }
378 }
379 }
380 catch (XmlSchemaException)
381 {
382 if (attdef != null)
383 {
385 }
386 else
387 {
389 }
390 }
391 }
static string Sch_AttributeValueDataType
Definition SR.cs:1808
static string Sch_ElementValueDataType
Definition SR.cs:1810
static string Sch_FixedElementValue
Definition SR.cs:494
static string Sch_FixedAttributeValue
Definition SR.cs:492
static string Sch_EnumerationValue
Definition SR.cs:568
static string Sch_NotationValue
Definition SR.cs:566
Definition SR.cs:7
void SendValidationEvent(string code)
void ProcessTokenizedType(XmlTokenizedType ttype, string name)
static readonly NamespaceManager s_namespaceManager

References System.array, System.Xml.Schema.BaseValidator.context, System.Xml.Schema.SchemaDeclBase.Datatype, System.Xml.Dictionary, System.Xml.Schema.ValidationState.ElementDecl, System.Xml.Schema.ValidationState.LocalName, System.Xml.Schema.ValidationState.Namespace, System.obj, System.Xml.Schema.XmlSchemaDatatype.ParseValue(), System.Xml.Schema.DtdValidator.ProcessTokenizedType(), System.Xml.Schema.XmlSchemaValidator.QNameString(), System.Xml.Schema.DtdValidator.s_namespaceManager, System.SR.Sch_AttributeValueDataType, System.SR.Sch_ElementValueDataType, System.SR.Sch_EnumerationValue, System.SR.Sch_FixedAttributeValue, System.SR.Sch_FixedElementValue, System.SR.Sch_NotationValue, System.Xml.Schema.BaseValidator.SendValidationEvent(), and System.value.

Referenced by System.Xml.Schema.DtdValidator.ValidateEndElement(), and System.Xml.Schema.DtdValidator.ValidateStartElement().