Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Preprocessor.cs
Go to the documentation of this file.
3using System.IO;
5
6namespace System.Xml.Schema;
7
8internal sealed class Preprocessor : BaseProcessor
9{
10 private string _xmlns;
11
12 private string _nsXsi;
13
14 private string _targetNamespace;
15
17
19
21
23
25
27
29
31
33
35
36 private readonly SortedList _lockList;
37
39
41
43
45
47
49 {
50 set
51 {
53 }
54 }
55
57 {
58 set
59 {
61 }
62 }
63
65 {
66 set
67 {
69 }
70 }
71
73 {
74 set
75 {
77 }
78 }
79
81
86
94
96 {
98 _xmlns = base.NameTable.Add("xmlns");
99 _nsXsi = base.NameTable.Add("http://www.w3.org/2001/XMLSchema-instance");
103 {
105 }
106 if (_rootSchema.TargetNamespace != null)
107 {
108 if (targetNamespace == null)
109 {
111 }
113 {
115 }
116 }
117 else if (targetNamespace != null && targetNamespace.Length != 0)
118 {
120 }
121 if (loadExternals && _xmlResolver != null)
122 {
124 }
126 int i = 0;
127 try
128 {
129 for (i = 0; i < _lockList.Count; i++)
130 {
134 }
137 if (_redefinedList != null)
138 {
139 for (int j = 0; j < _redefinedList.Count; j++)
140 {
142 }
143 }
144 }
145 finally
146 {
147 if (i == _lockList.Count)
148 {
149 i--;
150 }
151 int num = i;
152 while (i >= 0)
153 {
157 {
159 }
160 else
161 {
163 xmlSchema.IsPreprocessed = !base.HasErrors;
165 }
166 i--;
167 }
168 }
169 _rootSchema.IsPreprocessed = !base.HasErrors;
170 return !base.HasErrors;
171 }
172
174 {
175 if (schema != GetBuildInSchema())
176 {
177 schema.Attributes.Clear();
178 schema.AttributeGroups.Clear();
179 schema.SchemaTypes.Clear();
180 schema.Elements.Clear();
181 schema.Groups.Clear();
182 schema.Notations.Clear();
183 schema.Ids.Clear();
184 schema.IdentityConstraints.Clear();
185 schema.IsRedefined = false;
187 }
188 }
189
197
199 {
200 if (_lockList.Contains(schema.SchemaId))
201 {
202 return;
203 }
204 _lockList.Add(schema.SchemaId, schema);
205 for (int i = 0; i < schema.Includes.Count; i++)
206 {
208 if (xmlSchemaExternal.Schema != null)
209 {
211 }
212 }
213 }
214
216 {
217 if (schema.IsProcessing)
218 {
219 return;
220 }
221 schema.IsProcessing = true;
222 for (int i = 0; i < schema.Includes.Count; i++)
223 {
224 Uri uri = null;
227 if (schema2 != null)
228 {
229 uri = schema2.BaseUri;
230 if (uri != null && _schemaLocations[uri] == null)
231 {
233 }
235 continue;
236 }
237 string schemaLocation = xmlSchemaExternal.SchemaLocation;
238 Uri uri2 = null;
240 if (schemaLocation != null)
241 {
242 try
243 {
245 }
246 catch (Exception ex)
247 {
248 uri2 = null;
250 }
251 }
252 if (xmlSchemaExternal.Compositor == Compositor.Import)
253 {
255 string text = ((xmlSchemaImport.Namespace != null) ? xmlSchemaImport.Namespace : string.Empty);
256 if (!schema.ImportedNamespaces.Contains(text))
257 {
258 schema.ImportedNamespaces.Add(text);
259 }
260 if (text == "http://www.w3.org/XML/1998/namespace" && uri2 == null)
261 {
263 continue;
264 }
265 }
266 if (uri2 == null)
267 {
268 if (schemaLocation != null)
269 {
271 }
272 }
273 else if (_schemaLocations[uri2] == null)
274 {
275 object obj = null;
276 try
277 {
279 }
280 catch (Exception ex2)
281 {
283 obj = null;
284 }
285 if (obj != null)
286 {
288 Type type = obj.GetType();
289 if (typeof(XmlSchema).IsAssignableFrom(type))
290 {
294 continue;
295 }
296 XmlReader xmlReader = null;
297 if (type.IsSubclassOf(typeof(Stream)))
298 {
302 }
303 else if (type.IsSubclassOf(typeof(XmlReader)))
304 {
306 }
307 else if (type.IsSubclassOf(typeof(TextReader)))
308 {
312 }
313 if (xmlReader == null)
314 {
316 continue;
317 }
318 try
319 {
320 Parser parser = new Parser(SchemaType.XSD, base.NameTable, base.SchemaNames, base.EventHandler);
321 parser.Parse(xmlReader, null);
322 while (xmlReader.Read())
323 {
324 }
328 }
329 catch (XmlSchemaException ex3)
330 {
331 SendValidationEvent(System.SR.Sch_CannotLoadSchemaLocation, schemaLocation, ex3.Message, ex3.SourceUri, ex3.LineNumber, ex3.LinePosition);
332 }
334 {
336 }
337 finally
338 {
339 xmlReader.Close();
340 }
341 }
342 else
343 {
345 }
346 }
347 else
348 {
350 }
351 }
352 }
353
354 internal static XmlSchema GetBuildInSchema()
355 {
356 if (s_builtInSchemaForXmlNS == null)
357 {
359 xmlSchema.TargetNamespace = "http://www.w3.org/XML/1998/namespace";
360 xmlSchema.Namespaces.Add("xml", "http://www.w3.org/XML/1998/namespace");
363 xmlSchemaAttribute.SchemaTypeName = new XmlQualifiedName("language", "http://www.w3.org/2001/XMLSchema");
367 xmlSchemaAttribute2.SchemaTypeName = new XmlQualifiedName("anyURI", "http://www.w3.org/2001/XMLSchema");
370 xmlSchemaAttribute3.Name = "space";
373 xmlSchemaSimpleTypeRestriction.BaseTypeName = new XmlQualifiedName("NCName", "http://www.w3.org/2001/XMLSchema");
385 xmlSchemaAttributeGroup.Name = "specialAttrs";
387 xmlSchemaAttribute4.RefName = new XmlQualifiedName("lang", "http://www.w3.org/XML/1998/namespace");
390 xmlSchemaAttribute5.RefName = new XmlQualifiedName("space", "http://www.w3.org/XML/1998/namespace");
393 xmlSchemaAttribute6.RefName = new XmlQualifiedName("base", "http://www.w3.org/XML/1998/namespace");
397 xmlSchema.CompileSchemaInSet(new NameTable(), null, null);
399 }
401 }
402
404 {
406 _referenceNamespaces.Add("http://www.w3.org/2001/XMLSchema", "http://www.w3.org/2001/XMLSchema");
407 for (int i = 0; i < schema.Includes.Count; i++)
408 {
411 {
413 string text = xmlSchemaImport.Namespace;
414 if (text == null)
415 {
416 text = string.Empty;
417 }
418 if (_referenceNamespaces[text] == null)
419 {
421 }
422 }
423 }
424 string text2 = schema.TargetNamespace;
425 if (text2 == null)
426 {
427 text2 = string.Empty;
428 }
429 if (_referenceNamespaces[text2] == null)
430 {
432 }
433 }
434
435 private void ParseUri(string uri, string code, XmlSchemaObject sourceSchemaObject)
436 {
437 try
438 {
439 XmlConvert.ToUri(uri);
440 }
442 {
444 }
445 }
446
448 {
449 XmlSchema xmlSchema = null;
450 if (schema.IsProcessing)
451 {
452 return;
453 }
454 schema.IsProcessing = true;
455 string targetNamespace2 = schema.TargetNamespace;
456 if (targetNamespace2 != null)
457 {
459 if (targetNamespace2.Length == 0)
460 {
462 }
463 else
464 {
466 }
467 }
468 if (schema.Version != null)
469 {
471 object typedValue;
472 Exception ex = datatype.TryParseValue(schema.Version, null, null, out typedValue);
473 if (ex != null)
474 {
475 SendValidationEvent(System.SR.Sch_AttributeValueDataTypeDetailed, new string[4] { "version", schema.Version, datatype.TypeCodeString, ex.Message }, ex, schema);
476 }
477 else
478 {
479 schema.Version = (string)typedValue;
480 }
481 }
483 for (int i = 0; i < schema.Includes.Count; i++)
484 {
489 string schemaLocation = xmlSchemaExternal.SchemaLocation;
490 if (schemaLocation != null)
491 {
493 }
494 else if ((xmlSchemaExternal.Compositor == Compositor.Include || xmlSchemaExternal.Compositor == Compositor.Redefine) && xmlSchema2 == null)
495 {
497 }
498 switch (xmlSchemaExternal.Compositor)
499 {
500 case Compositor.Import:
501 {
503 string @namespace = xmlSchemaImport.Namespace;
504 if (@namespace == schema.TargetNamespace)
505 {
507 }
508 if (xmlSchema2 != null)
509 {
510 if (@namespace != xmlSchema2.TargetNamespace)
511 {
512 SendValidationEvent(System.SR.Sch_MismatchTargetNamespaceImport, @namespace, xmlSchema2.TargetNamespace, xmlSchemaImport);
513 }
514 xmlSchema = _rootSchemaForRedefine;
515 _rootSchemaForRedefine = xmlSchema2;
516 Preprocess(xmlSchema2, @namespace, imports);
517 _rootSchemaForRedefine = xmlSchema;
518 }
519 else if (@namespace != null)
520 {
521 if (@namespace.Length == 0)
522 {
523 SendValidationEvent(System.SR.Sch_InvalidNamespaceAttribute, @namespace, xmlSchemaExternal);
524 }
525 else
526 {
527 ParseUri(@namespace, System.SR.Sch_InvalidNamespace, xmlSchemaExternal);
528 }
529 }
530 continue;
531 }
532 case Compositor.Include:
533 {
535 if (schema2 == null)
536 {
537 continue;
538 }
539 break;
540 }
541 case Compositor.Redefine:
542 if (xmlSchema2 == null)
543 {
544 continue;
545 }
547 break;
548 }
549 if (xmlSchema2.TargetNamespace != null)
550 {
551 if (schema.TargetNamespace != xmlSchema2.TargetNamespace)
552 {
554 }
555 }
556 else if (targetNamespace != null && targetNamespace.Length != 0)
557 {
559 }
560 Preprocess(xmlSchema2, schema.TargetNamespace, imports);
561 }
565 _targetNamespace = ((targetNamespace == null) ? string.Empty : targetNamespace);
568 for (int j = 0; j < schema.Includes.Count; j++)
569 {
572 if (schema3 != null)
573 {
574 switch (xmlSchemaExternal2.Compositor)
575 {
576 case Compositor.Include:
577 if (_processedExternals[schema3] != null)
578 {
579 continue;
580 }
583 break;
584 case Compositor.Redefine:
585 if (_redefinedList == null)
586 {
588 }
590 if (_processedExternals[schema3] != null)
591 {
592 continue;
593 }
596 break;
597 case Compositor.Import:
598 if (schema3 != _rootSchema)
599 {
601 string text2 = ((xmlSchemaImport2.Namespace != null) ? xmlSchemaImport2.Namespace : string.Empty);
603 {
605 }
607 {
609 }
610 }
611 break;
612 }
613 }
614 else if (xmlSchemaExternal2.Compositor == Compositor.Redefine)
615 {
617 if (xmlSchemaRedefine.BaseUri == null)
618 {
619 for (int k = 0; k < xmlSchemaRedefine.Items.Count; k++)
620 {
622 {
624 break;
625 }
626 }
627 }
628 }
630 }
632 XmlSchemaObjectCollection items = schema.Items;
633 for (int l = 0; l < items.Count; l++)
634 {
635 SetParent(items[l], schema);
637 {
639 AddToTable(schema.Attributes, xmlSchemaAttribute.QualifiedName, xmlSchemaAttribute);
640 }
642 {
644 AddToTable(schema.AttributeGroups, xmlSchemaAttributeGroup.QualifiedName, xmlSchemaAttributeGroup);
645 }
647 {
649 AddToTable(schema.SchemaTypes, xmlSchemaComplexType.QualifiedName, xmlSchemaComplexType);
650 }
652 {
654 AddToTable(schema.SchemaTypes, xmlSchemaSimpleType.QualifiedName, xmlSchemaSimpleType);
655 }
656 else if (items[l] is XmlSchemaElement xmlSchemaElement)
657 {
659 AddToTable(schema.Elements, xmlSchemaElement.QualifiedName, xmlSchemaElement);
660 }
661 else if (items[l] is XmlSchemaGroup xmlSchemaGroup)
662 {
664 AddToTable(schema.Groups, xmlSchemaGroup.QualifiedName, xmlSchemaGroup);
665 }
666 else if (items[l] is XmlSchemaNotation xmlSchemaNotation)
667 {
669 AddToTable(schema.Notations, xmlSchemaNotation.QualifiedName, xmlSchemaNotation);
670 }
671 else if (items[l] is XmlSchemaAnnotation annotation)
672 {
673 PreprocessAnnotation(annotation);
674 }
675 else
676 {
678 list.Add(items[l]);
679 }
680 }
681 for (int m = 0; m < list.Count; m++)
682 {
683 schema.Items.Remove(list[m]);
684 }
685 }
686
688 {
689 foreach (XmlSchemaElement value in includedSchema.Elements.Values)
690 {
691 AddToTable(schema.Elements, value.QualifiedName, value);
692 }
693 foreach (XmlSchemaAttribute value2 in includedSchema.Attributes.Values)
694 {
695 AddToTable(schema.Attributes, value2.QualifiedName, value2);
696 }
697 foreach (XmlSchemaGroup value3 in includedSchema.Groups.Values)
698 {
699 AddToTable(schema.Groups, value3.QualifiedName, value3);
700 }
701 foreach (XmlSchemaAttributeGroup value4 in includedSchema.AttributeGroups.Values)
702 {
703 AddToTable(schema.AttributeGroups, value4.QualifiedName, value4);
704 }
705 foreach (XmlSchemaType value5 in includedSchema.SchemaTypes.Values)
706 {
707 AddToTable(schema.SchemaTypes, value5.QualifiedName, value5);
708 }
709 foreach (XmlSchemaNotation value6 in includedSchema.Notations.Values)
710 {
711 AddToTable(schema.Notations, value6.QualifiedName, value6);
712 }
713 }
714
716 {
717 XmlSchemaRedefine redefine = redefineEntry.redefine;
718 XmlSchema schema = redefine.Schema;
721 if (schema.IsRedefined)
722 {
724 return;
725 }
726 schema.IsRedefined = true;
727 XmlSchema schemaToUpdate = redefineEntry.schemaToUpdate;
730 string @namespace = ((schemaToUpdate.TargetNamespace == null) ? string.Empty : schemaToUpdate.TargetNamespace);
731 XmlSchemaObjectCollection items = redefine.Items;
732 for (int i = 0; i < items.Count; i++)
733 {
734 SetParent(items[i], redefine);
735 if (items[i] is XmlSchemaGroup xmlSchemaGroup)
736 {
738 xmlSchemaGroup.QualifiedName.SetNamespace(@namespace);
739 if (redefine.Groups[xmlSchemaGroup.QualifiedName] != null)
740 {
742 continue;
743 }
744 AddToTable(redefine.Groups, xmlSchemaGroup.QualifiedName, xmlSchemaGroup);
745 XmlSchemaGroup xmlSchemaGroup2 = (XmlSchemaGroup)schemaToUpdate.Groups[xmlSchemaGroup.QualifiedName];
748 {
750 continue;
751 }
753 schemaToUpdate.Groups.Insert(xmlSchemaGroup.QualifiedName, xmlSchemaGroup);
755 }
756 else if (items[i] is XmlSchemaAttributeGroup)
757 {
760 xmlSchemaAttributeGroup.QualifiedName.SetNamespace(@namespace);
761 if (redefine.AttributeGroups[xmlSchemaAttributeGroup.QualifiedName] != null)
762 {
764 continue;
765 }
770 {
772 continue;
773 }
777 }
778 else if (items[i] is XmlSchemaComplexType)
779 {
782 xmlSchemaComplexType.QualifiedName.SetNamespace(@namespace);
783 if (redefine.SchemaTypes[xmlSchemaComplexType.QualifiedName] != null)
784 {
786 continue;
787 }
792 {
794 }
796 {
798 schemaToUpdate.SchemaTypes.Insert(xmlSchemaComplexType.QualifiedName, xmlSchemaComplexType);
800 }
801 else
802 {
804 }
805 }
806 else
807 {
808 if (!(items[i] is XmlSchemaSimpleType))
809 {
810 continue;
811 }
814 xmlSchemaSimpleType.QualifiedName.SetNamespace(@namespace);
815 if (redefine.SchemaTypes[xmlSchemaSimpleType.QualifiedName] != null)
816 {
818 continue;
819 }
824 {
826 }
828 {
830 schemaToUpdate.SchemaTypes.Insert(xmlSchemaSimpleType.QualifiedName, xmlSchemaSimpleType);
832 }
833 else
834 {
836 }
837 }
838 }
839 }
840
842 {
844 {
845 return;
846 }
848 for (int i = 0; i < schema.Includes.Count; i++)
849 {
851 if ((xmlSchemaExternal.Compositor == Compositor.Include || xmlSchemaExternal.Compositor == Compositor.Redefine) && xmlSchemaExternal.Schema != null)
852 {
854 }
855 }
856 }
857
859 {
860 XmlSchema xmlSchema = null;
861 while (xmlSchema == null && currentSchemaObject != null)
862 {
865 }
866 return xmlSchema;
867 }
868
870 {
871 if (schema.BlockDefault == XmlSchemaDerivationMethod.All)
872 {
874 }
875 else if (schema.BlockDefault == XmlSchemaDerivationMethod.None)
876 {
878 }
879 else
880 {
881 if (((uint)schema.BlockDefault & 0xFFFFFFF8u) != 0)
882 {
884 }
886 }
887 if (schema.FinalDefault == XmlSchemaDerivationMethod.All)
888 {
890 }
891 else if (schema.FinalDefault == XmlSchemaDerivationMethod.None)
892 {
894 }
895 else
896 {
897 if (((uint)schema.FinalDefault & 0xFFFFFFE1u) != 0)
898 {
900 }
902 }
903 _elementFormDefault = schema.ElementFormDefault;
905 {
907 }
908 _attributeFormDefault = schema.AttributeFormDefault;
910 {
912 }
913 }
914
916 {
917 int num = 0;
918 for (int i = 0; i < items.Count; i++)
919 {
921 {
922 if (xmlSchemaGroupRef.RefName == name)
923 {
925 if (xmlSchemaGroupRef.MinOccurs != 1m || xmlSchemaGroupRef.MaxOccurs != 1m)
926 {
928 }
929 num++;
930 }
931 }
932 else if (items[i] is XmlSchemaGroupBase)
933 {
934 num += CountGroupSelfReference(((XmlSchemaGroupBase)items[i]).Items, name, redefined);
935 }
936 if (num > 1)
937 {
938 break;
939 }
940 }
941 return num;
942 }
943
945 {
946 int num = 0;
947 if (group.Particle != null)
948 {
949 num = CountGroupSelfReference(group.Particle.Items, group.QualifiedName, group.Redefined);
950 }
951 if (num > 1)
952 {
954 }
956 }
957
959 {
960 int num = 0;
961 for (int i = 0; i < attributeGroup.Attributes.Count; i++)
962 {
964 {
965 num++;
966 }
967 }
968 if (num > 1)
969 {
971 }
973 }
974
987
1010
1012 {
1013 if (attribute.Name != null)
1014 {
1016 attribute.SetQualifiedName(new XmlQualifiedName(attribute.Name, _targetNamespace));
1017 }
1018 else
1019 {
1021 }
1022 if (attribute.Use != 0)
1023 {
1025 }
1026 if (attribute.Form != 0)
1027 {
1029 }
1032 }
1033
1035 {
1036 if (attribute.Name != null)
1037 {
1040 attribute.SetQualifiedName(new XmlQualifiedName(attribute.Name, (attribute.Form == XmlSchemaForm.Qualified || (attribute.Form == XmlSchemaForm.None && _attributeFormDefault == XmlSchemaForm.Qualified)) ? _targetNamespace : null));
1041 }
1042 else
1043 {
1045 if (attribute.RefName.IsEmpty)
1046 {
1048 }
1049 else
1050 {
1052 }
1053 if (!attribute.SchemaTypeName.IsEmpty || attribute.SchemaType != null || attribute.Form != 0)
1054 {
1056 }
1057 attribute.SetQualifiedName(attribute.RefName);
1058 }
1060 }
1061
1063 {
1066 {
1068 }
1069 if (!attribute.RefName.IsEmpty)
1070 {
1072 }
1073 if (attribute.DefaultValue != null && attribute.FixedValue != null)
1074 {
1076 }
1077 if (attribute.DefaultValue != null && attribute.Use != XmlSchemaUse.Optional && attribute.Use != 0)
1078 {
1080 }
1081 if (attribute.Name == _xmlns)
1082 {
1084 }
1085 if (attribute.SchemaType != null)
1086 {
1087 SetParent(attribute.SchemaType, attribute);
1088 if (!attribute.SchemaTypeName.IsEmpty)
1089 {
1091 }
1092 PreprocessSimpleType(attribute.SchemaType, local: true);
1093 }
1094 if (!attribute.SchemaTypeName.IsEmpty)
1095 {
1096 ValidateQNameAttribute(attribute, "type", attribute.SchemaTypeName);
1097 }
1098 }
1099
1115
1117 {
1118 if (element.Name != null)
1119 {
1120 ValidateNameAttribute(element);
1122 }
1123 else
1124 {
1126 }
1127 PreprocessElementContent(element);
1128 if (element.Final == XmlSchemaDerivationMethod.All)
1129 {
1131 }
1132 else if (element.Final == XmlSchemaDerivationMethod.None)
1133 {
1135 {
1137 }
1138 else
1139 {
1141 }
1142 }
1143 else
1144 {
1145 if (((uint)element.Final & 0xFFFFFFF9u) != 0)
1146 {
1148 }
1149 element.SetFinalResolved(element.Final & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction));
1150 }
1151 if (element.Form != 0)
1152 {
1154 }
1155 if (element.MinOccursString != null)
1156 {
1157 SendValidationEvent(System.SR.Sch_ForbiddenAttribute, "minOccurs", element);
1158 }
1159 if (element.MaxOccursString != null)
1160 {
1161 SendValidationEvent(System.SR.Sch_ForbiddenAttribute, "maxOccurs", element);
1162 }
1163 if (!element.SubstitutionGroup.IsEmpty)
1164 {
1165 ValidateQNameAttribute(element, "type", element.SubstitutionGroup);
1166 }
1167 ValidateIdAttribute(element);
1168 }
1169
1171 {
1172 if (element.Name != null)
1173 {
1174 ValidateNameAttribute(element);
1175 PreprocessElementContent(element);
1176 element.SetQualifiedName(new XmlQualifiedName(element.Name, (element.Form == XmlSchemaForm.Qualified || (element.Form == XmlSchemaForm.None && _elementFormDefault == XmlSchemaForm.Qualified)) ? _targetNamespace : null));
1177 }
1178 else
1179 {
1180 PreprocessAnnotation(element);
1181 if (element.RefName.IsEmpty)
1182 {
1184 }
1185 else
1186 {
1187 ValidateQNameAttribute(element, "ref", element.RefName);
1188 }
1189 if (!element.SchemaTypeName.IsEmpty || element.HasAbstractAttribute || element.Block != XmlSchemaDerivationMethod.None || element.SchemaType != null || element.HasConstraints || element.DefaultValue != null || element.Form != 0 || element.FixedValue != null || element.HasNillableAttribute)
1190 {
1192 }
1193 if (element.DefaultValue != null && element.FixedValue != null)
1194 {
1196 }
1197 element.SetQualifiedName(element.RefName);
1198 }
1199 if (element.MinOccurs > element.MaxOccurs)
1200 {
1203 }
1204 if (element.HasAbstractAttribute)
1205 {
1207 }
1208 if (element.Final != XmlSchemaDerivationMethod.None)
1209 {
1211 }
1212 if (!element.SubstitutionGroup.IsEmpty)
1213 {
1214 SendValidationEvent(System.SR.Sch_ForbiddenAttribute, "substitutionGroup", element);
1215 }
1216 ValidateIdAttribute(element);
1217 }
1218
1220 {
1221 PreprocessAnnotation(element);
1222 if (!element.RefName.IsEmpty)
1223 {
1225 }
1226 if (element.Block == XmlSchemaDerivationMethod.All)
1227 {
1229 }
1230 else if (element.Block == XmlSchemaDerivationMethod.None)
1231 {
1233 {
1235 }
1236 else
1237 {
1239 }
1240 }
1241 else
1242 {
1243 if (((uint)element.Block & 0xFFFFFFF8u) != 0)
1244 {
1246 }
1247 element.SetBlockResolved(element.Block & (XmlSchemaDerivationMethod.Substitution | XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction));
1248 }
1249 if (element.SchemaType != null)
1250 {
1251 SetParent(element.SchemaType, element);
1252 if (!element.SchemaTypeName.IsEmpty)
1253 {
1255 }
1257 {
1259 }
1260 else
1261 {
1263 }
1264 }
1265 if (!element.SchemaTypeName.IsEmpty)
1266 {
1267 ValidateQNameAttribute(element, "type", element.SchemaTypeName);
1268 }
1269 if (element.DefaultValue != null && element.FixedValue != null)
1270 {
1272 }
1273 for (int i = 0; i < element.Constraints.Count; i++)
1274 {
1278 }
1279 }
1280
1282 {
1283 bool flag = true;
1284 PreprocessAnnotation(constraint);
1285 if (constraint.Name != null)
1286 {
1287 ValidateNameAttribute(constraint);
1288 constraint.SetQualifiedName(new XmlQualifiedName(constraint.Name, _targetNamespace));
1289 }
1290 else
1291 {
1293 flag = false;
1294 }
1295 if (_rootSchema.IdentityConstraints[constraint.QualifiedName] != null)
1296 {
1298 flag = false;
1299 }
1300 else
1301 {
1302 _rootSchema.IdentityConstraints.Add(constraint.QualifiedName, constraint);
1303 }
1304 if (constraint.Selector == null)
1305 {
1307 flag = false;
1308 }
1309 if (constraint.Fields.Count == 0)
1310 {
1312 flag = false;
1313 }
1314 if (constraint is XmlSchemaKeyref)
1315 {
1317 if (xmlSchemaKeyref.Refer.IsEmpty)
1318 {
1320 flag = false;
1321 }
1322 else
1323 {
1325 }
1326 }
1327 if (flag)
1328 {
1329 ValidateIdAttribute(constraint);
1330 ValidateIdAttribute(constraint.Selector);
1331 SetParent(constraint.Selector, constraint);
1332 for (int i = 0; i < constraint.Fields.Count; i++)
1333 {
1334 SetParent(constraint.Fields[i], constraint);
1335 ValidateIdAttribute(constraint.Fields[i]);
1336 }
1337 }
1338 }
1339
1341 {
1342 if (local)
1343 {
1344 if (simpleType.Name != null)
1345 {
1347 }
1348 }
1349 else
1350 {
1351 if (simpleType.Name != null)
1352 {
1354 simpleType.SetQualifiedName(new XmlQualifiedName(simpleType.Name, _targetNamespace));
1355 }
1356 else
1357 {
1359 }
1360 if (simpleType.Final == XmlSchemaDerivationMethod.All)
1361 {
1362 simpleType.SetFinalResolved(XmlSchemaDerivationMethod.All);
1363 }
1364 else if (simpleType.Final == XmlSchemaDerivationMethod.None)
1365 {
1367 {
1368 simpleType.SetFinalResolved(XmlSchemaDerivationMethod.All);
1369 }
1370 else
1371 {
1373 }
1374 }
1375 else
1376 {
1377 if (((uint)simpleType.Final & 0xFFFFFFE1u) != 0)
1378 {
1380 }
1382 }
1383 }
1384 if (simpleType.Content == null)
1385 {
1387 }
1389 {
1392 for (int i = 0; i < xmlSchemaSimpleTypeRestriction.Facets.Count; i++)
1393 {
1395 }
1396 if (xmlSchemaSimpleTypeRestriction.BaseType != null)
1397 {
1398 if (!xmlSchemaSimpleTypeRestriction.BaseTypeName.IsEmpty)
1399 {
1401 }
1403 }
1404 else if (xmlSchemaSimpleTypeRestriction.BaseTypeName.IsEmpty)
1405 {
1407 }
1408 else
1409 {
1411 }
1414 }
1415 else if (simpleType.Content is XmlSchemaSimpleTypeList)
1416 {
1419 if (xmlSchemaSimpleTypeList.ItemType != null)
1420 {
1421 if (!xmlSchemaSimpleTypeList.ItemTypeName.IsEmpty)
1422 {
1424 }
1427 }
1428 else if (xmlSchemaSimpleTypeList.ItemTypeName.IsEmpty)
1429 {
1431 }
1432 else
1433 {
1435 }
1438 }
1439 else
1440 {
1443 int num = xmlSchemaSimpleTypeUnion.BaseTypes.Count;
1444 if (xmlSchemaSimpleTypeUnion.MemberTypes != null)
1445 {
1446 num += xmlSchemaSimpleTypeUnion.MemberTypes.Length;
1448 for (int j = 0; j < memberTypes.Length; j++)
1449 {
1451 }
1452 }
1453 if (num == 0)
1454 {
1456 }
1457 for (int k = 0; k < xmlSchemaSimpleTypeUnion.BaseTypes.Count; k++)
1458 {
1462 }
1465 }
1467 }
1468
1470 {
1471 if (local)
1472 {
1473 if (complexType.Name != null)
1474 {
1476 }
1477 }
1478 else
1479 {
1480 if (complexType.Name != null)
1481 {
1483 complexType.SetQualifiedName(new XmlQualifiedName(complexType.Name, _targetNamespace));
1484 }
1485 else
1486 {
1488 }
1489 if (complexType.Block == XmlSchemaDerivationMethod.All)
1490 {
1491 complexType.SetBlockResolved(XmlSchemaDerivationMethod.All);
1492 }
1493 else if (complexType.Block == XmlSchemaDerivationMethod.None)
1494 {
1495 complexType.SetBlockResolved(_blockDefault & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction));
1496 }
1497 else
1498 {
1499 if (((uint)complexType.Block & 0xFFFFFFF9u) != 0)
1500 {
1502 }
1503 complexType.SetBlockResolved(complexType.Block & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction));
1504 }
1505 if (complexType.Final == XmlSchemaDerivationMethod.All)
1506 {
1507 complexType.SetFinalResolved(XmlSchemaDerivationMethod.All);
1508 }
1509 else if (complexType.Final == XmlSchemaDerivationMethod.None)
1510 {
1512 {
1513 complexType.SetFinalResolved(XmlSchemaDerivationMethod.All);
1514 }
1515 else
1516 {
1517 complexType.SetFinalResolved(_finalDefault & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction));
1518 }
1519 }
1520 else
1521 {
1522 if (((uint)complexType.Final & 0xFFFFFFF9u) != 0)
1523 {
1525 }
1526 complexType.SetFinalResolved(complexType.Final & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction));
1527 }
1528 }
1529 if (complexType.ContentModel != null)
1530 {
1531 SetParent(complexType.ContentModel, complexType);
1532 PreprocessAnnotation(complexType.ContentModel);
1533 if (complexType.Particle == null)
1534 {
1535 _ = complexType.Attributes;
1536 }
1537 if (complexType.ContentModel is XmlSchemaSimpleContent)
1538 {
1540 if (xmlSchemaSimpleContent.Content == null)
1541 {
1542 if (complexType.QualifiedName == XmlQualifiedName.Empty)
1543 {
1545 }
1546 else
1547 {
1548 SendValidationEvent(System.SR.Sch_NoRestOrExtQName, complexType.QualifiedName.Name, complexType.QualifiedName.Namespace, complexType);
1549 }
1550 }
1551 else
1552 {
1556 {
1558 if (xmlSchemaSimpleContentExtension.BaseTypeName.IsEmpty)
1559 {
1561 }
1562 else
1563 {
1565 }
1568 }
1569 else
1570 {
1572 if (xmlSchemaSimpleContentRestriction.BaseTypeName.IsEmpty)
1573 {
1575 }
1576 else
1577 {
1579 }
1580 if (xmlSchemaSimpleContentRestriction.BaseType != null)
1581 {
1584 }
1587 }
1588 }
1590 }
1591 else
1592 {
1594 if (xmlSchemaComplexContent.Content == null)
1595 {
1596 if (complexType.QualifiedName == XmlQualifiedName.Empty)
1597 {
1599 }
1600 else
1601 {
1602 SendValidationEvent(System.SR.Sch_NoRestOrExtQName, complexType.QualifiedName.Name, complexType.QualifiedName.Namespace, complexType);
1603 }
1604 }
1605 else
1606 {
1607 if (!xmlSchemaComplexContent.HasMixedAttribute && complexType.IsMixed)
1608 {
1610 }
1614 {
1616 if (xmlSchemaComplexContentExtension.BaseTypeName.IsEmpty)
1617 {
1619 }
1620 else
1621 {
1623 }
1624 if (xmlSchemaComplexContentExtension.Particle != null)
1625 {
1628 }
1631 }
1632 else
1633 {
1635 if (xmlSchemaComplexContentRestriction.BaseTypeName.IsEmpty)
1636 {
1638 }
1639 else
1640 {
1642 }
1643 if (xmlSchemaComplexContentRestriction.Particle != null)
1644 {
1647 }
1650 }
1652 }
1653 }
1654 }
1655 else
1656 {
1657 if (complexType.Particle != null)
1658 {
1661 }
1662 PreprocessAttributes(complexType.Attributes, complexType.AnyAttribute, complexType);
1663 }
1665 }
1666
1668 {
1669 if (group.Name != null)
1670 {
1672 group.SetQualifiedName(new XmlQualifiedName(group.Name, _targetNamespace));
1673 }
1674 else
1675 {
1677 }
1678 if (group.Particle == null)
1679 {
1681 return;
1682 }
1683 if (group.Particle.MinOccursString != null)
1684 {
1686 }
1687 if (group.Particle.MaxOccursString != null)
1688 {
1690 }
1691 PreprocessParticle(group.Particle);
1694 }
1695
1697 {
1698 if (notation.Name != null)
1699 {
1702 }
1703 else
1704 {
1706 }
1707 if (notation.Public == null && notation.System == null)
1708 {
1710 }
1711 else
1712 {
1713 if (notation.Public != null)
1714 {
1715 try
1716 {
1718 }
1720 {
1721 SendValidationEvent(System.SR.Sch_InvalidPublicAttribute, new string[1] { notation.Public }, innerException, notation);
1722 }
1723 }
1724 if (notation.System != null)
1725 {
1727 }
1728 }
1731 }
1732
1734 {
1735 if (particle is XmlSchemaAll)
1736 {
1737 if (particle.MinOccurs != 0m && particle.MinOccurs != 1m)
1738 {
1741 }
1742 if (particle.MaxOccurs != 1m)
1743 {
1746 }
1747 XmlSchemaObjectCollection items = ((XmlSchemaAll)particle).Items;
1748 for (int i = 0; i < items.Count; i++)
1749 {
1751 if (xmlSchemaElement.MaxOccurs != 0m && xmlSchemaElement.MaxOccurs != 1m)
1752 {
1755 }
1756 SetParent(xmlSchemaElement, particle);
1758 }
1759 }
1760 else
1761 {
1762 if (particle.MinOccurs > particle.MaxOccurs)
1763 {
1764 particle.MinOccurs = particle.MaxOccurs;
1766 }
1767 if (particle is XmlSchemaChoice)
1768 {
1769 XmlSchemaObjectCollection items = ((XmlSchemaChoice)particle).Items;
1770 for (int j = 0; j < items.Count; j++)
1771 {
1772 SetParent(items[j], particle);
1773 if (items[j] is XmlSchemaElement element)
1774 {
1775 PreprocessLocalElement(element);
1776 }
1777 else
1778 {
1780 }
1781 }
1782 }
1783 else if (particle is XmlSchemaSequence)
1784 {
1785 XmlSchemaObjectCollection items = ((XmlSchemaSequence)particle).Items;
1786 for (int k = 0; k < items.Count; k++)
1787 {
1788 SetParent(items[k], particle);
1789 if (items[k] is XmlSchemaElement element2)
1790 {
1792 }
1793 else
1794 {
1796 }
1797 }
1798 }
1799 else if (particle is XmlSchemaGroupRef)
1800 {
1802 if (xmlSchemaGroupRef.RefName.IsEmpty)
1803 {
1805 }
1806 else
1807 {
1809 }
1810 }
1811 else if (particle is XmlSchemaAny)
1812 {
1813 try
1814 {
1815 ((XmlSchemaAny)particle).BuildNamespaceList(_targetNamespace);
1816 }
1817 catch (FormatException ex)
1818 {
1819 SendValidationEvent(System.SR.Sch_InvalidAnyDetailed, new string[1] { ex.Message }, ex, particle);
1820 }
1821 }
1822 }
1823 PreprocessAnnotation(particle);
1824 ValidateIdAttribute(particle);
1825 }
1826
1828 {
1829 for (int i = 0; i < attributes.Count; i++)
1830 {
1831 SetParent(attributes[i], parent);
1832 if (attributes[i] is XmlSchemaAttribute attribute)
1833 {
1835 continue;
1836 }
1838 if (xmlSchemaAttributeGroupRef.RefName.IsEmpty)
1839 {
1841 }
1842 else
1843 {
1845 }
1846 PreprocessAnnotation(attributes[i]);
1847 ValidateIdAttribute(attributes[i]);
1848 }
1849 if (anyAttribute != null)
1850 {
1851 try
1852 {
1853 SetParent(anyAttribute, parent);
1855 anyAttribute.BuildNamespaceList(_targetNamespace);
1856 }
1857 catch (FormatException ex)
1858 {
1859 SendValidationEvent(System.SR.Sch_InvalidAnyDetailed, new string[1] { ex.Message }, ex, anyAttribute);
1860 }
1862 }
1863 }
1864
1866 {
1867 if (xso.IdAttribute != null)
1868 {
1869 try
1870 {
1872 }
1873 catch (XmlException ex)
1874 {
1875 SendValidationEvent(System.SR.Sch_InvalidIdAttribute, new string[1] { ex.Message }, ex, xso);
1876 return;
1877 }
1878 catch (ArgumentNullException)
1879 {
1881 return;
1882 }
1883 try
1884 {
1886 }
1887 catch (ArgumentException)
1888 {
1890 }
1891 }
1892 }
1893
1895 {
1896 string nameAttribute = xso.NameAttribute;
1897 if (nameAttribute == null || nameAttribute.Length == 0)
1898 {
1900 }
1903 if (num != nameAttribute.Length)
1904 {
1906 string msg = System.SR.Format(System.SR.Xml_BadNameCharWithPos, array[0], array[1], num);
1908 }
1909 else
1910 {
1912 }
1913 }
1914
1916 {
1917 try
1918 {
1919 value.Verify();
1920 value.Atomize(base.NameTable);
1921 if (_currentSchema.IsChameleon && value.Namespace.Length == 0)
1922 {
1923 value.SetNamespace(_currentSchema.TargetNamespace);
1924 }
1925 if (_referenceNamespaces[value.Namespace] == null)
1926 {
1928 }
1929 }
1930 catch (FormatException ex)
1931 {
1932 SendValidationEvent(System.SR.Sch_InvalidAttribute, new string[2] { attributeName, ex.Message }, ex, xso);
1933 }
1934 catch (XmlException ex2)
1935 {
1936 SendValidationEvent(System.SR.Sch_InvalidAttribute, new string[2] { attributeName, ex2.Message }, ex2, xso);
1937 }
1938 }
1939
1941 {
1942 if (location.Length == 0)
1943 {
1944 return null;
1945 }
1947 }
1948
1949 private object GetSchemaEntity(Uri ruri)
1950 {
1951 return _xmlResolver.GetEntity(ruri, null, null);
1952 }
1953
1969
1970 private void SetParent(XmlSchemaObject child, XmlSchemaObject parent)
1971 {
1972 child.Parent = parent;
1973 }
1974
1976 {
1978 {
1979 XmlSchemaAnnotation annotation = xmlSchemaAnnotated.Annotation;
1980 if (annotation != null)
1981 {
1982 PreprocessAnnotation(annotation);
1984 }
1985 }
1986 }
1987
1989 {
1990 ValidateIdAttribute(annotation);
1991 for (int i = 0; i < annotation.Items.Count; i++)
1992 {
1993 annotation.Items[i].Parent = annotation;
1994 }
1995 }
1996}
virtual int Add(object? value)
virtual bool Contains(object? item)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
virtual void Add(object key, object? value)
Definition Hashtable.cs:676
virtual ? object GetByIndex(int index)
virtual void Add(object key, object? value)
virtual bool Contains(object key)
static string Sch_MinGtMax
Definition SR.cs:834
static string Sch_MissingPublicSystemAttribute
Definition SR.cs:714
static string Sch_InvalidComplexTypeBlockValue
Definition SR.cs:516
static string Sch_IdConstraintNoFields
Definition SR.cs:840
static string Sch_InvalidComplexTypeFinalValue
Definition SR.cs:518
static string Sch_NoRestOrExtQName
Definition SR.cs:858
static string Sch_InvalidIncludeLocation
Definition SR.cs:1076
static string Sch_InvalidNameAttributeEx
Definition SR.cs:1138
static string Sch_RedefineNoSchema
Definition SR.cs:948
static string Sch_InvalidIdAttribute
Definition SR.cs:1136
static string Sch_DupIdentityConstraint
Definition SR.cs:520
static string Sch_SimpleTypeRestRefBase
Definition SR.cs:848
static string Sch_ComponentRedefineNotFound
Definition SR.cs:804
static string Sch_MultipleAttrGroupSelfRef
Definition SR.cs:828
static string Sch_MissAttribute
Definition SR.cs:428
static string Sch_MinMaxGroupRedefine
Definition SR.cs:824
static string Sch_InvalidNamespace
Definition SR.cs:790
static string Sch_NoRestOrExt
Definition SR.cs:860
static string Sch_ElementNameRef
Definition SR.cs:552
static string Sch_InvalidTypeRedefine
Definition SR.cs:830
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Sch_SimpleTypeUnionNoBase
Definition SR.cs:856
static string Sch_MismatchTargetNamespaceImport
Definition SR.cs:598
static string Sch_MismatchTargetNamespaceInclude
Definition SR.cs:596
static string Sch_SimpleTypeListRefBaseNone
Definition SR.cs:854
static string Sch_InvalidElementBlockValue
Definition SR.cs:510
static string Sch_SimpleTypeDoubleRedefine
Definition SR.cs:818
static string Sch_InvalidPublicAttribute
Definition SR.cs:1126
static string Sch_InvalidSystemAttribute
Definition SR.cs:1128
static string Xml_BadNameCharWithPos
Definition SR.cs:210
static string Sch_InvalidAttribute
Definition SR.cs:1140
static string Sch_NoSimpleTypeContent
Definition SR.cs:846
static string Sch_NullValue
Definition SR.cs:1156
static string Sch_InvalidTargetNamespaceAttribute
Definition SR.cs:792
static string Sch_AttributeNameRef
Definition SR.cs:554
static string Sch_DefaultFixedAttributes
Definition SR.cs:536
static string Sch_ForbiddenAttribute
Definition SR.cs:544
static string Sch_NoGroupParticle
Definition SR.cs:862
static string Sch_DupIdAttribute
Definition SR.cs:934
static string Sch_InvalidAllMin
Definition SR.cs:864
static string Sch_TargetNamespaceXsi
Definition SR.cs:746
static string Sch_InvalidAllElementMax
Definition SR.cs:936
static string Sch_InvalidElementFinalValue
Definition SR.cs:512
static string Sch_MultipleRedefine
Definition SR.cs:1154
static string Sch_InvalidFinalDefaultValue
Definition SR.cs:508
static string Sch_SimpleToComplexTypeRedefine
Definition SR.cs:816
static string Sch_CannotLoadSchemaLocation
Definition SR.cs:1080
static string Sch_InvalidSimpleTypeFinalValue
Definition SR.cs:514
static string Sch_InvalidElementRef
Definition SR.cs:832
static string Sch_MultipleGroupSelfRef
Definition SR.cs:826
static string Sch_XmlNsAttribute
Definition SR.cs:592
static string Sch_AttributeValueDataTypeDetailed
Definition SR.cs:496
static string Sch_SimpleTypeListRefBase
Definition SR.cs:852
static string Sch_ComplexToSimpleTypeRedefine
Definition SR.cs:820
static string Sch_InvalidAllMax
Definition SR.cs:866
static string Sch_ImportTargetNamespace
Definition SR.cs:798
static string Sch_GroupDoubleRedefine
Definition SR.cs:802
static string Sch_MismatchTargetNamespaceEx
Definition SR.cs:600
static string Sch_UnrefNS
Definition SR.cs:1150
static string Sch_InvalidBlockDefaultValue
Definition SR.cs:506
static string Sch_InvalidNamespaceAttribute
Definition SR.cs:794
static string Sch_InvalidCollection
Definition SR.cs:1148
static string Sch_ComplexTypeDoubleRedefine
Definition SR.cs:812
static string Sch_SimpleTypeRestRefBaseNone
Definition SR.cs:850
static string Sch_InvalidAnyDetailed
Definition SR.cs:940
static string Sch_InvalidSchemaLocation
Definition SR.cs:796
static string Sch_AttrGroupDoubleRedefine
Definition SR.cs:808
static string Sch_IdConstraintNoRefer
Definition SR.cs:842
static string Sch_IdConstraintNoSelector
Definition SR.cs:838
static string Sch_TypeMutualExclusive
Definition SR.cs:550
static string Sch_OptionalDefaultAttribute
Definition SR.cs:924
static string Sch_InvalidAttributeRef
Definition SR.cs:922
static string Sch_MissRequiredAttribute
Definition SR.cs:490
Definition SR.cs:7
static int CompareExchange(ref int location1, int value, int comparand)
static void Exit(object obj)
static void Enter(object obj)
static ? Type GetType(string typeName, bool throwOnError, bool ignoreCase)
Definition Type.cs:408
static bool Equal(string strA, string strB)
Definition Ref.cs:5
void SendValidationEvent(string code, XmlSchemaObject source)
void AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item)
static XmlSchemaSimpleType GetSimpleTypeFromTypeCode(XmlTypeCode typeCode)
void LoadExternals(XmlSchema schema)
void PreprocessLocalElement(XmlSchemaElement element)
void PreprocessAnnotation(XmlSchemaObject schemaObject)
void PreprocessAttributes(XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaObject parent)
void Preprocess(XmlSchema schema, string targetNamespace, ArrayList imports)
void PreprocessElementContent(XmlSchemaElement element)
int CountGroupSelfReference(XmlSchemaObjectCollection items, XmlQualifiedName name, XmlSchemaGroup redefined)
XmlSchema GetChameleonSchema(string targetNamespace, XmlSchema schema)
void PreprocessAttributeContent(XmlSchemaAttribute attribute)
void ValidateNameAttribute(XmlSchemaObject xso)
void ParseUri(string uri, string code, XmlSchemaObject sourceSchemaObject)
void PreprocessLocalAttribute(XmlSchemaAttribute attribute)
Preprocessor(XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler, XmlSchemaCompilationSettings compilationSettings)
static XmlSchema GetBuildInSchema()
void CheckRefinedComplexType(XmlSchemaComplexType ctype)
void CheckRefinedGroup(XmlSchemaGroup group)
readonly Hashtable _processedExternals
void SetSchemaDefaults(XmlSchema schema)
void PreprocessRedefine(RedefineEntry redefineEntry)
Uri ResolveSchemaLocationUri(XmlSchema enclosingSchema, string location)
void BuildSchemaList(XmlSchema schema)
XmlSchemaDerivationMethod _blockDefault
void PreprocessIdentityConstraint(XmlSchemaIdentityConstraint constraint)
void PreprocessAttribute(XmlSchemaAttribute attribute)
static XmlSchema GetParentSchema(XmlSchemaObject currentSchemaObject)
XmlReaderSettings ReaderSettings
void PreprocessParticle(XmlSchemaParticle particle)
void SetParent(XmlSchemaObject child, XmlSchemaObject parent)
void CheckRefinedSimpleType(XmlSchemaSimpleType stype)
readonly SortedList _lockList
void BuildRefNamespaces(XmlSchema schema)
void PreprocessSimpleType(XmlSchemaSimpleType simpleType, bool local)
void PreprocessGroup(XmlSchemaGroup group)
void PreprocessElement(XmlSchemaElement element)
void Cleanup(XmlSchema schema)
void PreprocessNotation(XmlSchemaNotation notation)
void ValidateIdAttribute(XmlSchemaObject xso)
void GetIncludedSet(XmlSchema schema, ArrayList includesList)
XmlSchemaDerivationMethod _finalDefault
static XmlSchema s_builtInSchemaForXmlNS
void CheckRefinedAttributeGroup(XmlSchemaAttributeGroup attributeGroup)
XmlReaderSettings _readerSettings
void ValidateQNameAttribute(XmlSchemaObject xso, string attributeName, XmlQualifiedName value)
void PreprocessAnnotation(XmlSchemaAnnotation annotation)
void PreprocessComplexType(XmlSchemaComplexType complexType, bool local)
void CopyIncludedComponents(XmlSchema includedSchema, XmlSchema schema)
bool Execute(XmlSchema schema, string targetNamespace, bool loadExternals)
Preprocessor(XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler)
readonly Hashtable _referenceNamespaces
void PreprocessAttributeGroup(XmlSchemaAttributeGroup attributeGroup)
void CleanupRedefine(XmlSchemaExternal include)
Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue)
XmlSchemaDerivationMethod Final
void SetBlockResolved(XmlSchemaDerivationMethod value)
XmlSchemaDerivationMethod Block
XmlSchemaObjectCollection Constraints
void SetFinalResolved(XmlSchemaDerivationMethod value)
void SetQualifiedName(XmlQualifiedName value)
void Insert(XmlQualifiedName name, XmlSchemaObject value)
void Add(XmlQualifiedName name, XmlSchemaObject value)
XmlSchemaObjectTable SchemaTypes
Definition XmlSchema.cs:256
XmlSchemaObjectTable AttributeGroups
Definition XmlSchema.cs:243
XmlSchemaObjectTable Groups
Definition XmlSchema.cs:307
XmlSchemaObjectTable IdentityConstraints
Definition XmlSchema.cs:313
static int ParseNCName(string s, int offset)
static string NonCDataNormalize(string value)
static ? string VerifyTOKEN(string? token)
static string VerifyNCName(string name)
static Uri ToUri(string s)
static string[] BuildCharExceptionArgs(string data, int invCharIndex)
static readonly XmlQualifiedName Empty
static XmlReader Create(string inputUri)
object? GetEntity(Uri absoluteUri, string? role, Type? ofObjectToReturn)
virtual Uri ResolveUri(Uri? baseUri, string? relativeUri)