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

◆ CompileSimpleContentRestriction()

void System.Xml.Schema.SchemaCollectionCompiler.CompileSimpleContentRestriction ( XmlSchemaComplexType complexType,
XmlSchemaSimpleContentRestriction simpleRestriction )
inlineprivate

Definition at line 774 of file SchemaCollectionCompiler.cs.

775 {
776 XmlSchemaComplexType xmlSchemaComplexType = null;
777 XmlSchemaDatatype xmlSchemaDatatype = null;
778 if (complexType.Redefined != null && simpleRestriction.BaseTypeName == complexType.Redefined.QualifiedName)
779 {
780 xmlSchemaComplexType = (XmlSchemaComplexType)complexType.Redefined;
783 }
784 else
785 {
787 if (xmlSchemaComplexType == null)
788 {
790 return;
791 }
792 if (xmlSchemaComplexType.ContentType == XmlSchemaContentType.TextOnly)
793 {
794 if (simpleRestriction.BaseType == null)
795 {
797 }
798 else
799 {
801 if (!XmlSchemaType.IsDerivedFromDatatype(simpleRestriction.BaseType.Datatype, xmlSchemaComplexType.Datatype, XmlSchemaDerivationMethod.None))
802 {
804 }
805 xmlSchemaDatatype = simpleRestriction.BaseType.Datatype;
806 }
807 }
808 else if (xmlSchemaComplexType.ContentType == XmlSchemaContentType.Mixed && xmlSchemaComplexType.ElementDecl.ContentValidator.IsEmptiable)
809 {
810 if (simpleRestriction.BaseType != null)
811 {
813 complexType.SetBaseSchemaType(simpleRestriction.BaseType);
814 xmlSchemaDatatype = simpleRestriction.BaseType.Datatype;
815 }
816 else
817 {
819 }
820 }
821 else
822 {
824 }
825 }
826 if (xmlSchemaComplexType != null && xmlSchemaComplexType.ElementDecl != null && (xmlSchemaComplexType.FinalResolved & XmlSchemaDerivationMethod.Restriction) != 0)
827 {
829 }
830 if (xmlSchemaComplexType != null)
831 {
832 complexType.SetBaseSchemaType(xmlSchemaComplexType);
833 }
834 if (xmlSchemaDatatype != null)
835 {
836 try
837 {
838 complexType.SetDatatype(xmlSchemaDatatype.DeriveByRestriction(simpleRestriction.Facets, base.NameTable, complexType));
839 }
840 catch (XmlSchemaException ex)
841 {
842 if (ex.SourceSchemaObject == null)
843 {
844 ex.SetSource(complexType);
845 }
847 complexType.SetDatatype(DatatypeImplementation.AnySimpleType.Datatype);
848 }
849 }
850 complexType.SetDerivedBy(XmlSchemaDerivationMethod.Restriction);
851 CompileLocalAttributes(xmlSchemaComplexType, complexType, simpleRestriction.Attributes, simpleRestriction.AnyAttribute, XmlSchemaDerivationMethod.Restriction);
852 }
static string Sch_NotSimpleContent
Definition SR.cs:962
static string Sch_NeedSimpleTypeChild
Definition SR.cs:1146
static string Sch_DerivedNotFromBase
Definition SR.cs:1144
static string Sch_UndefBaseRestriction
Definition SR.cs:972
static string Sch_BaseFinalRestriction
Definition SR.cs:966
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
void CompileLocalAttributes(XmlSchemaComplexType baseType, XmlSchemaComplexType derivedType, XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaDerivationMethod derivedBy)
XmlSchemaComplexType GetComplexType(XmlQualifiedName name)
void CompileComplexType(XmlSchemaComplexType complexType)
void CompileSimpleType(XmlSchemaSimpleType simpleType)

References System.Xml.Schema.DatatypeImplementation.AnySimpleType, System.Xml.Schema.SchemaCollectionCompiler.CompileComplexType(), System.Xml.Schema.SchemaCollectionCompiler.CompileLocalAttributes(), System.Xml.Schema.SchemaCollectionCompiler.CompileSimpleType(), System.Xml.Schema.SchemaCollectionCompiler.GetComplexType(), System.Xml.Schema.XmlSchemaType.IsDerivedFromDatatype(), System.SR.Sch_BaseFinalRestriction, System.SR.Sch_DerivedNotFromBase, System.SR.Sch_NeedSimpleTypeChild, System.SR.Sch_NotSimpleContent, System.SR.Sch_UndefBaseRestriction, and System.Xml.Schema.BaseProcessor.SendValidationEvent().

Referenced by System.Xml.Schema.SchemaCollectionCompiler.CompileComplexType().