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

◆ CompileComplexContent()

ContentValidator System.Xml.Schema.SchemaCollectionCompiler.CompileComplexContent ( XmlSchemaComplexType complexType)
inlineprivate

Definition at line 2184 of file SchemaCollectionCompiler.cs.

2185 {
2186 if (complexType.ContentType == XmlSchemaContentType.Empty)
2187 {
2188 return ContentValidator.Empty;
2189 }
2190 if (complexType.ContentType == XmlSchemaContentType.TextOnly)
2191 {
2192 return ContentValidator.TextOnly;
2193 }
2194 XmlSchemaParticle contentTypeParticle = complexType.ContentTypeParticle;
2195 if (contentTypeParticle == null || contentTypeParticle == XmlSchemaParticle.Empty)
2196 {
2197 if (complexType.ContentType == XmlSchemaContentType.ElementOnly)
2198 {
2199 return ContentValidator.Empty;
2200 }
2201 return ContentValidator.Mixed;
2202 }
2204 if (contentTypeParticle is XmlSchemaAll)
2205 {
2206 XmlSchemaAll xmlSchemaAll = (XmlSchemaAll)contentTypeParticle;
2207 AllElementsContentValidator allElementsContentValidator = new AllElementsContentValidator(complexType.ContentType, xmlSchemaAll.Items.Count, xmlSchemaAll.MinOccurs == 0m);
2208 for (int i = 0; i < xmlSchemaAll.Items.Count; i++)
2209 {
2210 XmlSchemaElement xmlSchemaElement = (XmlSchemaElement)xmlSchemaAll.Items[i];
2211 if (!allElementsContentValidator.AddElement(xmlSchemaElement.QualifiedName, xmlSchemaElement, xmlSchemaElement.MinOccurs == 0m))
2212 {
2214 }
2215 }
2217 }
2218 ParticleContentValidator particleContentValidator = new ParticleContentValidator(complexType.ContentType);
2219 try
2220 {
2224 }
2225 catch (UpaException ex)
2226 {
2227 if (ex.Particle1 is XmlSchemaElement)
2228 {
2229 if (ex.Particle2 is XmlSchemaElement)
2230 {
2231 SendValidationEvent(System.SR.Sch_NonDeterministic, ((XmlSchemaElement)ex.Particle1).QualifiedName.ToString(), (XmlSchemaElement)ex.Particle2);
2232 }
2233 else
2234 {
2235 SendValidationEvent(System.SR.Sch_NonDeterministicAnyEx, ((XmlSchemaAny)ex.Particle2).NamespaceList.ToString(), ((XmlSchemaElement)ex.Particle1).QualifiedName.ToString(), (XmlSchemaAny)ex.Particle2);
2236 }
2237 }
2238 else if (ex.Particle2 is XmlSchemaElement)
2239 {
2240 SendValidationEvent(System.SR.Sch_NonDeterministicAnyEx, ((XmlSchemaAny)ex.Particle1).NamespaceList.ToString(), ((XmlSchemaElement)ex.Particle2).QualifiedName.ToString(), (XmlSchemaAny)ex.Particle1);
2241 }
2242 else
2243 {
2244 SendValidationEvent(System.SR.Sch_NonDeterministicAnyAny, ((XmlSchemaAny)ex.Particle1).NamespaceList.ToString(), ((XmlSchemaAny)ex.Particle2).NamespaceList.ToString(), (XmlSchemaAny)ex.Particle1);
2245 }
2246 return XmlSchemaComplexType.AnyTypeContentValidator;
2247 }
2248 catch (NotSupportedException)
2249 {
2251 return XmlSchemaComplexType.AnyTypeContentValidator;
2252 }
2253 }
static string Sch_NonDeterministic
Definition SR.cs:584
static string Sch_DupElement
Definition SR.cs:480
static string Sch_ComplexContentModel
Definition SR.cs:1158
static string Sch_NonDeterministicAnyEx
Definition SR.cs:586
static string Sch_NonDeterministicAnyAny
Definition SR.cs:588
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
void PushComplexType(XmlSchemaComplexType complexType)
void BuildParticleContentModel(ParticleContentValidator contentValidator, XmlSchemaParticle particle)

References System.Xml.Schema.SchemaCollectionCompiler._compileContentModel, System.Xml.Schema.XmlSchemaComplexType.AnyTypeContentValidator, System.Xml.Schema.SchemaCollectionCompiler.BuildParticleContentModel(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, System.Xml.Schema.ContentValidator.Empty, System.Xml.Schema.XmlSchemaParticle.Empty, System.Xml.Schema.ContentValidator.Mixed, System.Xml.Schema.SchemaCollectionCompiler.PushComplexType(), System.SR.Sch_ComplexContentModel, System.SR.Sch_DupElement, System.SR.Sch_NonDeterministic, System.SR.Sch_NonDeterministicAnyAny, System.SR.Sch_NonDeterministicAnyEx, System.Xml.Schema.BaseProcessor.SendValidationEvent(), and System.Xml.Schema.ContentValidator.TextOnly.

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