Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Compiler.cs
Go to the documentation of this file.
5
6namespace System.Xml.Schema;
7
8internal sealed class Compiler : BaseProcessor
9{
10 private string _restrictionErrorMsg;
11
13
15
17
19
21
23
25
27
29
30 private readonly Hashtable _schemasToCompile = new Hashtable();
31
32 private readonly XmlSchema _schemaForSchema;
33
39
53
54 internal void Prepare(XmlSchema schema, bool cleanup)
55 {
56 if (_schemasToCompile[schema] != null)
57 {
58 return;
59 }
61 foreach (XmlSchemaElement value in schema.Elements.Values)
62 {
63 if (cleanup)
64 {
66 }
67 AddToTable(_elements, value.QualifiedName, value);
68 }
69 foreach (XmlSchemaAttribute value2 in schema.Attributes.Values)
70 {
71 if (cleanup)
72 {
74 }
75 AddToTable(_attributes, value2.QualifiedName, value2);
76 }
77 foreach (XmlSchemaGroup value3 in schema.Groups.Values)
78 {
79 if (cleanup)
80 {
82 }
83 AddToTable(_groups, value3.QualifiedName, value3);
84 }
85 foreach (XmlSchemaAttributeGroup value4 in schema.AttributeGroups.Values)
86 {
87 if (cleanup)
88 {
90 }
92 }
93 foreach (XmlSchemaType value5 in schema.SchemaTypes.Values)
94 {
95 if (cleanup)
96 {
98 {
100 }
101 else
102 {
104 }
105 }
106 AddToTable(_schemaTypes, value5.QualifiedName, value5);
107 }
108 foreach (XmlSchemaNotation value6 in schema.Notations.Values)
109 {
110 AddToTable(_notations, value6.QualifiedName, value6);
111 }
112 foreach (XmlSchemaIdentityConstraint value7 in schema.IdentityConstraints.Values)
113 {
115 }
116 }
117
129
130 private void Output(SchemaInfo schemaInfo)
131 {
133 {
134 string text = value.TargetNamespace;
135 if (text == null)
136 {
137 text = string.Empty;
138 }
139 schemaInfo.TargetNamespaces[text] = true;
140 }
142 {
143 schemaInfo.ElementDecls.Add(value2.QualifiedName, value2.ElementDecl);
144 }
146 {
147 schemaInfo.AttributeDecls.Add(value3.QualifiedName, value3.AttDef);
148 }
150 {
151 schemaInfo.ElementDeclsByType.Add(value4.QualifiedName, value4.ElementDecl);
152 }
154 {
158 if (!schemaInfo.Notations.ContainsKey(schemaNotation.Name.Name))
159 {
160 schemaInfo.Notations.Add(schemaNotation.Name.Name, schemaNotation);
161 }
162 }
163 }
164
166 {
167 SortedList sortedSchemas = schemaSet.SortedSchemas;
168 for (int i = 0; i < sortedSchemas.Count; i++)
169 {
171 if (xmlSchema.IsCompiledBySet)
172 {
173 Prepare(xmlSchema, cleanup: false);
174 }
175 }
176 }
177
178 internal bool Compile()
179 {
181 if (_schemaForSchema != null)
182 {
185 }
187 {
189 }
191 {
193 }
195 {
197 {
199 }
200 else
201 {
203 }
204 }
206 {
207 if (value4.ElementDecl == null)
208 {
210 }
211 }
213 {
214 if (value5.AttDef == null)
215 {
217 }
218 }
220 {
221 if (value6.CompiledConstraint == null)
222 {
224 }
225 }
226 while (_complexTypeStack.Count > 0)
227 {
230 }
233 {
235 {
237 }
238 }
240 {
241 if (value8.ElementSchemaType is XmlSchemaComplexType complexType4 && value8.SchemaTypeName == XmlQualifiedName.Empty)
242 {
244 }
245 }
247 {
248 XmlSchemaGroup redefined = value9.Redefined;
249 if (redefined != null)
250 {
252 }
253 }
255 {
257 if (redefined2 != null)
258 {
260 }
261 }
262 return !base.HasErrors;
263 }
264
266 {
267 if (attribute.SchemaType != null)
268 {
269 CleanupSimpleType(attribute.SchemaType);
270 }
271 attribute.AttDef = null;
272 }
273
275 {
277 attributeGroup.AttributeUses.Clear();
279 if (attributeGroup.Redefined != null)
280 {
282 }
283 }
284
286 {
287 if (complexType.QualifiedName == DatatypeImplementation.QnAnyType)
288 {
289 return;
290 }
291 if (complexType.ContentModel != null)
292 {
293 if (complexType.ContentModel is XmlSchemaSimpleContent)
294 {
297 {
300 }
301 else
302 {
305 }
306 }
307 else
308 {
311 {
315 }
316 else
317 {
321 }
322 }
323 }
324 else
325 {
327 CleanupAttributes(complexType.Attributes);
328 }
329 complexType.LocalElements.Clear();
330 complexType.AttributeUses.Clear();
331 complexType.SetAttributeWildcard(null);
332 complexType.SetContentTypeParticle(XmlSchemaParticle.Empty);
335 if (complexType.Redefined != null)
336 {
338 }
339 }
340
342 {
344 {
346 if (simpleType.Redefined != null)
347 {
349 }
350 }
351 }
352
353 private void CleanupElement(XmlSchemaElement element)
354 {
355 if (element.SchemaType != null)
356 {
358 {
360 }
361 else
362 {
364 }
365 }
366 for (int i = 0; i < element.Constraints.Count; i++)
367 {
368 ((XmlSchemaIdentityConstraint)element.Constraints[i]).CompiledConstraint = null;
369 }
370 element.ElementDecl = null;
372 }
373
375 {
376 for (int i = 0; i < attributes.Count; i++)
377 {
378 if (attributes[i] is XmlSchemaAttribute attribute)
379 {
381 }
382 }
383 }
384
386 {
387 CleanupParticle(group.Particle);
389 if (group.Redefined != null)
390 {
391 CleanupGroup(group.Redefined);
392 }
393 }
394
395 private void CleanupParticle(XmlSchemaParticle particle)
396 {
397 if (particle is XmlSchemaElement element)
398 {
399 CleanupElement(element);
400 }
401 else if (particle is XmlSchemaGroupBase xmlSchemaGroupBase)
402 {
403 for (int i = 0; i < xmlSchemaGroupBase.Items.Count; i++)
404 {
406 }
407 }
408 }
409
411 {
413 {
414 if (value.SubstitutionGroup.IsEmpty)
415 {
416 continue;
417 }
418 if (!(_elements[value.SubstitutionGroup] is XmlSchemaElement xmlSchemaElement2))
419 {
421 continue;
422 }
423 if (!XmlSchemaType.IsDerivedFrom(value.ElementSchemaType, xmlSchemaElement2.ElementSchemaType, xmlSchemaElement2.FinalResolved))
424 {
425 SendValidationEvent(System.SR.Sch_InvalidSubstitutionMember, value.QualifiedName.ToString(), xmlSchemaElement2.QualifiedName.ToString(), value);
426 }
428 if (xmlSchemaSubstitutionGroup == null)
429 {
431 xmlSchemaSubstitutionGroup.Examplar = value.SubstitutionGroup;
433 }
435 if (!members.Contains(value))
436 {
438 }
439 }
441 {
443 }
444 }
445
447 {
448 if (substitutionGroup.IsProcessing && substitutionGroup.Members.Count > 0)
449 {
451 return;
452 }
455 {
456 return;
457 }
459 try
460 {
461 if (xmlSchemaElement.FinalResolved == XmlSchemaDerivationMethod.All)
462 {
464 }
465 ArrayList arrayList = null;
466 for (int i = 0; i < substitutionGroup.Members.Count; i++)
467 {
469 if ((xmlSchemaElement2.ElementDecl.Block & XmlSchemaDerivationMethod.Substitution) != 0)
470 {
471 continue;
472 }
474 if (xmlSchemaSubstitutionGroup == null)
475 {
476 continue;
477 }
479 for (int j = 0; j < xmlSchemaSubstitutionGroup.Members.Count; j++)
480 {
482 {
483 if (arrayList == null)
484 {
485 arrayList = new ArrayList();
486 }
488 }
489 }
490 }
491 if (arrayList != null)
492 {
493 for (int k = 0; k < arrayList.Count; k++)
494 {
496 }
497 }
499 }
500 finally
501 {
503 }
504 }
505
507 {
508 if (baseGroup.Redefined != null)
509 {
511 }
512 if (redefinedGroup.SelfReferenceCount == 0)
513 {
514 if (baseGroup.CanonicalParticle == null)
515 {
517 }
518 if (redefinedGroup.CanonicalParticle == null)
519 {
521 }
522 CompileParticleElements(redefinedGroup.CanonicalParticle);
523 CompileParticleElements(baseGroup.CanonicalParticle);
524 CheckParticleDerivation(redefinedGroup.CanonicalParticle, baseGroup.CanonicalParticle);
525 }
526 }
527
541
543 {
544 if (group.IsProcessing)
545 {
548 return;
549 }
550 group.IsProcessing = true;
551 if (group.CanonicalParticle == null)
552 {
554 }
555 group.IsProcessing = false;
556 }
557
559 {
560 if (simpleType.IsProcessing)
561 {
563 }
564 if (simpleType.ElementDecl != null)
565 {
566 return;
567 }
569 try
570 {
572 {
575 XmlSchemaDatatype datatype;
576 if (xmlSchemaSimpleTypeList.ItemTypeName.IsEmpty)
577 {
580 datatype = xmlSchemaSimpleTypeList.ItemType.Datatype;
581 }
582 else
583 {
585 if (simpleType2 == null)
586 {
588 }
589 if ((simpleType2.FinalResolved & XmlSchemaDerivationMethod.List) != 0)
590 {
592 }
594 datatype = simpleType2.Datatype;
595 }
596 simpleType.SetDatatype(datatype.DeriveByList(simpleType));
597 simpleType.SetDerivedBy(XmlSchemaDerivationMethod.List);
598 }
600 {
603 if (xmlSchemaSimpleTypeRestriction.BaseTypeName.IsEmpty)
604 {
606 simpleType.SetBaseSchemaType(xmlSchemaSimpleTypeRestriction.BaseType);
607 datatype2 = xmlSchemaSimpleTypeRestriction.BaseType.Datatype;
608 }
609 else if (simpleType.Redefined != null && xmlSchemaSimpleTypeRestriction.BaseTypeName == simpleType.Redefined.QualifiedName)
610 {
612 simpleType.SetBaseSchemaType(simpleType.Redefined.BaseXmlSchemaType);
613 datatype2 = simpleType.Redefined.Datatype;
614 }
615 else
616 {
618 {
620 if (parentSchema.TargetNamespace != "http://www.w3.org/2001/XMLSchema")
621 {
623 }
624 }
626 if (simpleType3 == null)
627 {
629 }
630 if ((simpleType3.FinalResolved & XmlSchemaDerivationMethod.Restriction) != 0)
631 {
633 }
634 simpleType.SetBaseSchemaType(simpleType3);
635 datatype2 = simpleType3.Datatype;
636 }
637 simpleType.SetDatatype(datatype2.DeriveByRestriction(xmlSchemaSimpleTypeRestriction.Facets, base.NameTable, simpleType));
638 simpleType.SetDerivedBy(XmlSchemaDerivationMethod.Restriction);
639 }
640 else
641 {
645 simpleType.SetDerivedBy(XmlSchemaDerivationMethod.Union);
646 }
647 }
648 catch (XmlSchemaException ex)
649 {
650 if (ex.SourceSchemaObject == null)
651 {
652 ex.SetSource(simpleType);
653 }
655 simpleType.SetDatatype(DatatypeImplementation.AnySimpleType.Datatype);
656 }
657 finally
658 {
665 }
666 }
667
669 {
673 if (memberTypes != null)
674 {
675 for (int i = 0; i < memberTypes.Length; i++)
676 {
678 if (simpleType2 != null)
679 {
680 if (simpleType2.Datatype.Variety == XmlSchemaDatatypeVariety.Union)
681 {
683 }
684 else
685 {
686 list.Add(simpleType2);
687 }
688 if ((simpleType2.FinalResolved & XmlSchemaDerivationMethod.Union) != 0)
689 {
691 }
692 continue;
693 }
695 }
696 }
698 if (baseTypes != null)
699 {
700 for (int j = 0; j < baseTypes.Count; j++)
701 {
704 if (xmlSchemaSimpleType.Datatype.Variety == XmlSchemaDatatypeVariety.Union)
705 {
707 }
708 else
709 {
711 }
712 }
713 }
714 xmlSchemaSimpleTypeUnion.SetBaseMemberTypes(list.ToArray());
715 return xmlSchemaSimpleTypeUnion.BaseMemberTypes;
716 }
717
729
731 {
732 if (complexType.ElementDecl != null)
733 {
734 return;
735 }
736 if (complexType.IsProcessing)
737 {
739 return;
740 }
742 try
743 {
744 if (complexType.ContentModel != null)
745 {
746 if (complexType.ContentModel is XmlSchemaSimpleContent)
747 {
749 complexType.SetContentType(XmlSchemaContentType.TextOnly);
751 {
753 }
754 else
755 {
757 }
758 }
759 else
760 {
763 {
765 }
766 else
767 {
769 }
770 }
771 }
772 else
773 {
774 complexType.SetBaseSchemaType(XmlSchemaComplexType.AnyType);
776 complexType.SetDerivedBy(XmlSchemaDerivationMethod.Restriction);
777 complexType.SetContentTypeParticle(CompileContentTypeParticle(complexType.Particle));
778 complexType.SetContentType(GetSchemaContentType(complexType, null, complexType.ContentTypeParticle));
779 }
780 if (complexType.ContainsIdAttribute(findAll: true))
781 {
783 }
789 schemaElementDecl.Block = complexType.BlockResolved;
791 foreach (XmlSchemaAttribute value in complexType.AttributeUses.Values)
792 {
793 if (value.Use == XmlSchemaUse.Prohibited)
794 {
795 if (!schemaElementDecl.ProhibitedAttributes.ContainsKey(value.QualifiedName))
796 {
797 schemaElementDecl.ProhibitedAttributes.Add(value.QualifiedName, value.QualifiedName);
798 }
799 }
800 else if (!schemaElementDecl.AttDefs.ContainsKey(value.QualifiedName) && value.AttDef != null && value.AttDef.Name != XmlQualifiedName.Empty && value.AttDef != SchemaAttDef.Empty)
801 {
802 schemaElementDecl.AddAttDef(value.AttDef);
803 }
804 }
806 }
807 finally
808 {
810 }
811 }
812
814 {
816 if (complexType.Redefined != null && simpleExtension.BaseTypeName == complexType.Redefined.QualifiedName)
817 {
820 complexType.SetBaseSchemaType(xmlSchemaComplexType);
821 complexType.SetDatatype(xmlSchemaComplexType.Datatype);
822 }
823 else
824 {
826 if (anySchemaType == null)
827 {
829 }
830 else
831 {
832 complexType.SetBaseSchemaType(anySchemaType);
833 complexType.SetDatatype(anySchemaType.Datatype);
834 }
836 }
837 if (xmlSchemaComplexType != null)
838 {
839 if ((xmlSchemaComplexType.FinalResolved & XmlSchemaDerivationMethod.Extension) != 0)
840 {
842 }
843 if (xmlSchemaComplexType.ContentType != 0)
844 {
846 }
847 }
848 complexType.SetDerivedBy(XmlSchemaDerivationMethod.Extension);
850 }
851
853 {
856 if (complexType.Redefined != null && simpleRestriction.BaseTypeName == complexType.Redefined.QualifiedName)
857 {
861 }
862 else
863 {
865 if (xmlSchemaComplexType == null)
866 {
868 return;
869 }
870 if (xmlSchemaComplexType.ContentType == XmlSchemaContentType.TextOnly)
871 {
872 if (simpleRestriction.BaseType == null)
873 {
875 }
876 else
877 {
880 {
882 }
883 xmlSchemaDatatype = simpleRestriction.BaseType.Datatype;
884 }
885 }
886 else if (xmlSchemaComplexType.ContentType == XmlSchemaContentType.Mixed && xmlSchemaComplexType.ElementDecl.ContentValidator.IsEmptiable)
887 {
888 if (simpleRestriction.BaseType != null)
889 {
891 complexType.SetBaseSchemaType(simpleRestriction.BaseType);
892 xmlSchemaDatatype = simpleRestriction.BaseType.Datatype;
893 }
894 else
895 {
897 }
898 }
899 else
900 {
902 }
903 }
904 if (xmlSchemaComplexType != null && xmlSchemaComplexType.ElementDecl != null && (xmlSchemaComplexType.FinalResolved & XmlSchemaDerivationMethod.Restriction) != 0)
905 {
907 }
908 if (xmlSchemaComplexType != null)
909 {
910 complexType.SetBaseSchemaType(xmlSchemaComplexType);
911 }
912 if (xmlSchemaDatatype != null)
913 {
914 try
915 {
916 complexType.SetDatatype(xmlSchemaDatatype.DeriveByRestriction(simpleRestriction.Facets, base.NameTable, complexType));
917 }
918 catch (XmlSchemaException ex)
919 {
920 if (ex.SourceSchemaObject == null)
921 {
922 ex.SetSource(complexType);
923 }
926 }
927 }
928 complexType.SetDerivedBy(XmlSchemaDerivationMethod.Restriction);
930 }
931
933 {
935 if (complexType.Redefined != null && complexExtension.BaseTypeName == complexType.Redefined.QualifiedName)
936 {
939 }
940 else
941 {
943 if (xmlSchemaComplexType == null)
944 {
946 return;
947 }
948 }
949 if ((xmlSchemaComplexType.FinalResolved & XmlSchemaDerivationMethod.Extension) != 0)
950 {
952 }
957 {
959 {
964 }
965 else
966 {
967 complexType.SetContentTypeParticle(contentTypeParticle);
968 }
969 }
970 else
971 {
972 complexType.SetContentTypeParticle(xmlSchemaParticle);
973 }
976 {
979 {
980 complexType.SetDatatype(xmlSchemaComplexType.Datatype);
981 }
982 }
983 complexType.SetContentType(xmlSchemaContentType);
984 if (xmlSchemaComplexType.ContentType != XmlSchemaContentType.Empty && complexType.ContentType != xmlSchemaComplexType.ContentType)
985 {
987 return;
988 }
989 complexType.SetBaseSchemaType(xmlSchemaComplexType);
990 complexType.SetDerivedBy(XmlSchemaDerivationMethod.Extension);
991 }
992
994 {
996 if (complexType.Redefined != null && complexRestriction.BaseTypeName == complexType.Redefined.QualifiedName)
997 {
1000 }
1001 else
1002 {
1004 if (xmlSchemaComplexType == null)
1005 {
1007 return;
1008 }
1009 }
1010 complexType.SetBaseSchemaType(xmlSchemaComplexType);
1011 if ((xmlSchemaComplexType.FinalResolved & XmlSchemaDerivationMethod.Restriction) != 0)
1012 {
1014 }
1016 complexType.SetContentTypeParticle(CompileContentTypeParticle(complexRestriction.Particle));
1018 complexType.SetContentType(schemaContentType);
1019 switch (schemaContentType)
1020 {
1021 case XmlSchemaContentType.Empty:
1022 if (xmlSchemaComplexType.ElementDecl != null && !xmlSchemaComplexType.ElementDecl.ContentValidator.IsEmptiable)
1023 {
1025 }
1026 break;
1027 case XmlSchemaContentType.Mixed:
1028 if (xmlSchemaComplexType.ContentType != XmlSchemaContentType.Mixed)
1029 {
1031 }
1032 break;
1033 }
1034 complexType.SetDerivedBy(XmlSchemaDerivationMethod.Restriction);
1035 }
1036
1073
1091
1105
1107 {
1108 if (particle == null || particle.IsEmpty)
1109 {
1110 return XmlSchemaParticle.Empty;
1111 }
1112 if (particle is XmlSchemaElement)
1113 {
1114 return particle;
1115 }
1116 if (particle is XmlSchemaGroupRef)
1117 {
1118 return CannonicalizeGroupRef((XmlSchemaGroupRef)particle, root);
1119 }
1120 if (particle is XmlSchemaAll)
1121 {
1122 return CannonicalizeAll((XmlSchemaAll)particle, root);
1123 }
1124 if (particle is XmlSchemaChoice)
1125 {
1126 return CannonicalizeChoice((XmlSchemaChoice)particle, root);
1127 }
1128 if (particle is XmlSchemaSequence)
1129 {
1130 return CannonicalizeSequence((XmlSchemaSequence)particle, root);
1131 }
1132 return particle;
1133 }
1134
1136 {
1137 if (!element.RefName.IsEmpty && (element.ElementDecl.Block & XmlSchemaDerivationMethod.Substitution) == 0)
1138 {
1140 if (xmlSchemaSubstitutionGroup == null)
1141 {
1142 return element;
1143 }
1145 for (int i = 0; i < xmlSchemaSubstitutionGroup.Members.Count; i++)
1146 {
1148 }
1151 CopyPosition(xmlSchemaChoice, element, copyParent: false);
1152 return xmlSchemaChoice;
1153 }
1154 return element;
1155 }
1156
1158 {
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 }
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 }
1188 {
1189 if (groupRef.MinOccurs != 0m)
1190 {
1192 }
1193 return XmlSchemaParticle.Empty;
1194 }
1199 for (int i = 0; i < xmlSchemaGroupBase.Items.Count; i++)
1200 {
1202 }
1203 groupRef.SetParticle(xmlSchemaGroupBase2);
1204 return xmlSchemaGroupBase2;
1205 }
1206
1208 {
1209 if (all.Items.Count > 0)
1210 {
1212 xmlSchemaAll.MinOccurs = all.MinOccurs;
1213 xmlSchemaAll.MaxOccurs = all.MaxOccurs;
1215 for (int i = 0; i < all.Items.Count; i++)
1216 {
1219 {
1221 }
1222 }
1223 all = xmlSchemaAll;
1224 }
1225 if (all.Items.Count == 0)
1226 {
1227 return XmlSchemaParticle.Empty;
1228 }
1229 if (!root)
1230 {
1232 return XmlSchemaParticle.Empty;
1233 }
1234 return all;
1235 }
1236
1238 {
1240 if (choice.Items.Count > 0)
1241 {
1246 for (int i = 0; i < choice.Items.Count; i++)
1247 {
1250 {
1251 continue;
1252 }
1253 if (xmlSchemaParticle.MinOccurs == 1m && xmlSchemaParticle.MaxOccurs == 1m && xmlSchemaParticle is XmlSchemaChoice)
1254 {
1256 for (int j = 0; j < xmlSchemaChoice2.Items.Count; j++)
1257 {
1258 xmlSchemaChoice.Items.Add(xmlSchemaChoice2.Items[j]);
1259 }
1260 }
1261 else
1262 {
1264 }
1265 }
1267 }
1268 if (!root && choice.Items.Count == 0)
1269 {
1270 if (choice.MinOccurs != 0m)
1271 {
1273 }
1274 return XmlSchemaParticle.Empty;
1275 }
1276 if (!root && choice.Items.Count == 1 && choice.MinOccurs == 1m && choice.MaxOccurs == 1m)
1277 {
1278 return (XmlSchemaParticle)choice.Items[0];
1279 }
1280 return choice;
1281 }
1282
1284 {
1285 if (sequence.Items.Count > 0)
1286 {
1291 for (int i = 0; i < sequence.Items.Count; i++)
1292 {
1295 {
1296 continue;
1297 }
1299 if (xmlSchemaParticle.MinOccurs == 1m && xmlSchemaParticle.MaxOccurs == 1m && xmlSchemaSequence2 != null)
1300 {
1301 for (int j = 0; j < xmlSchemaSequence2.Items.Count; j++)
1302 {
1304 }
1305 }
1306 else
1307 {
1309 }
1310 }
1312 }
1313 if (sequence.Items.Count == 0)
1314 {
1315 return XmlSchemaParticle.Empty;
1316 }
1317 if (!root && sequence.Items.Count == 1 && sequence.MinOccurs == 1m && sequence.MaxOccurs == 1m)
1318 {
1319 return (XmlSchemaParticle)sequence.Items[0];
1320 }
1321 return sequence;
1322 }
1323
1324 [return: NotNullIfNotNull("particle")]
1326 {
1327 if (particle == null)
1328 {
1329 return null;
1330 }
1331 decimal num = 1m;
1333 {
1335 int count = items.Count;
1336 if (count == 1 && xmlSchemaSequence.MinOccurs == num && xmlSchemaSequence.MaxOccurs == num)
1337 {
1338 return (XmlSchemaParticle)items[0];
1339 }
1340 }
1341 else if (particle is XmlSchemaChoice xmlSchemaChoice)
1342 {
1344 switch (items2.Count)
1345 {
1346 case 1:
1347 if (xmlSchemaChoice.MinOccurs == num && xmlSchemaChoice.MaxOccurs == num)
1348 {
1349 return (XmlSchemaParticle)items2[0];
1350 }
1351 break;
1352 case 0:
1353 return XmlSchemaParticle.Empty;
1354 }
1355 }
1356 else if (particle is XmlSchemaAll xmlSchemaAll)
1357 {
1359 int count2 = items3.Count;
1360 if (count2 == 1 && xmlSchemaAll.MinOccurs == num && xmlSchemaAll.MaxOccurs == num)
1361 {
1362 return (XmlSchemaParticle)items3[0];
1363 }
1364 }
1365 return particle;
1366 }
1367
1369 {
1371 {
1372 return true;
1373 }
1375 {
1377 }
1379 {
1380 return false;
1381 }
1383 {
1386 }
1388 {
1392 {
1394 }
1396 {
1398 }
1400 return false;
1401 }
1403 {
1405 {
1407 }
1409 {
1411 }
1413 }
1415 {
1417 {
1419 }
1421 {
1423 {
1424 return true;
1425 }
1426 }
1428 {
1430 {
1431 return true;
1432 }
1434 }
1436 {
1438 }
1439 return false;
1440 }
1442 {
1444 {
1446 }
1448 {
1451 if (xmlSchemaChoice.Parent == null || xmlSchemaChoice2.Parent == null)
1452 {
1454 }
1456 {
1457 return true;
1458 }
1459 }
1461 {
1463 {
1464 return true;
1465 }
1467 }
1468 else
1469 {
1471 }
1472 return false;
1473 }
1475 {
1477 {
1479 }
1481 {
1483 {
1484 return true;
1485 }
1486 }
1487 else
1488 {
1490 }
1491 return false;
1492 }
1493 return false;
1494 }
1495
1497 {
1501 {
1503 return false;
1504 }
1505 return true;
1506 }
1507
1509 {
1510 if (!baseAny.Allows(derivedElement.QualifiedName))
1511 {
1513 return false;
1514 }
1516 {
1518 return false;
1519 }
1520 return true;
1521 }
1522
1524 {
1526 {
1528 return false;
1529 }
1530 if (!NamespaceList.IsSubset(derivedAny.NamespaceList, baseAny.NamespaceList))
1531 {
1533 return false;
1534 }
1535 if (derivedAny.ProcessContentsCorrect < baseAny.ProcessContentsCorrect)
1536 {
1538 return false;
1539 }
1540 return true;
1541 }
1542
1565
1567 {
1569 {
1575 {
1576 return true;
1577 }
1579 }
1581 {
1587 {
1588 return true;
1589 }
1591 }
1592 else if (baseGroupBase is XmlSchemaAll)
1593 {
1599 {
1600 return true;
1601 }
1603 }
1604 return false;
1605 }
1606
1608 {
1610 {
1612 return false;
1613 }
1614 for (int i = 0; i < derivedChoice.Items.Count; i++)
1615 {
1617 {
1618 return false;
1619 }
1620 }
1621 return true;
1622 }
1623
1625 {
1627 {
1629 return false;
1630 }
1631 if (derivedGroupBase.Items.Count > baseGroupBase.Items.Count)
1632 {
1634 return false;
1635 }
1636 int num = 0;
1637 for (int i = 0; i < baseGroupBase.Items.Count; i++)
1638 {
1641 {
1642 num++;
1643 }
1645 {
1646 if (_restrictionErrorMsg == null)
1647 {
1649 }
1650 return false;
1651 }
1652 }
1653 if (num < derivedGroupBase.Items.Count)
1654 {
1655 return false;
1656 }
1657 return true;
1658 }
1659
1661 {
1663 {
1664 return false;
1665 }
1666 BitSet bitSet = new BitSet(baseAll.Items.Count);
1667 for (int i = 0; i < derivedSequence.Items.Count; i++)
1668 {
1670 if (mappingParticle >= 0)
1671 {
1673 {
1674 return false;
1675 }
1677 continue;
1678 }
1679 return false;
1680 }
1681 for (int j = 0; j < baseAll.Items.Count; j++)
1682 {
1684 {
1685 return false;
1686 }
1687 }
1688 return true;
1689 }
1690
1692 {
1693 decimal minOccurs = derivedSequence.MinOccurs * (decimal)derivedSequence.Items.Count;
1694 decimal maxOccurs = ((!(derivedSequence.MaxOccurs == decimal.MaxValue)) ? (derivedSequence.MaxOccurs * (decimal)derivedSequence.Items.Count) : decimal.MaxValue);
1696 {
1697 return false;
1698 }
1699 for (int i = 0; i < derivedSequence.Items.Count; i++)
1700 {
1702 {
1703 return false;
1704 }
1705 }
1706 return true;
1707 }
1708
1713
1715 {
1716 if (baseMinOccurs <= minOccurs)
1717 {
1718 return maxOccurs <= baseMaxOccurs;
1719 }
1720 return false;
1721 }
1722
1724 {
1725 for (int i = 0; i < collection.Count; i++)
1726 {
1728 {
1729 return i;
1730 }
1731 }
1732 return -1;
1733 }
1734
1736 {
1738 return minOccurs == 0m;
1739 }
1740
1742 {
1744 if (particle is XmlSchemaElement || particle is XmlSchemaAny)
1745 {
1746 minOccurs = particle.MinOccurs;
1747 maxOccurs = particle.MaxOccurs;
1748 return;
1749 }
1750 if (xmlSchemaChoice != null)
1751 {
1752 if (xmlSchemaChoice.Items.Count == 0)
1753 {
1754 minOccurs = (maxOccurs = 0m);
1755 return;
1756 }
1757 minOccurs = decimal.MaxValue;
1758 maxOccurs = default(decimal);
1759 for (int i = 0; i < xmlSchemaChoice.Items.Count; i++)
1760 {
1762 if (minOccurs2 < minOccurs)
1763 {
1765 }
1766 if (maxOccurs2 > maxOccurs)
1767 {
1769 }
1770 }
1771 minOccurs *= particle.MinOccurs;
1772 if (maxOccurs != decimal.MaxValue)
1773 {
1774 if (particle.MaxOccurs == decimal.MaxValue)
1775 {
1776 maxOccurs = decimal.MaxValue;
1777 }
1778 else
1779 {
1780 maxOccurs *= particle.MaxOccurs;
1781 }
1782 }
1783 return;
1784 }
1785 XmlSchemaObjectCollection items = ((XmlSchemaGroupBase)particle).Items;
1786 if (items.Count == 0)
1787 {
1788 minOccurs = (maxOccurs = 0m);
1789 return;
1790 }
1791 minOccurs = default(decimal);
1792 maxOccurs = default(decimal);
1793 for (int j = 0; j < items.Count; j++)
1794 {
1797 if (maxOccurs != decimal.MaxValue)
1798 {
1799 if (maxOccurs3 == decimal.MaxValue)
1800 {
1801 maxOccurs = decimal.MaxValue;
1802 }
1803 else
1804 {
1806 }
1807 }
1808 }
1809 minOccurs *= particle.MinOccurs;
1810 if (maxOccurs != decimal.MaxValue)
1811 {
1812 if (particle.MaxOccurs == decimal.MaxValue)
1813 {
1814 maxOccurs = decimal.MaxValue;
1815 }
1816 else
1817 {
1818 maxOccurs *= particle.MaxOccurs;
1819 }
1820 }
1821 }
1822
1827
1829 {
1830 if ((complexContent != null && complexContent.IsMixed) || (complexContent == null && complexType.IsMixed))
1831 {
1832 return XmlSchemaContentType.Mixed;
1833 }
1834 if (particle != null && !particle.IsEmpty)
1835 {
1836 return XmlSchemaContentType.ElementOnly;
1837 }
1838 return XmlSchemaContentType.Empty;
1839 }
1840
1842 {
1843 if (attributeGroup.IsProcessing)
1844 {
1846 }
1847 else
1848 {
1849 if (attributeGroup.AttributeUses.Count > 0)
1850 {
1851 return;
1852 }
1855 try
1856 {
1857 for (int i = 0; i < attributeGroup.Attributes.Count; i++)
1858 {
1860 {
1861 if (xmlSchemaAttribute.Use != XmlSchemaUse.Prohibited)
1862 {
1864 if (attributeGroup.AttributeUses[xmlSchemaAttribute.QualifiedName] == null)
1865 {
1866 attributeGroup.AttributeUses.Add(xmlSchemaAttribute.QualifiedName, xmlSchemaAttribute);
1867 }
1868 else
1869 {
1871 }
1872 }
1873 continue;
1874 }
1877 if (xmlSchemaAttributeGroup != null)
1878 {
1880 foreach (XmlSchemaAttribute value in xmlSchemaAttributeGroup.AttributeUses.Values)
1881 {
1882 if (attributeGroup.AttributeUses[value.QualifiedName] == null)
1883 {
1884 attributeGroup.AttributeUses.Add(value.QualifiedName, value);
1885 }
1886 else
1887 {
1888 SendValidationEvent(System.SR.Sch_DupAttributeUse, value.QualifiedName.ToString(), value);
1889 }
1890 }
1892 }
1893 else
1894 {
1896 }
1897 }
1899 }
1900 finally
1901 {
1903 }
1904 }
1905 }
1906
1908 {
1910 for (int i = 0; i < attributes.Count; i++)
1911 {
1912 if (attributes[i] is XmlSchemaAttribute xmlSchemaAttribute)
1913 {
1914 if (xmlSchemaAttribute.Use != XmlSchemaUse.Prohibited)
1915 {
1917 }
1919 {
1920 if (derivedType.AttributeUses[xmlSchemaAttribute.QualifiedName] == null)
1921 {
1922 derivedType.AttributeUses.Add(xmlSchemaAttribute.QualifiedName, xmlSchemaAttribute);
1923 }
1924 else
1925 {
1927 }
1928 }
1929 else
1930 {
1932 }
1933 continue;
1934 }
1937 if (xmlSchemaAttributeGroup != null)
1938 {
1940 foreach (XmlSchemaAttribute value in xmlSchemaAttributeGroup.AttributeUses.Values)
1941 {
1942 if (value.Use != XmlSchemaUse.Prohibited || (value.Use == XmlSchemaUse.Prohibited && derivedBy == XmlSchemaDerivationMethod.Restriction && baseType != XmlSchemaComplexType.AnyType))
1943 {
1944 if (derivedType.AttributeUses[value.QualifiedName] == null)
1945 {
1946 derivedType.AttributeUses.Add(value.QualifiedName, value);
1947 }
1948 else
1949 {
1951 }
1952 }
1953 else
1954 {
1955 SendValidationEvent(System.SR.Sch_AttributeIgnored, value.QualifiedName.ToString(), value, XmlSeverityType.Warning);
1956 }
1957 }
1959 }
1960 else
1961 {
1963 }
1964 }
1965 if (baseType != null)
1966 {
1967 if (derivedBy == XmlSchemaDerivationMethod.Extension)
1968 {
1970 {
1971 foreach (XmlSchemaAttribute value2 in baseType.AttributeUses.Values)
1972 {
1974 if (xmlSchemaAttribute4 == null)
1975 {
1976 derivedType.AttributeUses.Add(value2.QualifiedName, value2);
1977 }
1978 else if (value2.Use != XmlSchemaUse.Prohibited && xmlSchemaAttribute4.AttributeSchemaType != value2.AttributeSchemaType)
1979 {
1981 }
1982 }
1983 return;
1984 }
1985 }
1987 {
1989 }
1990 else
1991 {
1992 derivedType.SetAttributeWildcard(anyAttribute);
1993 }
1994 foreach (XmlSchemaAttribute value3 in baseType.AttributeUses.Values)
1995 {
1997 if (xmlSchemaAttribute6 == null)
1998 {
1999 derivedType.AttributeUses.Add(value3.QualifiedName, value3);
2000 }
2001 else if (value3.Use == XmlSchemaUse.Prohibited && xmlSchemaAttribute6.Use != XmlSchemaUse.Prohibited)
2002 {
2004 }
2005 else if (value3.Use == XmlSchemaUse.Required && xmlSchemaAttribute6.Use != XmlSchemaUse.Required)
2006 {
2008 }
2009 else if (xmlSchemaAttribute6.Use != XmlSchemaUse.Prohibited)
2010 {
2011 if (value3.AttributeSchemaType == null || xmlSchemaAttribute6.AttributeSchemaType == null || !XmlSchemaType.IsDerivedFrom(xmlSchemaAttribute6.AttributeSchemaType, value3.AttributeSchemaType, XmlSchemaDerivationMethod.Empty))
2012 {
2014 }
2015 else if (!IsFixedEqual(value3.AttDef, xmlSchemaAttribute6.AttDef))
2016 {
2018 }
2019 }
2020 }
2021 {
2022 foreach (XmlSchemaAttribute value4 in derivedType.AttributeUses.Values)
2023 {
2025 if (xmlSchemaAttribute8 == null && (xmlSchemaAnyAttribute == null || !xmlSchemaAnyAttribute.Allows(value4.QualifiedName)))
2026 {
2028 }
2029 }
2030 return;
2031 }
2032 }
2033 derivedType.SetAttributeWildcard(anyAttribute);
2034 }
2035
2037 {
2041 {
2043 }
2044 foreach (XmlSchemaAttribute value in baseAttributeGroup.AttributeUses.Values)
2045 {
2047 if (xmlSchemaAttribute2 != null)
2048 {
2049 if (value.Use == XmlSchemaUse.Prohibited && xmlSchemaAttribute2.Use != XmlSchemaUse.Prohibited)
2050 {
2052 }
2053 else if (value.Use == XmlSchemaUse.Required && xmlSchemaAttribute2.Use != XmlSchemaUse.Required)
2054 {
2056 }
2057 else if (xmlSchemaAttribute2.Use != XmlSchemaUse.Prohibited)
2058 {
2059 if (value.AttributeSchemaType == null || xmlSchemaAttribute2.AttributeSchemaType == null || !XmlSchemaType.IsDerivedFrom(xmlSchemaAttribute2.AttributeSchemaType, value.AttributeSchemaType, XmlSchemaDerivationMethod.Empty))
2060 {
2062 }
2063 else if (!IsFixedEqual(value.AttDef, xmlSchemaAttribute2.AttDef))
2064 {
2066 }
2067 }
2068 }
2069 else if (value.Use == XmlSchemaUse.Required)
2070 {
2071 SendValidationEvent(System.SR.Sch_NoDerivedAttribute, value.QualifiedName.ToString(), baseAttributeGroup.QualifiedName.ToString(), derivedAttributeGroup);
2072 }
2073 }
2074 foreach (XmlSchemaAttribute value2 in derivedAttributeGroup.AttributeUses.Values)
2075 {
2077 if (xmlSchemaAttribute4 == null && (attributeWildcard == null || !attributeWildcard.Allows(value2.QualifiedName)))
2078 {
2080 }
2081 }
2082 }
2083
2085 {
2087 {
2088 return true;
2089 }
2090 if (derivedAttributeWildcard.ProcessContentsCorrect >= baseAttributeWildcard.ProcessContentsCorrect)
2091 {
2092 return true;
2093 }
2094 return false;
2095 }
2096
2098 {
2099 if (a == null)
2100 {
2101 return b;
2102 }
2103 if (b == null)
2104 {
2105 return a;
2106 }
2108 if (xmlSchemaAnyAttribute == null)
2109 {
2111 }
2112 return xmlSchemaAnyAttribute;
2113 }
2114
2116 {
2117 if (a == null)
2118 {
2119 return b;
2120 }
2121 if (b == null)
2122 {
2123 return a;
2124 }
2126 if (xmlSchemaAnyAttribute == null)
2127 {
2129 }
2130 return xmlSchemaAnyAttribute;
2131 }
2132
2134 {
2135 if (xa.IsProcessing)
2136 {
2138 }
2139 else
2140 {
2141 if (xa.AttDef != null)
2142 {
2143 return;
2144 }
2145 xa.IsProcessing = true;
2147 try
2148 {
2149 if (!xa.RefName.IsEmpty)
2150 {
2152 if (xmlSchemaAttribute == null)
2153 {
2154 throw new XmlSchemaException(System.SR.Sch_UndeclaredAttribute, xa.RefName.ToString(), xa);
2155 }
2157 if (xmlSchemaAttribute.AttDef == null)
2158 {
2159 throw new XmlSchemaException(System.SR.Sch_RefInvalidAttribute, xa.RefName.ToString(), xa);
2160 }
2161 schemaAttDef = xmlSchemaAttribute.AttDef.Clone();
2162 XmlSchemaDatatype datatype = schemaAttDef.Datatype;
2163 if (datatype != null)
2164 {
2165 if (xmlSchemaAttribute.FixedValue == null && xmlSchemaAttribute.DefaultValue == null)
2166 {
2168 }
2169 else if (xmlSchemaAttribute.FixedValue != null)
2170 {
2171 if (xa.DefaultValue != null)
2172 {
2173 throw new XmlSchemaException(System.SR.Sch_FixedDefaultInRef, xa.RefName.ToString(), xa);
2174 }
2175 if (xa.FixedValue != null)
2176 {
2177 object o = datatype.ParseValue(xa.FixedValue, base.NameTable, new SchemaNamespaceManager(xa), createAtomicValue: true);
2178 if (!datatype.IsEqual(schemaAttDef.DefaultValueTyped, o))
2179 {
2180 throw new XmlSchemaException(System.SR.Sch_FixedInRef, xa.RefName.ToString(), xa);
2181 }
2182 }
2183 }
2184 }
2185 xa.SetAttributeType(xmlSchemaAttribute.AttributeSchemaType);
2186 }
2187 else
2188 {
2189 schemaAttDef = new SchemaAttDef(xa.QualifiedName);
2190 if (xa.SchemaType != null)
2191 {
2192 CompileSimpleType(xa.SchemaType);
2193 xa.SetAttributeType(xa.SchemaType);
2194 schemaAttDef.SchemaType = xa.SchemaType;
2195 schemaAttDef.Datatype = xa.SchemaType.Datatype;
2196 }
2197 else if (!xa.SchemaTypeName.IsEmpty)
2198 {
2200 if (simpleType == null)
2201 {
2202 throw new XmlSchemaException(System.SR.Sch_UndeclaredSimpleType, xa.SchemaTypeName.ToString(), xa);
2203 }
2204 xa.SetAttributeType(simpleType);
2207 }
2208 else
2209 {
2212 xa.SetAttributeType(DatatypeImplementation.AnySimpleType);
2213 }
2214 if (schemaAttDef.Datatype != null)
2215 {
2216 schemaAttDef.Datatype.VerifySchemaValid(_notations, xa);
2217 }
2219 }
2222 }
2223 catch (XmlSchemaException ex)
2224 {
2225 if (ex.SourceSchemaObject == null)
2226 {
2227 ex.SetSource(xa);
2228 }
2231 }
2232 finally
2233 {
2234 xa.IsProcessing = false;
2235 }
2236 }
2237 }
2238
2240 {
2241 if (xa.DefaultValue != null || xa.FixedValue != null)
2242 {
2243 if (xa.DefaultValue != null)
2244 {
2246 string defaultValueRaw = (decl.DefaultValueExpanded = xa.DefaultValue);
2247 decl.DefaultValueRaw = defaultValueRaw;
2248 }
2249 else
2250 {
2251 if (xa.Use == XmlSchemaUse.Required)
2252 {
2253 decl.Presence = SchemaDeclBase.Use.RequiredFixed;
2254 }
2255 else
2256 {
2258 }
2259 string defaultValueRaw = (decl.DefaultValueExpanded = xa.FixedValue);
2260 decl.DefaultValueRaw = defaultValueRaw;
2261 }
2262 if (decl.Datatype != null)
2263 {
2264 if (decl.Datatype.TypeCode == XmlTypeCode.Id)
2265 {
2267 }
2268 else
2269 {
2270 decl.DefaultValueTyped = decl.Datatype.ParseValue(decl.DefaultValueRaw, base.NameTable, new SchemaNamespaceManager(xa), createAtomicValue: true);
2271 }
2272 }
2273 }
2274 else
2275 {
2276 switch (xa.Use)
2277 {
2278 case XmlSchemaUse.None:
2279 case XmlSchemaUse.Optional:
2281 break;
2282 case XmlSchemaUse.Required:
2283 decl.Presence = SchemaDeclBase.Use.Required;
2284 break;
2285 case XmlSchemaUse.Prohibited:
2286 break;
2287 }
2288 }
2289 }
2290
2292 {
2293 if (xi.IsProcessing)
2294 {
2297 }
2298 else
2299 {
2300 if (xi.CompiledConstraint != null)
2301 {
2302 return;
2303 }
2304 xi.IsProcessing = true;
2306 try
2307 {
2310 if (xi is XmlSchemaKeyref)
2311 {
2313 if (xmlSchemaIdentityConstraint == null)
2314 {
2316 }
2318 if (xmlSchemaIdentityConstraint.CompiledConstraint == null)
2319 {
2321 }
2322 if (xmlSchemaIdentityConstraint.Fields.Count != xi.Fields.Count)
2323 {
2324 throw new XmlSchemaException(System.SR.Sch_RefInvalidCardin, xi.QualifiedName.ToString(), xi);
2325 }
2326 if (xmlSchemaIdentityConstraint.CompiledConstraint.Role == CompiledIdentityConstraint.ConstraintRole.Keyref)
2327 {
2328 throw new XmlSchemaException(System.SR.Sch_ReftoKeyref, xi.QualifiedName.ToString(), xi);
2329 }
2330 }
2332 }
2333 catch (XmlSchemaException ex)
2334 {
2335 if (ex.SourceSchemaObject == null)
2336 {
2337 ex.SetSource(xi);
2338 }
2341 }
2342 finally
2343 {
2344 xi.IsProcessing = false;
2345 }
2346 }
2347 }
2348
2350 {
2351 if (xe.IsProcessing)
2352 {
2354 }
2355 else
2356 {
2357 if (xe.ElementDecl != null)
2358 {
2359 return;
2360 }
2361 xe.IsProcessing = true;
2363 try
2364 {
2365 if (!xe.RefName.IsEmpty)
2366 {
2368 if (xmlSchemaElement == null)
2369 {
2370 throw new XmlSchemaException(System.SR.Sch_UndeclaredElement, xe.RefName.ToString(), xe);
2371 }
2373 if (xmlSchemaElement.ElementDecl == null)
2374 {
2375 throw new XmlSchemaException(System.SR.Sch_RefInvalidElement, xe.RefName.ToString(), xe);
2376 }
2377 xe.SetElementType(xmlSchemaElement.ElementSchemaType);
2378 schemaElementDecl = xmlSchemaElement.ElementDecl.Clone();
2379 }
2380 else
2381 {
2382 if (xe.SchemaType != null)
2383 {
2384 xe.SetElementType(xe.SchemaType);
2385 }
2386 else if (!xe.SchemaTypeName.IsEmpty)
2387 {
2388 xe.SetElementType(GetAnySchemaType(xe.SchemaTypeName));
2389 if (xe.ElementSchemaType == null)
2390 {
2391 throw new XmlSchemaException(System.SR.Sch_UndeclaredType, xe.SchemaTypeName.ToString(), xe);
2392 }
2393 }
2394 else if (!xe.SubstitutionGroup.IsEmpty)
2395 {
2397 if (xmlSchemaElement2 == null)
2398 {
2399 throw new XmlSchemaException(System.SR.Sch_UndeclaredEquivClass, xe.SubstitutionGroup.Name, xe);
2400 }
2401 if (xmlSchemaElement2.IsProcessing)
2402 {
2403 return;
2404 }
2406 if (xmlSchemaElement2.ElementDecl == null)
2407 {
2408 xe.SetElementType(XmlSchemaComplexType.AnyType);
2409 schemaElementDecl = XmlSchemaComplexType.AnyType.ElementDecl.Clone();
2410 }
2411 else
2412 {
2413 xe.SetElementType(xmlSchemaElement2.ElementSchemaType);
2414 schemaElementDecl = xmlSchemaElement2.ElementDecl.Clone();
2415 }
2416 }
2417 else
2418 {
2419 xe.SetElementType(XmlSchemaComplexType.AnyType);
2420 schemaElementDecl = XmlSchemaComplexType.AnyType.ElementDecl.Clone();
2421 }
2422 if (schemaElementDecl == null)
2423 {
2424 if (xe.ElementSchemaType is XmlSchemaComplexType)
2425 {
2428 if (xmlSchemaComplexType.ElementDecl != null)
2429 {
2430 schemaElementDecl = xmlSchemaComplexType.ElementDecl.Clone();
2431 }
2432 }
2433 else if (xe.ElementSchemaType is XmlSchemaSimpleType)
2434 {
2437 if (xmlSchemaSimpleType.ElementDecl != null)
2438 {
2439 schemaElementDecl = xmlSchemaSimpleType.ElementDecl.Clone();
2440 }
2441 }
2442 }
2443 schemaElementDecl.Name = xe.QualifiedName;
2444 schemaElementDecl.IsAbstract = xe.IsAbstract;
2445 if (xe.ElementSchemaType is XmlSchemaComplexType xmlSchemaComplexType2)
2446 {
2448 }
2449 schemaElementDecl.IsNillable = xe.IsNillable;
2450 schemaElementDecl.Block |= xe.BlockResolved;
2451 }
2452 if (schemaElementDecl.Datatype != null)
2453 {
2454 schemaElementDecl.Datatype.VerifySchemaValid(_notations, xe);
2455 }
2456 if ((xe.DefaultValue != null || xe.FixedValue != null) && schemaElementDecl.ContentValidator != null)
2457 {
2458 if (schemaElementDecl.ContentValidator.ContentType != 0 && (schemaElementDecl.ContentValidator.ContentType != XmlSchemaContentType.Mixed || !schemaElementDecl.ContentValidator.IsEmptiable))
2459 {
2461 }
2462 if (xe.DefaultValue != null)
2463 {
2466 }
2467 else
2468 {
2471 }
2472 if (schemaElementDecl.Datatype != null)
2473 {
2474 if (schemaElementDecl.Datatype.TypeCode == XmlTypeCode.Id)
2475 {
2477 }
2478 else
2479 {
2480 schemaElementDecl.DefaultValueTyped = schemaElementDecl.Datatype.ParseValue(schemaElementDecl.DefaultValueRaw, base.NameTable, new SchemaNamespaceManager(xe), createAtomicValue: true);
2481 }
2482 }
2483 else
2484 {
2486 }
2487 }
2488 if (xe.HasConstraints)
2489 {
2492 int num = 0;
2493 for (int i = 0; i < constraints.Count; i++)
2494 {
2497 array[num++] = xmlSchemaIdentityConstraint.CompiledConstraint;
2498 }
2500 }
2503 }
2504 catch (XmlSchemaException ex)
2505 {
2506 if (ex.SourceSchemaObject == null)
2507 {
2508 ex.SetSource(xe);
2509 }
2512 }
2513 finally
2514 {
2515 xe.IsProcessing = false;
2516 }
2517 }
2518 }
2519
2521 {
2522 if (complexType.ContentType == XmlSchemaContentType.Empty)
2523 {
2524 return ContentValidator.Empty;
2525 }
2526 if (complexType.ContentType == XmlSchemaContentType.TextOnly)
2527 {
2529 }
2532 {
2533 if (complexType.ContentType == XmlSchemaContentType.ElementOnly)
2534 {
2535 return ContentValidator.Empty;
2536 }
2537 return ContentValidator.Mixed;
2538 }
2541 {
2544 for (int i = 0; i < xmlSchemaAll.Items.Count; i++)
2545 {
2547 if (!allElementsContentValidator.AddElement(xmlSchemaElement.QualifiedName, xmlSchemaElement, xmlSchemaElement.MinOccurs == 0m))
2548 {
2550 }
2551 }
2553 }
2554 ParticleContentValidator particleContentValidator = new ParticleContentValidator(complexType.ContentType, base.CompilationSettings.EnableUpaCheck);
2555 try
2556 {
2559 return particleContentValidator.Finish(useDFA: true);
2560 }
2561 catch (UpaException ex)
2562 {
2563 if (ex.Particle1 is XmlSchemaElement)
2564 {
2565 if (ex.Particle2 is XmlSchemaElement)
2566 {
2567 SendValidationEvent(System.SR.Sch_NonDeterministic, ((XmlSchemaElement)ex.Particle1).QualifiedName.ToString(), (XmlSchemaElement)ex.Particle2);
2568 }
2569 else
2570 {
2571 SendValidationEvent(System.SR.Sch_NonDeterministicAnyEx, ((XmlSchemaAny)ex.Particle2).ResolvedNamespace, ((XmlSchemaElement)ex.Particle1).QualifiedName.ToString(), (XmlSchemaAny)ex.Particle2);
2572 }
2573 }
2574 else if (ex.Particle2 is XmlSchemaElement)
2575 {
2576 SendValidationEvent(System.SR.Sch_NonDeterministicAnyEx, ((XmlSchemaAny)ex.Particle1).ResolvedNamespace, ((XmlSchemaElement)ex.Particle2).QualifiedName.ToString(), (XmlSchemaElement)ex.Particle2);
2577 }
2578 else
2579 {
2580 SendValidationEvent(System.SR.Sch_NonDeterministicAnyAny, ((XmlSchemaAny)ex.Particle1).ResolvedNamespace, ((XmlSchemaAny)ex.Particle2).ResolvedNamespace, (XmlSchemaAny)ex.Particle2);
2581 }
2583 }
2584 catch (NotSupportedException)
2585 {
2588 }
2589 }
2590
2592 {
2593 bool result = false;
2594 if (particle is XmlSchemaElement)
2595 {
2597 contentValidator.AddName(xmlSchemaElement.QualifiedName, xmlSchemaElement);
2598 }
2599 else if (particle is XmlSchemaAny)
2600 {
2601 result = true;
2603 contentValidator.AddNamespaceList(xmlSchemaAny.NamespaceList, xmlSchemaAny);
2604 }
2605 else if (particle is XmlSchemaGroupBase)
2606 {
2607 XmlSchemaObjectCollection items = ((XmlSchemaGroupBase)particle).Items;
2608 bool flag = particle is XmlSchemaChoice;
2609 contentValidator.OpenGroup();
2610 bool flag2 = true;
2611 for (int i = 0; i < items.Count; i++)
2612 {
2613 if (flag2)
2614 {
2615 flag2 = false;
2616 }
2617 else if (flag)
2618 {
2619 contentValidator.AddChoice();
2620 }
2621 else
2622 {
2623 contentValidator.AddSequence();
2624 }
2626 }
2627 contentValidator.CloseGroup();
2628 }
2629 if (!(particle.MinOccurs == 1m) || !(particle.MaxOccurs == 1m))
2630 {
2631 if (particle.MinOccurs == 0m && particle.MaxOccurs == 1m)
2632 {
2633 contentValidator.AddQMark();
2634 }
2635 else if (particle.MinOccurs == 0m && particle.MaxOccurs == decimal.MaxValue)
2636 {
2637 contentValidator.AddStar();
2638 }
2639 else if (particle.MinOccurs == 1m && particle.MaxOccurs == decimal.MaxValue)
2640 {
2641 contentValidator.AddPlus();
2642 }
2643 else
2644 {
2645 contentValidator.AddLeafRange(particle.MinOccurs, particle.MaxOccurs);
2646 }
2647 }
2648 return result;
2649 }
2650
2652 {
2653 if (particle is XmlSchemaElement)
2654 {
2657 if (complexType.LocalElements[xmlSchemaElement.QualifiedName] == null)
2658 {
2659 complexType.LocalElements.Add(xmlSchemaElement.QualifiedName, xmlSchemaElement);
2660 return;
2661 }
2663 if (xmlSchemaElement2.ElementSchemaType != xmlSchemaElement.ElementSchemaType)
2664 {
2666 }
2667 }
2668 else if (particle is XmlSchemaGroupBase)
2669 {
2670 XmlSchemaObjectCollection items = ((XmlSchemaGroupBase)particle).Items;
2671 for (int i = 0; i < items.Count; i++)
2672 {
2674 }
2675 }
2676 }
2677
2679 {
2680 if (particle is XmlSchemaElement)
2681 {
2684 }
2685 else if (particle is XmlSchemaGroupBase)
2686 {
2687 XmlSchemaObjectCollection items = ((XmlSchemaGroupBase)particle).Items;
2688 for (int i = 0; i < items.Count; i++)
2689 {
2691 }
2692 }
2693 }
2694
2696 {
2697 if (complexType.IsProcessing)
2698 {
2700 return;
2701 }
2703 try
2704 {
2705 if (complexType.ContentTypeParticle != XmlSchemaParticle.Empty)
2706 {
2707 CompileParticleElements(complexType, complexType.ContentTypeParticle);
2708 }
2709 }
2710 finally
2711 {
2713 }
2714 }
2715
2729
2739
2757
2759 {
2760 to.SourceUri = from.SourceUri;
2761 to.LinePosition = from.LinePosition;
2762 to.LineNumber = from.LineNumber;
2763 to.SetUnhandledAttributes(from.UnhandledAttributes);
2764 if (copyParent)
2765 {
2766 to.Parent = from.Parent;
2767 }
2768 }
2769
2771 {
2772 if (baseDecl.Presence == SchemaDeclBase.Use.Fixed || baseDecl.Presence == SchemaDeclBase.Use.RequiredFixed)
2773 {
2774 object defaultValueTyped = baseDecl.DefaultValueTyped;
2775 if (derivedDecl.Presence != SchemaDeclBase.Use.Fixed && derivedDecl.Presence != SchemaDeclBase.Use.RequiredFixed)
2776 {
2777 return false;
2778 }
2779 object defaultValueTyped2 = derivedDecl.DefaultValueTyped;
2780 XmlSchemaDatatype datatype = baseDecl.Datatype;
2782 if (datatype.Variety == XmlSchemaDatatypeVariety.Union)
2783 {
2784 if (datatype2.Variety == XmlSchemaDatatypeVariety.Union)
2785 {
2786 if (!datatype2.IsEqual(defaultValueTyped, defaultValueTyped2))
2787 {
2788 return false;
2789 }
2790 }
2791 else
2792 {
2794 XmlSchemaDatatype datatype3 = xsdSimpleValue.XmlType.Datatype;
2795 if (!datatype3.IsComparable(datatype2) || !datatype2.IsEqual(xsdSimpleValue.TypedValue, defaultValueTyped2))
2796 {
2797 return false;
2798 }
2799 }
2800 }
2801 else if (!datatype2.IsEqual(defaultValueTyped, defaultValueTyped2))
2802 {
2803 return false;
2804 }
2805 }
2806 return true;
2807 }
2808}
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void AddRange(IEnumerable< KeyValuePair< TKey, TValue > > collection)
void Add(TKey key, TValue value)
virtual ICollection Values
Definition Hashtable.cs:534
virtual void Add(object key, object? value)
Definition Hashtable.cs:676
static string Sch_GroupCircularRef
Definition SR.cs:1034
static string Sch_UndefAttributeGroupRef
Definition SR.cs:1044
static string Sch_SubstitutionCircularRef
Definition SR.cs:930
static string Sch_ElementCircularRef
Definition SR.cs:1066
static string Sch_NonDeterministic
Definition SR.cs:584
static string Sch_SeqFromChoice
Definition SR.cs:1030
static string Sch_InvalidContentRestrictionDetailed
Definition SR.cs:980
static string Sch_AttributeRestrictionInvalid
Definition SR.cs:1052
static string Sch_InvalidExamplar
Definition SR.cs:942
static string Sch_IdentityConstraintCircularRef
Definition SR.cs:928
static string Sch_NotSimpleContent
Definition SR.cs:962
static string Sch_TypeCircularRef
Definition SR.cs:952
static string Sch_ForbiddenDerivedParticleForElem
Definition SR.cs:994
static string Sch_ElementCannotHaveValue
Definition SR.cs:1070
static string Sch_UndeclaredEquivClass
Definition SR.cs:562
static string Sch_InvalidParticleRestriction
Definition SR.cs:988
static string Sch_DefaultIdValue
Definition SR.cs:458
static string Sch_AnyFromAnyRule3
Definition SR.cs:1010
static string Sch_InvalidBaseToMixed
Definition SR.cs:984
static string Sch_ElementFromElement
Definition SR.cs:1000
static string Sch_NoDerivedAttribute
Definition SR.cs:1060
static string Sch_UndefGroupRef
Definition SR.cs:1032
static string Sch_ForbiddenDerivedParticleForAll
Definition SR.cs:992
static string Sch_ElementFromGroupBase3
Definition SR.cs:1020
static string Sch_ForbiddenDerivedParticleForChoice
Definition SR.cs:996
static string Sch_DupAttributeUse
Definition SR.cs:986
static string Sch_InvalidSimpleTypeRestriction
Definition SR.cs:1152
static string Sch_RefInvalidCardin
Definition SR.cs:724
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Sch_UndeclaredSimpleType
Definition SR.cs:560
static string Sch_BaseFinalUnion
Definition SR.cs:970
static string Sch_AnyFromAnyRule1
Definition SR.cs:1006
static string Sch_AttributeRestrictionInvalidFromWildcard
Definition SR.cs:1058
static string Sch_RefInvalidElement
Definition SR.cs:1068
static string Sch_NeedSimpleTypeChild
Definition SR.cs:1146
static string Sch_InvalidAttributeExtension
Definition SR.cs:1046
static string Sch_AttributeFixedInvalid
Definition SR.cs:1054
static string Sch_DifContentType
Definition SR.cs:976
static string Sch_UnionFromUnion
Definition SR.cs:608
static string Sch_ElementFromGroupBase2
Definition SR.cs:1018
static string Sch_AttributeRestrictionProhibited
Definition SR.cs:1050
static string Sch_GroupBaseRestNotEmptiable
Definition SR.cs:1026
static string Sch_UndeclaredType
Definition SR.cs:558
static string Sch_FixedInRef
Definition SR.cs:538
static string Sch_ElementFromAnyRule2
Definition SR.cs:1004
static string Sch_InvalidSubstitutionMember
Definition SR.cs:946
static string Sch_BaseFinalExtension
Definition SR.cs:960
static string Sch_ElementFromGroupBase1
Definition SR.cs:1016
static string Sch_ElementTypeCollision
Definition SR.cs:1074
static string Sch_InvalidAnyAttributeRestriction
Definition SR.cs:1048
static string Sch_BaseFinalList
Definition SR.cs:968
static string Sch_AllRefMinMax
Definition SR.cs:1038
static string Sch_DerivedNotFromBase
Definition SR.cs:1144
static string Sch_UnexpressibleAnyAttribute
Definition SR.cs:1062
static string Sch_GroupBaseFromAny1
Definition SR.cs:1012
static string Sch_FixedDefaultInRef
Definition SR.cs:540
static string Sch_AttributeUseInvalid
Definition SR.cs:1056
static string Sch_GroupBaseRestRangeInvalid
Definition SR.cs:1022
static string Sch_EmptyChoice
Definition SR.cs:1142
static string Sch_DupElement
Definition SR.cs:480
static string Sch_NoExamplar
Definition SR.cs:944
static string Sch_UndeclaredElement
Definition SR.cs:412
static string Sch_AttributeIgnored
Definition SR.cs:546
static string Sch_RefInvalidIdentityConstraint
Definition SR.cs:722
static string Sch_GroupBaseRestNoMap
Definition SR.cs:1024
static string Sch_RefInvalidAttribute
Definition SR.cs:1064
static string Sch_AttributeGroupCircularRef
Definition SR.cs:1042
static string Sch_UndeclaredIdentityConstraint
Definition SR.cs:720
static string Sch_ComplexContentModel
Definition SR.cs:1158
static string Sch_ReftoKeyref
Definition SR.cs:726
static string Sch_UndefBaseExtension
Definition SR.cs:974
static string Sch_ElementFromAnyRule1
Definition SR.cs:1002
static string Sch_AttributeCircularRef
Definition SR.cs:926
static string Sch_ForbiddenDerivedParticleForSeq
Definition SR.cs:998
static string Sch_UndefBaseRestriction
Definition SR.cs:972
static string Sch_InvalidBaseToEmpty
Definition SR.cs:982
static string Sch_BaseFinalRestriction
Definition SR.cs:966
static string Sch_SeqFromAll
Definition SR.cs:1028
static string Sch_NonDeterministicAnyEx
Definition SR.cs:586
static string Sch_TwoIdAttrUses
Definition SR.cs:954
static string Sch_AnyFromAnyRule2
Definition SR.cs:1008
static string Sch_UndeclaredAttribute
Definition SR.cs:414
static string Sch_GroupBaseFromAny2
Definition SR.cs:1014
static string Sch_InvalidParticleRestrictionDetailed
Definition SR.cs:990
static string Sch_AllRefNotRoot
Definition SR.cs:1036
static string Sch_NonDeterministicAnyAny
Definition SR.cs:588
static string Sch_NotAllAlone
Definition SR.cs:1040
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
void AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item)
static readonly CompiledIdentityConstraint Empty
void PushComplexType(XmlSchemaComplexType complexType)
Definition Compiler.cs:1823
void CheckUnionType(XmlSchemaSimpleType unionMember, List< XmlSchemaSimpleType > memberTypeDefinitions, XmlSchemaSimpleType parentType)
Definition Compiler.cs:718
readonly XmlSchemaObjectTable _elements
Definition Compiler.cs:16
void CompileIdentityConstraint(XmlSchemaIdentityConstraint xi)
Definition Compiler.cs:2291
XmlSchemaType GetAnySchemaType(XmlQualifiedName name)
Definition Compiler.cs:2740
bool BuildParticleContentModel(ParticleContentValidator contentValidator, XmlSchemaParticle particle)
Definition Compiler.cs:2591
void CleanupParticle(XmlSchemaParticle particle)
Definition Compiler.cs:395
XmlSchemaParticle CannonicalizeElement(XmlSchemaElement element)
Definition Compiler.cs:1135
void CheckAtrributeGroupRestriction(XmlSchemaAttributeGroup baseAttributeGroup, XmlSchemaAttributeGroup derivedAttributeGroup)
Definition Compiler.cs:2036
readonly Stack< XmlSchemaComplexType > _complexTypeStack
Definition Compiler.cs:28
readonly XmlSchema _schemaForSchema
Definition Compiler.cs:32
void CompileSubstitutionGroup(XmlSchemaSubstitutionGroup substitutionGroup)
Definition Compiler.cs:446
bool IsGroupBaseFromAny(XmlSchemaGroupBase derivedGroupBase, XmlSchemaAny baseAny)
Definition Compiler.cs:1543
void RecursivelyCheckRedefinedAttributeGroups(XmlSchemaAttributeGroup attributeGroup, XmlSchemaAttributeGroup baseAttributeGroup)
Definition Compiler.cs:528
bool IsProcessContentsRestricted(XmlSchemaComplexType baseType, XmlSchemaAnyAttribute derivedAttributeWildcard, XmlSchemaAnyAttribute baseAttributeWildcard)
Definition Compiler.cs:2084
XmlSchemaAnyAttribute CompileAnyAttributeUnion(XmlSchemaAnyAttribute a, XmlSchemaAnyAttribute b)
Definition Compiler.cs:2097
void CompileComplexContentRestriction(XmlSchemaComplexType complexType, XmlSchemaComplexContent complexContent, XmlSchemaComplexContentRestriction complexRestriction)
Definition Compiler.cs:993
void CheckParticleDerivation(XmlSchemaComplexType complexType)
Definition Compiler.cs:1037
XmlSchemaParticle CannonicalizeAll(XmlSchemaAll all, bool root)
Definition Compiler.cs:1207
readonly XmlSchemaObjectTable _attributes
Definition Compiler.cs:12
bool IsSequenceFromAll(XmlSchemaSequence derivedSequence, XmlSchemaAll baseAll)
Definition Compiler.cs:1660
int GetMappingParticle(XmlSchemaParticle particle, XmlSchemaObjectCollection collection)
Definition Compiler.cs:1723
void CompileElement(XmlSchemaElement xe)
Definition Compiler.cs:2349
ContentValidator CompileComplexContent(XmlSchemaComplexType complexType)
Definition Compiler.cs:2520
void CompileAttributeGroup(XmlSchemaAttributeGroup attributeGroup)
Definition Compiler.cs:1841
bool Execute(XmlSchemaSet schemaSet, SchemaInfo schemaCompiledInfo)
Definition Compiler.cs:40
void CompileComplexContentExtension(XmlSchemaComplexType complexType, XmlSchemaComplexContent complexContent, XmlSchemaComplexContentExtension complexExtension)
Definition Compiler.cs:932
Compiler(XmlNameTable nameTable, ValidationEventHandler eventHandler, XmlSchema schemaForSchema, XmlSchemaCompilationSettings compilationSettings)
Definition Compiler.cs:34
readonly XmlSchemaObjectTable _schemaTypes
Definition Compiler.cs:18
void RecursivelyCheckRedefinedGroups(XmlSchemaGroup redefinedGroup, XmlSchemaGroup baseGroup)
Definition Compiler.cs:506
void CompileParticleElements(XmlSchemaParticle particle)
Definition Compiler.cs:2678
bool IsSequenceFromChoice(XmlSchemaSequence derivedSequence, XmlSchemaChoice baseChoice)
Definition Compiler.cs:1691
bool IsElementFromElement(XmlSchemaElement derivedElement, XmlSchemaElement baseElement)
Definition Compiler.cs:1496
bool IsValidOccurrenceRangeRestriction(decimal minOccurs, decimal maxOccurs, decimal baseMinOccurs, decimal baseMaxOccurs)
Definition Compiler.cs:1714
void CleanupAttributeGroup(XmlSchemaAttributeGroup attributeGroup)
Definition Compiler.cs:274
void CompileSimpleContentRestriction(XmlSchemaComplexType complexType, XmlSchemaSimpleContentRestriction simpleRestriction)
Definition Compiler.cs:852
bool IsElementFromGroupBase(XmlSchemaElement derivedElement, XmlSchemaGroupBase baseGroupBase)
Definition Compiler.cs:1566
void CompileLocalAttributes(XmlSchemaComplexType baseType, XmlSchemaComplexType derivedType, XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaDerivationMethod derivedBy)
Definition Compiler.cs:1907
void CleanupComplexType(XmlSchemaComplexType complexType)
Definition Compiler.cs:285
void ImportAllCompiledSchemas(XmlSchemaSet schemaSet)
Definition Compiler.cs:165
XmlSchemaAnyAttribute CompileAnyAttributeIntersection(XmlSchemaAnyAttribute a, XmlSchemaAnyAttribute b)
Definition Compiler.cs:2115
void CalculateEffectiveTotalRange(XmlSchemaParticle particle, out decimal minOccurs, out decimal maxOccurs)
Definition Compiler.cs:1741
void Output(SchemaInfo schemaInfo)
Definition Compiler.cs:130
XmlSchemaParticle CannonicalizeGroupRef(XmlSchemaGroupRef groupRef, bool root)
Definition Compiler.cs:1157
XmlSchemaParticle CannonicalizeSequence(XmlSchemaSequence sequence, bool root)
Definition Compiler.cs:1283
readonly XmlSchemaObjectTable _groups
Definition Compiler.cs:20
void CleanupSimpleType(XmlSchemaSimpleType simpleType)
Definition Compiler.cs:341
XmlSchemaContentType GetSchemaContentType(XmlSchemaComplexType complexType, XmlSchemaComplexContent complexContent, XmlSchemaParticle particle)
Definition Compiler.cs:1828
void CompileAttribute(XmlSchemaAttribute xa)
Definition Compiler.cs:2133
bool IsValidRestriction(XmlSchemaParticle derivedParticle, XmlSchemaParticle baseParticle)
Definition Compiler.cs:1368
void CompileComplexType(XmlSchemaComplexType complexType)
Definition Compiler.cs:730
XmlSchemaParticle CompileContentTypeParticle(XmlSchemaParticle particle)
Definition Compiler.cs:1092
void CleanupElement(XmlSchemaElement element)
Definition Compiler.cs:353
XmlSchemaSimpleType[] CompileBaseMemberTypes(XmlSchemaSimpleType simpleType)
Definition Compiler.cs:668
void CompileComplexTypeElements(XmlSchemaComplexType complexType)
Definition Compiler.cs:2695
readonly XmlSchemaObjectTable _examplars
Definition Compiler.cs:24
void CleanupAttribute(XmlSchemaAttribute attribute)
Definition Compiler.cs:265
bool IsParticleEmptiable(XmlSchemaParticle particle)
Definition Compiler.cs:1735
bool IsChoiceFromChoiceSubstGroup(XmlSchemaChoice derivedChoice, XmlSchemaChoice baseChoice)
Definition Compiler.cs:1607
bool IsElementFromAny(XmlSchemaElement derivedElement, XmlSchemaAny baseAny)
Definition Compiler.cs:1508
bool IsFixedEqual(SchemaDeclBase baseDecl, SchemaDeclBase derivedDecl)
Definition Compiler.cs:2770
void CopyPosition(XmlSchemaAnnotated to, XmlSchemaAnnotated from, bool copyParent)
Definition Compiler.cs:2758
void CompileSimpleType(XmlSchemaSimpleType simpleType)
Definition Compiler.cs:558
bool IsAnyFromAny(XmlSchemaAny derivedAny, XmlSchemaAny baseAny)
Definition Compiler.cs:1523
void CleanupAttributes(XmlSchemaObjectCollection attributes)
Definition Compiler.cs:374
bool IsValidOccurrenceRangeRestriction(XmlSchemaParticle derivedParticle, XmlSchemaParticle baseParticle)
Definition Compiler.cs:1709
readonly XmlSchemaObjectTable _attributeGroups
Definition Compiler.cs:14
bool IsGroupBaseFromGroupBase(XmlSchemaGroupBase derivedGroupBase, XmlSchemaGroupBase baseGroupBase, bool skipEmptableOnly)
Definition Compiler.cs:1624
XmlSchemaParticle CannonicalizeParticle(XmlSchemaParticle particle, bool root)
Definition Compiler.cs:1106
XmlSchemaParticle CannonicalizePointlessRoot(XmlSchemaParticle particle)
Definition Compiler.cs:1325
void SetDefaultFixed(XmlSchemaAttribute xa, SchemaAttDef decl)
Definition Compiler.cs:2239
XmlSchemaComplexType GetComplexType(XmlQualifiedName name)
Definition Compiler.cs:2730
XmlSchemaParticle CannonicalizeChoice(XmlSchemaChoice choice, bool root)
Definition Compiler.cs:1237
void CompileSimpleContentExtension(XmlSchemaComplexType complexType, XmlSchemaSimpleContentExtension simpleExtension)
Definition Compiler.cs:813
readonly XmlSchemaObjectTable _identityConstraints
Definition Compiler.cs:26
void Prepare(XmlSchema schema, bool cleanup)
Definition Compiler.cs:54
void CleanupGroup(XmlSchemaGroup group)
Definition Compiler.cs:385
readonly XmlSchemaObjectTable _notations
Definition Compiler.cs:22
void CompileGroup(XmlSchemaGroup group)
Definition Compiler.cs:542
void CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle)
Definition Compiler.cs:2651
XmlSchemaSimpleType GetSimpleType(XmlQualifiedName name)
Definition Compiler.cs:2716
void CheckParticleDerivation(XmlSchemaParticle derivedParticle, XmlSchemaParticle baseParticle)
Definition Compiler.cs:1074
readonly Hashtable _schemasToCompile
Definition Compiler.cs:30
static readonly ContentValidator Empty
static readonly ContentValidator Mixed
static readonly ContentValidator TextOnly
static XmlSchemaSimpleType[] GetBuiltInTypes()
static XmlSchemaSimpleType GetSimpleTypeFromXsdType(XmlQualifiedName qname)
static bool IsSubset(NamespaceList sub, NamespaceList super)
static XmlSchema GetParentSchema(XmlSchemaObject currentSchemaObject)
static readonly SchemaAttDef Empty
static readonly SchemaElementDecl Empty
static bool IsSubset(XmlSchemaAnyAttribute sub, XmlSchemaAnyAttribute super)
static XmlSchemaAnyAttribute Intersection(XmlSchemaAnyAttribute o1, XmlSchemaAnyAttribute o2, bool v1Compat)
static XmlSchemaAnyAttribute Union(XmlSchemaAnyAttribute o1, XmlSchemaAnyAttribute o2, bool v1Compat)
XmlSchemaDatatype DeriveByList(XmlSchemaType schemaType)
bool IsEqual(object o1, object o2)
object ParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr)
virtual XmlSchemaDatatypeVariety Variety
static XmlSchemaDatatype DeriveByUnion(XmlSchemaSimpleType[] types, XmlSchemaType schemaType)
XmlSchemaObjectCollection Constraints
void Insert(XmlQualifiedName name, XmlSchemaObject value)
void Add(XmlQualifiedName name, XmlSchemaObject value)
void Replace(XmlQualifiedName name, XmlSchemaObject value)
static readonly XmlSchemaParticle Empty
static ? XmlSchemaSimpleType GetBuiltInSimpleType(XmlQualifiedName qualifiedName)
static bool IsDerivedFrom([NotNullWhen(true)] XmlSchemaType? derivedType, [NotNullWhen(true)] XmlSchemaType? baseType, XmlSchemaDerivationMethod except)
static bool IsDerivedFromDatatype(XmlSchemaDatatype derivedDataType, XmlSchemaDatatype baseDataType, XmlSchemaDerivationMethod except)
XmlSchemaObjectTable SchemaTypes
Definition XmlSchema.cs:256
static readonly XmlQualifiedName Empty