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

◆ CannonicalizeGroupRef()

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

Definition at line 1025 of file SchemaCollectionCompiler.cs.

1026 {
1027 XmlSchemaGroup xmlSchemaGroup = ((groupRef.Redefined == null) ? ((XmlSchemaGroup)_schema.Groups[groupRef.RefName]) : groupRef.Redefined);
1028 if (xmlSchemaGroup == null)
1029 {
1031 return XmlSchemaParticle.Empty;
1032 }
1033 if (xmlSchemaGroup.CanonicalParticle == null)
1034 {
1036 }
1037 if (xmlSchemaGroup.CanonicalParticle == XmlSchemaParticle.Empty)
1038 {
1039 return XmlSchemaParticle.Empty;
1040 }
1041 XmlSchemaGroupBase xmlSchemaGroupBase = (XmlSchemaGroupBase)xmlSchemaGroup.CanonicalParticle;
1042 if (xmlSchemaGroupBase is XmlSchemaAll)
1043 {
1044 if (!root)
1045 {
1047 return XmlSchemaParticle.Empty;
1048 }
1049 if (groupRef.MinOccurs != 1m || groupRef.MaxOccurs != 1m)
1050 {
1052 return XmlSchemaParticle.Empty;
1053 }
1054 }
1055 else if (xmlSchemaGroupBase is XmlSchemaChoice && xmlSchemaGroupBase.Items.Count == 0)
1056 {
1057 if (groupRef.MinOccurs != 0m)
1058 {
1060 }
1061 return XmlSchemaParticle.Empty;
1062 }
1063 XmlSchemaGroupBase xmlSchemaGroupBase2 = ((xmlSchemaGroupBase is XmlSchemaSequence) ? new XmlSchemaSequence() : ((xmlSchemaGroupBase is XmlSchemaChoice) ? ((XmlSchemaGroupBase)new XmlSchemaChoice()) : ((XmlSchemaGroupBase)new XmlSchemaAll())));
1066 for (int i = 0; i < xmlSchemaGroupBase.Items.Count; i++)
1067 {
1068 xmlSchemaGroupBase2.Items.Add((XmlSchemaParticle)xmlSchemaGroupBase.Items[i]);
1069 }
1070 groupRef.SetParticle(xmlSchemaGroupBase2);
1071 return xmlSchemaGroupBase2;
1072 }
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)
XmlSchemaObjectTable Groups
Definition XmlSchema.cs:307

References System.Xml.Schema.SchemaCollectionCompiler._schema, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Xml.Schema.SchemaCollectionCompiler.CompileGroup(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, System.Xml.Schema.XmlSchemaParticle.Empty, System.Xml.Schema.XmlSchema.Groups, 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.SchemaCollectionCompiler.CannonicalizeParticle().