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

◆ CannonicalizeGroupRef()

XmlSchemaParticle System.Xml.Schema.Compiler.CannonicalizeGroupRef ( XmlSchemaGroupRef groupRef,
bool root )
inlineprivate

Definition at line 1157 of file Compiler.cs.

1158 {
1159 XmlSchemaGroup xmlSchemaGroup = ((groupRef.Redefined == null) ? ((XmlSchemaGroup)_groups[groupRef.RefName]) : groupRef.Redefined);
1160 if (xmlSchemaGroup == null)
1161 {
1163 return XmlSchemaParticle.Empty;
1164 }
1165 if (xmlSchemaGroup.CanonicalParticle == null)
1166 {
1168 }
1169 if (xmlSchemaGroup.CanonicalParticle == XmlSchemaParticle.Empty)
1170 {
1171 return XmlSchemaParticle.Empty;
1172 }
1173 XmlSchemaGroupBase xmlSchemaGroupBase = (XmlSchemaGroupBase)xmlSchemaGroup.CanonicalParticle;
1174 if (xmlSchemaGroupBase is XmlSchemaAll)
1175 {
1176 if (!root)
1177 {
1179 return XmlSchemaParticle.Empty;
1180 }
1181 if (groupRef.MinOccurs > 1m || groupRef.MaxOccurs != 1m)
1182 {
1184 return XmlSchemaParticle.Empty;
1185 }
1186 }
1187 else if (xmlSchemaGroupBase is XmlSchemaChoice && xmlSchemaGroupBase.Items.Count == 0)
1188 {
1189 if (groupRef.MinOccurs != 0m)
1190 {
1192 }
1193 return XmlSchemaParticle.Empty;
1194 }
1195 XmlSchemaGroupBase xmlSchemaGroupBase2 = ((xmlSchemaGroupBase is XmlSchemaSequence) ? new XmlSchemaSequence() : ((xmlSchemaGroupBase is XmlSchemaChoice) ? ((XmlSchemaGroupBase)new XmlSchemaChoice()) : ((XmlSchemaGroupBase)new XmlSchemaAll())));
1199 for (int i = 0; i < xmlSchemaGroupBase.Items.Count; i++)
1200 {
1202 }
1203 groupRef.SetParticle(xmlSchemaGroupBase2);
1204 return xmlSchemaGroupBase2;
1205 }
void Add(TKey key, TValue value)
static string Sch_UndefGroupRef
Definition SR.cs:1032
static string Sch_AllRefMinMax
Definition SR.cs:1038
static string Sch_EmptyChoice
Definition SR.cs:1142
static string Sch_AllRefNotRoot
Definition SR.cs:1036
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
readonly XmlSchemaObjectTable _groups
Definition Compiler.cs:20
void CopyPosition(XmlSchemaAnnotated to, XmlSchemaAnnotated from, bool copyParent)
Definition Compiler.cs:2758
void CompileGroup(XmlSchemaGroup group)
Definition Compiler.cs:542

References System.Xml.Schema.Compiler._groups, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Xml.Schema.Compiler.CompileGroup(), System.Xml.Schema.Compiler.CopyPosition(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, System.Xml.Schema.XmlSchemaParticle.Empty, System.SR.Sch_AllRefMinMax, System.SR.Sch_AllRefNotRoot, System.SR.Sch_EmptyChoice, System.SR.Sch_UndefGroupRef, and System.Xml.Schema.BaseProcessor.SendValidationEvent().

Referenced by System.Xml.Schema.Compiler.CannonicalizeParticle().