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

◆ ThoroughGetElementDecl()

SchemaElementDecl System.Xml.Schema.XsdValidator.ThoroughGetElementDecl ( SchemaElementDecl elementDecl,
XmlQualifiedName xsiType,
string xsiNil )
inlineprivate

Definition at line 378 of file XsdValidator.cs.

379 {
380 if (elementDecl == null)
381 {
383 }
384 if (elementDecl != null)
385 {
386 if (xsiType.IsEmpty)
387 {
388 if (elementDecl.IsAbstract)
389 {
391 elementDecl = null;
392 }
393 }
394 else if (xsiNil != null && xsiNil.Equals("true"))
395 {
397 }
398 else
399 {
400 if (!schemaInfo.ElementDeclsByType.TryGetValue(xsiType, out var value) && xsiType.Namespace == _nsXs)
401 {
402 XmlSchemaSimpleType simpleTypeFromXsdType = DatatypeImplementation.GetSimpleTypeFromXsdType(new XmlQualifiedName(xsiType.Name, _nsXs));
403 if (simpleTypeFromXsdType != null)
404 {
405 value = simpleTypeFromXsdType.ElementDecl;
406 }
407 }
408 if (value == null)
409 {
411 elementDecl = null;
412 }
413 else if (!XmlSchemaType.IsDerivedFrom(value.SchemaType, elementDecl.SchemaType, elementDecl.Block))
414 {
416 {
417 xsiType.ToString(),
418 XmlSchemaValidator.QNameString(context.LocalName, context.Namespace)
419 });
420 elementDecl = null;
421 }
422 else
423 {
425 }
426 }
427 if (elementDecl != null && elementDecl.IsNillable)
428 {
429 if (xsiNil != null)
430 {
431 context.IsNill = XmlConvert.ToBoolean(xsiNil);
432 if (context.IsNill && elementDecl.DefaultValueTyped != null)
433 {
435 }
436 }
437 }
438 else if (xsiNil != null)
439 {
441 }
442 }
443 return elementDecl;
444 }
static string Sch_XsiTypeNotFound
Definition SR.cs:602
static string Sch_InvalidXsiNill
Definition SR.cs:874
static string Sch_AbstractElement
Definition SR.cs:870
static string Sch_XsiNilAndType
Definition SR.cs:1132
static string Sch_XsiTypeBlockedEx
Definition SR.cs:872
static string Sch_XsiNilAndFixed
Definition SR.cs:1120
Definition SR.cs:7
void SendValidationEvent(string code)
Dictionary< XmlQualifiedName, SchemaElementDecl > ElementDeclsByType
Definition SchemaInfo.cs:97
SchemaElementDecl GetElementDecl(XmlQualifiedName qname)

References System.Xml.Schema.XsdValidator._nsXs, System.Xml.Schema.BaseValidator.context, System.Xml.Dictionary, System.Xml.Schema.SchemaInfo.ElementDeclsByType, System.Xml.Schema.BaseValidator.elementName, System.Xml.Schema.SchemaInfo.GetElementDecl(), System.Xml.Schema.DatatypeImplementation.GetSimpleTypeFromXsdType(), System.Xml.Schema.XmlSchemaType.IsDerivedFrom(), System.Xml.Schema.ValidationState.IsNill, System.Xml.Schema.ValidationState.LocalName, System.Xml.Schema.ValidationState.Namespace, System.Xml.Schema.XmlSchemaValidator.QNameString(), System.SR.Sch_AbstractElement, System.SR.Sch_InvalidXsiNill, System.SR.Sch_XsiNilAndFixed, System.SR.Sch_XsiNilAndType, System.SR.Sch_XsiTypeBlockedEx, System.SR.Sch_XsiTypeNotFound, System.Xml.Schema.BaseValidator.schemaInfo, System.Xml.Schema.BaseValidator.SendValidationEvent(), System.Xml.XmlConvert.ToBoolean(), and System.value.

Referenced by System.Xml.Schema.XsdValidator.ProcessElement().