Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XsdBuilder.cs
Go to the documentation of this file.
3
4namespace System.Xml.Schema;
5
6internal sealed class XsdBuilder : SchemaBuilder
7{
59
61
63
65
66 private sealed class XsdAttributeEntry
67 {
69
70 public XsdBuildFunction BuildFunc;
71
72 public XsdAttributeEntry(SchemaNames.Token a, XsdBuildFunction build)
73 {
74 Attribute = a;
76 }
77 }
78
79 private sealed class XsdEntry
80 {
82
84
85 public State[] NextStates;
86
88
89 public XsdInitFunction InitFunc;
90
91 public XsdEndChildFunction EndChildFunc;
92
93 public bool ParseContent;
94
95 public XsdEntry(SchemaNames.Token n, State state, State[] nextStates, XsdAttributeEntry[] attributes, XsdInitFunction init, XsdEndChildFunction end, bool parseContent)
96 {
97 Name = n;
100 Attributes = attributes;
101 InitFunc = init;
102 EndChildFunc = end;
104 }
105 }
106
108 {
109 private readonly XmlNamespaceManager _nsMgr;
110
111 private readonly XmlReader _reader;
112
114 {
115 _nsMgr = nsMgr;
116 _reader = reader;
117 }
118
119 public override string LookupNamespace(string prefix)
120 {
122 if (text == null)
123 {
125 }
126 return text;
127 }
128 }
129
130 private static readonly State[] s_schemaElement = new State[1] { State.Schema };
131
132 private static readonly State[] s_schemaSubelements = new State[11]
133 {
134 State.Annotation,
135 State.Include,
136 State.Import,
137 State.Redefine,
138 State.ComplexType,
139 State.SimpleType,
140 State.Element,
141 State.Attribute,
142 State.AttributeGroup,
143 State.Group,
145 };
146
147 private static readonly State[] s_attributeSubelements = new State[2]
148 {
149 State.Annotation,
151 };
152
153 private static readonly State[] s_elementSubelements = new State[6]
154 {
155 State.Annotation,
156 State.SimpleType,
157 State.ComplexType,
158 State.Unique,
159 State.Key,
161 };
162
163 private static readonly State[] s_complexTypeSubelements = new State[10]
164 {
165 State.Annotation,
166 State.SimpleContent,
167 State.ComplexContent,
168 State.GroupRef,
169 State.All,
170 State.Choice,
171 State.Sequence,
172 State.Attribute,
173 State.AttributeGroupRef,
175 };
176
177 private static readonly State[] s_simpleContentSubelements = new State[3]
178 {
179 State.Annotation,
180 State.SimpleContentRestriction,
182 };
183
184 private static readonly State[] s_simpleContentExtensionSubelements = new State[4]
185 {
186 State.Annotation,
187 State.Attribute,
188 State.AttributeGroupRef,
190 };
191
192 private static readonly State[] s_simpleContentRestrictionSubelements = new State[17]
193 {
194 State.Annotation,
195 State.SimpleType,
196 State.Enumeration,
197 State.Length,
198 State.MaxExclusive,
199 State.MaxInclusive,
200 State.MaxLength,
201 State.MinExclusive,
202 State.MinInclusive,
203 State.MinLength,
204 State.Pattern,
205 State.TotalDigits,
206 State.FractionDigits,
207 State.WhiteSpace,
208 State.Attribute,
209 State.AttributeGroupRef,
211 };
212
213 private static readonly State[] s_complexContentSubelements = new State[3]
214 {
215 State.Annotation,
216 State.ComplexContentRestriction,
218 };
219
220 private static readonly State[] s_complexContentExtensionSubelements = new State[8]
221 {
222 State.Annotation,
223 State.GroupRef,
224 State.All,
225 State.Choice,
226 State.Sequence,
227 State.Attribute,
228 State.AttributeGroupRef,
230 };
231
232 private static readonly State[] s_complexContentRestrictionSubelements = new State[8]
233 {
234 State.Annotation,
235 State.GroupRef,
236 State.All,
237 State.Choice,
238 State.Sequence,
239 State.Attribute,
240 State.AttributeGroupRef,
242 };
243
244 private static readonly State[] s_simpleTypeSubelements = new State[4]
245 {
246 State.Annotation,
247 State.SimpleTypeList,
248 State.SimpleTypeRestriction,
250 };
251
252 private static readonly State[] s_simpleTypeRestrictionSubelements = new State[14]
253 {
254 State.Annotation,
255 State.SimpleType,
256 State.Enumeration,
257 State.Length,
258 State.MaxExclusive,
259 State.MaxInclusive,
260 State.MaxLength,
261 State.MinExclusive,
262 State.MinInclusive,
263 State.MinLength,
264 State.Pattern,
265 State.TotalDigits,
266 State.FractionDigits,
268 };
269
270 private static readonly State[] s_simpleTypeListSubelements = new State[2]
271 {
272 State.Annotation,
274 };
275
276 private static readonly State[] s_simpleTypeUnionSubelements = new State[2]
277 {
278 State.Annotation,
280 };
281
282 private static readonly State[] s_redefineSubelements = new State[5]
283 {
284 State.Annotation,
285 State.AttributeGroup,
286 State.ComplexType,
287 State.Group,
289 };
290
291 private static readonly State[] s_attributeGroupSubelements = new State[4]
292 {
293 State.Annotation,
294 State.Attribute,
295 State.AttributeGroupRef,
297 };
298
299 private static readonly State[] s_groupSubelements = new State[4]
300 {
301 State.Annotation,
302 State.All,
303 State.Choice,
305 };
306
307 private static readonly State[] s_allSubelements = new State[2]
308 {
309 State.Annotation,
311 };
312
313 private static readonly State[] s_choiceSequenceSubelements = new State[6]
314 {
315 State.Annotation,
316 State.Element,
317 State.GroupRef,
318 State.Choice,
319 State.Sequence,
321 };
322
323 private static readonly State[] s_identityConstraintSubelements = new State[3]
324 {
325 State.Annotation,
326 State.Selector,
328 };
329
330 private static readonly State[] s_annotationSubelements = new State[2]
331 {
332 State.AppInfo,
334 };
335
336 private static readonly State[] s_annotatedSubelements = new State[1] { State.Annotation };
337
348
360
378
388
393
399
405
411
417
423
430
436
442
448
454
460
466
474
481
490
497
503
509
517
523
530
537
544
550
551 private static readonly XsdAttributeEntry[] s_appinfoAttributes = new XsdAttributeEntry[1]
552 {
554 };
555
561
563 {
565 };
566
567 private static readonly XsdEntry[] s_schemaEntries = new XsdEntry[48]
568 {
569 new XsdEntry(SchemaNames.Token.Empty, State.Root, s_schemaElement, null, null, null, parseContent: true),
602 new XsdEntry(SchemaNames.Token.XsdMinExclusive, State.MinExclusive, s_annotatedSubelements, s_facetAttributes, InitFacet, null, parseContent: true),
603 new XsdEntry(SchemaNames.Token.XsdMinInclusive, State.MinInclusive, s_annotatedSubelements, s_facetAttributes, InitFacet, null, parseContent: true),
604 new XsdEntry(SchemaNames.Token.XsdMaxExclusive, State.MaxExclusive, s_annotatedSubelements, s_facetAttributes, InitFacet, null, parseContent: true),
605 new XsdEntry(SchemaNames.Token.XsdMaxInclusive, State.MaxInclusive, s_annotatedSubelements, s_facetAttributes, InitFacet, null, parseContent: true),
606 new XsdEntry(SchemaNames.Token.XsdTotalDigits, State.TotalDigits, s_annotatedSubelements, s_facetAttributes, InitFacet, null, parseContent: true),
607 new XsdEntry(SchemaNames.Token.XsdFractionDigits, State.FractionDigits, s_annotatedSubelements, s_facetAttributes, InitFacet, null, parseContent: true),
611 new XsdEntry(SchemaNames.Token.XsdEnumeration, State.Enumeration, s_annotatedSubelements, s_facetAttributes, InitFacet, null, parseContent: true),
613 new XsdEntry(SchemaNames.Token.XsdWhitespace, State.WhiteSpace, s_annotatedSubelements, s_facetAttributes, InitFacet, null, parseContent: true),
614 new XsdEntry(SchemaNames.Token.XsdAppInfo, State.AppInfo, null, s_appinfoAttributes, InitAppinfo, EndAppinfo, parseContent: false),
615 new XsdEntry(SchemaNames.Token.XsdDocumentation, State.Documentation, null, s_documentationAttributes, InitDocumentation, EndDocumentation, parseContent: false),
617 };
618
619 private static readonly int[] s_derivationMethodValues = new int[6] { 1, 2, 4, 8, 16, 255 };
620
621 private static readonly string[] s_derivationMethodStrings = new string[6] { "substitution", "extension", "restriction", "list", "union", "#all" };
622
623 private static readonly string[] s_formStringValues = new string[2] { "qualified", "unqualified" };
624
625 private static readonly string[] s_useStringValues = new string[3] { "optional", "prohibited", "required" };
626
627 private static readonly string[] s_processContentsStringValues = new string[3] { "skip", "lax", "strict" };
628
629 private readonly XmlReader _reader;
630
631 private readonly PositionInfo _positionInfo;
632
634
636
637 private bool _hasChild;
638
639 private readonly HWStack _stateHistory = new HWStack(10);
640
642
643 private readonly XmlNameTable _nameTable;
644
645 private readonly SchemaNames _schemaNames;
646
648
649 private bool _canIncludeImport;
650
651 private readonly XmlSchema _schema;
652
654
656
658
660
662
664
666
668
670
672
674
676
678
680
682
684
686
688
690
692
694
696
698
700
702
704
706
708
710
712
714
716
718
719 private XmlNode[] _markup;
720
722
723 private readonly ValidationEventHandler _validationEventHandler;
724
726
728
730
732
734
747
748 internal override bool ProcessElement(string prefix, string name, string ns)
749 {
752 {
753 Push();
754 _xso = null;
755 _currentEntry.InitFunc(this, null);
757 return true;
758 }
760 {
762 }
763 return false;
764 }
765
766 internal override void ProcessAttribute(string prefix, string name, string ns, string value)
767 {
769 if (_currentEntry.Attributes != null)
770 {
771 for (int i = 0; i < _currentEntry.Attributes.Length; i++)
772 {
775 {
776 try
777 {
778 xsdAttributeEntry.BuildFunc(this, value);
779 return;
780 }
781 catch (XmlSchemaException ex)
782 {
784 SendValidationEvent(System.SR.Sch_InvalidXsdAttributeDatatypeValue, new string[2] { name, ex.Message }, XmlSeverityType.Error);
785 return;
786 }
787 }
788 }
789 }
790 if (ns != _schemaNames.NsXs && ns.Length != 0)
791 {
792 if (ns == _schemaNames.NsXmlNs)
793 {
794 if (_namespaces == null)
795 {
797 }
798 _namespaces.Add(new XmlQualifiedName((name == _schemaNames.QnXmlNs.Name) ? string.Empty : name, value));
799 }
800 else
801 {
805 }
806 }
807 else
808 {
810 }
811 }
812
813 internal override bool IsContentParsed()
814 {
816 }
817
818 internal override void ProcessMarkup(XmlNode[] markup)
819 {
820 _markup = markup;
821 }
822
823 internal override void ProcessCData(string value)
824 {
826 }
827
828 internal override void StartChildren()
829 {
830 if (_xso != null)
831 {
832 if (_namespaces != null && _namespaces.Count > 0)
833 {
835 _namespaces = null;
836 }
838 {
841 }
842 }
843 }
844
845 internal override void EndChildren()
846 {
847 if (_currentEntry.EndChildFunc != null)
848 {
850 }
851 Pop();
852 }
853
854 private void Push()
855 {
860 if (_currentEntry.Name != SchemaNames.Token.XsdAnnotation)
861 {
862 _hasChild = false;
863 }
864 }
865
866 private void Pop()
867 {
870 _hasChild = true;
871 }
872
874 {
875 XmlSchemaObject result = null;
876 switch (state)
877 {
878 case State.Schema:
879 result = _schema;
880 break;
881 case State.Annotation:
882 result = _annotation;
883 break;
884 case State.Include:
885 result = _include;
886 break;
887 case State.Import:
888 result = _import;
889 break;
890 case State.Element:
891 result = _element;
892 break;
893 case State.Attribute:
894 result = _attribute;
895 break;
896 case State.AttributeGroup:
897 result = _attributeGroup;
898 break;
899 case State.AttributeGroupRef:
900 result = _attributeGroupRef;
901 break;
902 case State.AnyAttribute:
903 result = _anyAttribute;
904 break;
905 case State.Group:
906 result = _group;
907 break;
908 case State.GroupRef:
909 result = _groupRef;
910 break;
911 case State.All:
912 result = _all;
913 break;
914 case State.Choice:
915 result = _choice;
916 break;
917 case State.Sequence:
918 result = _sequence;
919 break;
920 case State.Any:
921 result = _anyElement;
922 break;
923 case State.Notation:
924 result = _notation;
925 break;
926 case State.SimpleType:
927 result = _simpleType;
928 break;
929 case State.ComplexType:
930 result = _complexType;
931 break;
932 case State.ComplexContent:
933 result = _complexContent;
934 break;
935 case State.ComplexContentExtension:
937 break;
938 case State.ComplexContentRestriction:
940 break;
941 case State.SimpleContent:
942 result = _simpleContent;
943 break;
944 case State.SimpleContentExtension:
946 break;
947 case State.SimpleContentRestriction:
949 break;
950 case State.SimpleTypeUnion:
951 result = _simpleTypeUnion;
952 break;
953 case State.SimpleTypeList:
954 result = _simpleTypeList;
955 break;
956 case State.SimpleTypeRestriction:
957 result = _simpleTypeRestriction;
958 break;
959 case State.Unique:
960 case State.Key:
961 case State.KeyRef:
962 result = _identityConstraint;
963 break;
964 case State.Selector:
965 case State.Field:
966 result = _xpath;
967 break;
968 case State.MinExclusive:
969 case State.MinInclusive:
970 case State.MaxExclusive:
971 case State.MaxInclusive:
972 case State.TotalDigits:
973 case State.FractionDigits:
974 case State.Length:
975 case State.MinLength:
976 case State.MaxLength:
977 case State.Enumeration:
978 case State.Pattern:
979 case State.WhiteSpace:
980 result = _facet;
981 break;
982 case State.AppInfo:
983 result = _appInfo;
984 break;
985 case State.Documentation:
986 result = _documentation;
987 break;
988 case State.Redefine:
989 result = _redefine;
990 break;
991 }
992 return result;
993 }
994
995 private void SetContainer(State state, object container)
996 {
997 switch (state)
998 {
999 case State.Annotation:
1000 _annotation = (XmlSchemaAnnotation)container;
1001 break;
1002 case State.Include:
1003 _include = (XmlSchemaInclude)container;
1004 break;
1005 case State.Import:
1006 _import = (XmlSchemaImport)container;
1007 break;
1008 case State.Element:
1009 _element = (XmlSchemaElement)container;
1010 break;
1011 case State.Attribute:
1012 _attribute = (XmlSchemaAttribute)container;
1013 break;
1014 case State.AttributeGroup:
1016 break;
1017 case State.AttributeGroupRef:
1019 break;
1020 case State.AnyAttribute:
1022 break;
1023 case State.Group:
1024 _group = (XmlSchemaGroup)container;
1025 break;
1026 case State.GroupRef:
1027 _groupRef = (XmlSchemaGroupRef)container;
1028 break;
1029 case State.All:
1030 _all = (XmlSchemaAll)container;
1031 break;
1032 case State.Choice:
1033 _choice = (XmlSchemaChoice)container;
1034 break;
1035 case State.Sequence:
1036 _sequence = (XmlSchemaSequence)container;
1037 break;
1038 case State.Any:
1039 _anyElement = (XmlSchemaAny)container;
1040 break;
1041 case State.Notation:
1042 _notation = (XmlSchemaNotation)container;
1043 break;
1044 case State.SimpleType:
1045 _simpleType = (XmlSchemaSimpleType)container;
1046 break;
1047 case State.ComplexType:
1049 break;
1050 case State.ComplexContent:
1052 break;
1053 case State.ComplexContentExtension:
1055 break;
1056 case State.ComplexContentRestriction:
1058 break;
1059 case State.SimpleContent:
1061 break;
1062 case State.SimpleContentExtension:
1064 break;
1065 case State.SimpleContentRestriction:
1067 break;
1068 case State.SimpleTypeUnion:
1070 break;
1071 case State.SimpleTypeList:
1073 break;
1074 case State.SimpleTypeRestriction:
1076 break;
1077 case State.Unique:
1078 case State.Key:
1079 case State.KeyRef:
1081 break;
1082 case State.Selector:
1083 case State.Field:
1084 _xpath = (XmlSchemaXPath)container;
1085 break;
1086 case State.MinExclusive:
1087 case State.MinInclusive:
1088 case State.MaxExclusive:
1089 case State.MaxInclusive:
1090 case State.TotalDigits:
1091 case State.FractionDigits:
1092 case State.Length:
1093 case State.MinLength:
1094 case State.MaxLength:
1095 case State.Enumeration:
1096 case State.Pattern:
1097 case State.WhiteSpace:
1098 _facet = (XmlSchemaFacet)container;
1099 break;
1100 case State.AppInfo:
1101 _appInfo = (XmlSchemaAppInfo)container;
1102 break;
1103 case State.Documentation:
1105 break;
1106 case State.Redefine:
1107 _redefine = (XmlSchemaRedefine)container;
1108 break;
1109 case State.Root:
1110 case State.Schema:
1111 break;
1112 }
1113 }
1114
1115 private static void BuildAnnotated_Id(XsdBuilder builder, string value)
1116 {
1118 }
1119
1121 {
1123 }
1124
1126 {
1128 }
1129
1134
1135 private static void BuildSchema_Version(XsdBuilder builder, string value)
1136 {
1138 }
1139
1141 {
1142 builder._schema.FinalDefault = (XmlSchemaDerivationMethod)builder.ParseBlockFinalEnum(value, "finalDefault");
1143 }
1144
1146 {
1147 builder._schema.BlockDefault = (XmlSchemaDerivationMethod)builder.ParseBlockFinalEnum(value, "blockDefault");
1148 }
1149
1150 private static void InitSchema(XsdBuilder builder, string value)
1151 {
1153 builder._xso = builder._schema;
1154 }
1155
1156 private static void InitInclude(XsdBuilder builder, string value)
1157 {
1158 if (!builder._canIncludeImport)
1159 {
1160 builder.SendValidationEvent(System.SR.Sch_IncludeLocation, null);
1161 }
1163 builder._schema.Includes.Add(builder._include);
1164 }
1165
1170
1171 private static void InitImport(XsdBuilder builder, string value)
1172 {
1173 if (!builder._canIncludeImport)
1174 {
1175 builder.SendValidationEvent(System.SR.Sch_ImportLocation, null);
1176 }
1178 builder._schema.Includes.Add(builder._import);
1179 }
1180
1181 private static void BuildImport_Namespace(XsdBuilder builder, string value)
1182 {
1184 }
1185
1190
1191 private static void InitRedefine(XsdBuilder builder, string value)
1192 {
1193 if (!builder._canIncludeImport)
1194 {
1195 builder.SendValidationEvent(System.SR.Sch_RedefineLocation, null);
1196 }
1198 builder._schema.Includes.Add(builder._redefine);
1199 }
1200
1205
1206 private static void EndRedefine(XsdBuilder builder)
1207 {
1209 }
1210
1211 private static void InitAttribute(XsdBuilder builder, string value)
1212 {
1214 if (builder.ParentElement == SchemaNames.Token.XsdSchema)
1215 {
1216 builder._schema.Items.Add(builder._attribute);
1217 }
1218 else
1219 {
1220 builder.AddAttribute(builder._attribute);
1221 }
1223 }
1224
1225 private static void BuildAttribute_Default(XsdBuilder builder, string value)
1226 {
1228 }
1229
1230 private static void BuildAttribute_Fixed(XsdBuilder builder, string value)
1231 {
1233 }
1234
1235 private static void BuildAttribute_Form(XsdBuilder builder, string value)
1236 {
1238 }
1239
1240 private static void BuildAttribute_Use(XsdBuilder builder, string value)
1241 {
1243 }
1244
1245 private static void BuildAttribute_Ref(XsdBuilder builder, string value)
1246 {
1247 builder._attribute.RefName = builder.ParseQName(value, "ref");
1248 }
1249
1250 private static void BuildAttribute_Name(XsdBuilder builder, string value)
1251 {
1253 }
1254
1255 private static void BuildAttribute_Type(XsdBuilder builder, string value)
1256 {
1257 builder._attribute.SchemaTypeName = builder.ParseQName(value, "type");
1258 }
1259
1260 private static void InitElement(XsdBuilder builder, string value)
1261 {
1264 switch (builder.ParentElement)
1265 {
1266 case SchemaNames.Token.XsdSchema:
1267 builder._schema.Items.Add(builder._element);
1268 break;
1269 case SchemaNames.Token.XsdAll:
1270 builder._all.Items.Add(builder._element);
1271 break;
1272 case SchemaNames.Token.XsdChoice:
1273 builder._choice.Items.Add(builder._element);
1274 break;
1275 case SchemaNames.Token.XsdSequence:
1276 builder._sequence.Items.Add(builder._element);
1277 break;
1278 }
1279 }
1280
1281 private static void BuildElement_Abstract(XsdBuilder builder, string value)
1282 {
1283 builder._element.IsAbstract = builder.ParseBoolean(value, "abstract");
1284 }
1285
1286 private static void BuildElement_Block(XsdBuilder builder, string value)
1287 {
1288 builder._element.Block = (XmlSchemaDerivationMethod)builder.ParseBlockFinalEnum(value, "block");
1289 }
1290
1291 private static void BuildElement_Default(XsdBuilder builder, string value)
1292 {
1294 }
1295
1296 private static void BuildElement_Form(XsdBuilder builder, string value)
1297 {
1299 }
1300
1302 {
1303 builder._element.SubstitutionGroup = builder.ParseQName(value, "substitutionGroup");
1304 }
1305
1306 private static void BuildElement_Final(XsdBuilder builder, string value)
1307 {
1308 builder._element.Final = (XmlSchemaDerivationMethod)builder.ParseBlockFinalEnum(value, "final");
1309 }
1310
1311 private static void BuildElement_Fixed(XsdBuilder builder, string value)
1312 {
1314 }
1315
1316 private static void BuildElement_MaxOccurs(XsdBuilder builder, string value)
1317 {
1318 builder.SetMaxOccurs(builder._element, value);
1319 }
1320
1321 private static void BuildElement_MinOccurs(XsdBuilder builder, string value)
1322 {
1323 builder.SetMinOccurs(builder._element, value);
1324 }
1325
1326 private static void BuildElement_Name(XsdBuilder builder, string value)
1327 {
1329 }
1330
1331 private static void BuildElement_Nillable(XsdBuilder builder, string value)
1332 {
1333 builder._element.IsNillable = builder.ParseBoolean(value, "nillable");
1334 }
1335
1336 private static void BuildElement_Ref(XsdBuilder builder, string value)
1337 {
1338 builder._element.RefName = builder.ParseQName(value, "ref");
1339 }
1340
1341 private static void BuildElement_Type(XsdBuilder builder, string value)
1342 {
1343 builder._element.SchemaTypeName = builder.ParseQName(value, "type");
1344 }
1345
1346 private static void InitSimpleType(XsdBuilder builder, string value)
1347 {
1349 switch (builder.ParentElement)
1350 {
1351 case SchemaNames.Token.XsdSchema:
1353 builder._schema.Items.Add(builder._simpleType);
1354 break;
1355 case SchemaNames.Token.XsdRedefine:
1356 builder._redefine.Items.Add(builder._simpleType);
1357 break;
1358 case SchemaNames.Token.XsdAttribute:
1359 if (builder._attribute.SchemaType != null)
1360 {
1361 builder.SendValidationEvent(System.SR.Sch_DupXsdElement, "simpleType");
1362 }
1364 break;
1365 case SchemaNames.Token.XsdElement:
1366 if (builder._element.SchemaType != null)
1367 {
1368 builder.SendValidationEvent(System.SR.Sch_DupXsdElement, "simpleType");
1369 }
1370 if (builder._element.Constraints.Count != 0)
1371 {
1372 builder.SendValidationEvent(System.SR.Sch_TypeAfterConstraints, null);
1373 }
1375 break;
1376 case SchemaNames.Token.XsdSimpleTypeList:
1377 if (builder._simpleTypeList.ItemType != null)
1378 {
1379 builder.SendValidationEvent(System.SR.Sch_DupXsdElement, "simpleType");
1380 }
1382 break;
1383 case SchemaNames.Token.XsdSimpleTypeRestriction:
1384 if (builder._simpleTypeRestriction.BaseType != null)
1385 {
1386 builder.SendValidationEvent(System.SR.Sch_DupXsdElement, "simpleType");
1387 }
1389 break;
1390 case SchemaNames.Token.XsdSimpleContentRestriction:
1391 if (builder._simpleContentRestriction.BaseType != null)
1392 {
1393 builder.SendValidationEvent(System.SR.Sch_DupXsdElement, "simpleType");
1394 }
1395 if (builder._simpleContentRestriction.Attributes.Count != 0 || builder._simpleContentRestriction.AnyAttribute != null || builder._simpleContentRestriction.Facets.Count != 0)
1396 {
1397 builder.SendValidationEvent(System.SR.Sch_SimpleTypeRestriction, null);
1398 }
1400 break;
1401 case SchemaNames.Token.XsdSimpleTypeUnion:
1402 builder._simpleTypeUnion.BaseTypes.Add(builder._simpleType);
1403 break;
1404 }
1405 }
1406
1407 private static void BuildSimpleType_Name(XsdBuilder builder, string value)
1408 {
1410 }
1411
1412 private static void BuildSimpleType_Final(XsdBuilder builder, string value)
1413 {
1414 builder._simpleType.Final = (XmlSchemaDerivationMethod)builder.ParseBlockFinalEnum(value, "final");
1415 }
1416
1417 private static void InitSimpleTypeUnion(XsdBuilder builder, string value)
1418 {
1419 if (builder._simpleType.Content != null)
1420 {
1421 builder.SendValidationEvent(System.SR.Sch_DupSimpleTypeChild, null);
1422 }
1424 builder._simpleType.Content = builder._simpleTypeUnion;
1425 }
1426
1428 {
1430 try
1431 {
1432 builder._simpleTypeUnion.MemberTypes = (XmlQualifiedName[])xmlSchemaDatatype.ParseValue(value, builder._nameTable, builder._namespaceManager);
1433 }
1434 catch (XmlSchemaException ex)
1435 {
1436 ex.SetSource(builder._reader.BaseURI, builder._positionInfo.LineNumber, builder._positionInfo.LinePosition);
1437 builder.SendValidationEvent(ex);
1438 }
1439 }
1440
1441 private static void InitSimpleTypeList(XsdBuilder builder, string value)
1442 {
1443 if (builder._simpleType.Content != null)
1444 {
1445 builder.SendValidationEvent(System.SR.Sch_DupSimpleTypeChild, null);
1446 }
1448 builder._simpleType.Content = builder._simpleTypeList;
1449 }
1450
1452 {
1453 builder._simpleTypeList.ItemTypeName = builder.ParseQName(value, "itemType");
1454 }
1455
1457 {
1458 if (builder._simpleType.Content != null)
1459 {
1460 builder.SendValidationEvent(System.SR.Sch_DupSimpleTypeChild, null);
1461 }
1463 builder._simpleType.Content = builder._simpleTypeRestriction;
1464 }
1465
1467 {
1469 }
1470
1471 private static void InitComplexType(XsdBuilder builder, string value)
1472 {
1474 switch (builder.ParentElement)
1475 {
1476 case SchemaNames.Token.XsdSchema:
1478 builder._schema.Items.Add(builder._complexType);
1479 break;
1480 case SchemaNames.Token.XsdRedefine:
1481 builder._redefine.Items.Add(builder._complexType);
1482 break;
1483 case SchemaNames.Token.XsdElement:
1484 if (builder._element.SchemaType != null)
1485 {
1486 builder.SendValidationEvent(System.SR.Sch_DupElement, "complexType");
1487 }
1488 if (builder._element.Constraints.Count != 0)
1489 {
1490 builder.SendValidationEvent(System.SR.Sch_TypeAfterConstraints, null);
1491 }
1492 builder._element.SchemaType = builder._complexType;
1493 break;
1494 }
1495 }
1496
1498 {
1499 builder._complexType.IsAbstract = builder.ParseBoolean(value, "abstract");
1500 }
1501
1502 private static void BuildComplexType_Block(XsdBuilder builder, string value)
1503 {
1504 builder._complexType.Block = (XmlSchemaDerivationMethod)builder.ParseBlockFinalEnum(value, "block");
1505 }
1506
1507 private static void BuildComplexType_Final(XsdBuilder builder, string value)
1508 {
1509 builder._complexType.Final = (XmlSchemaDerivationMethod)builder.ParseBlockFinalEnum(value, "final");
1510 }
1511
1512 private static void BuildComplexType_Mixed(XsdBuilder builder, string value)
1513 {
1514 builder._complexType.IsMixed = builder.ParseBoolean(value, "mixed");
1515 }
1516
1517 private static void BuildComplexType_Name(XsdBuilder builder, string value)
1518 {
1520 }
1521
1522 private static void InitComplexContent(XsdBuilder builder, string value)
1523 {
1524 if (builder._complexType.ContentModel != null || builder._complexType.Particle != null || builder._complexType.Attributes.Count != 0 || builder._complexType.AnyAttribute != null)
1525 {
1526 builder.SendValidationEvent(System.SR.Sch_ComplexTypeContentModel, "complexContent");
1527 }
1530 }
1531
1533 {
1534 builder._complexContent.IsMixed = builder.ParseBoolean(value, "mixed");
1535 }
1536
1538 {
1539 if (builder._complexContent.Content != null)
1540 {
1541 builder.SendValidationEvent(System.SR.Sch_ComplexContentContentModel, "extension");
1542 }
1544 builder._complexContent.Content = builder._complexContentExtension;
1545 }
1546
1548 {
1550 }
1551
1557
1562
1563 private static void InitSimpleContent(XsdBuilder builder, string value)
1564 {
1565 if (builder._complexType.ContentModel != null || builder._complexType.Particle != null || builder._complexType.Attributes.Count != 0 || builder._complexType.AnyAttribute != null)
1566 {
1567 builder.SendValidationEvent(System.SR.Sch_ComplexTypeContentModel, "simpleContent");
1568 }
1571 }
1572
1574 {
1575 if (builder._simpleContent.Content != null)
1576 {
1577 builder.SendValidationEvent(System.SR.Sch_DupElement, "extension");
1578 }
1580 builder._simpleContent.Content = builder._simpleContentExtension;
1581 }
1582
1584 {
1586 }
1587
1589 {
1590 if (builder._simpleContent.Content != null)
1591 {
1592 builder.SendValidationEvent(System.SR.Sch_DupElement, "restriction");
1593 }
1595 builder._simpleContent.Content = builder._simpleContentRestriction;
1596 }
1597
1602
1603 private static void InitAttributeGroup(XsdBuilder builder, string value)
1604 {
1607 switch (builder.ParentElement)
1608 {
1609 case SchemaNames.Token.XsdSchema:
1610 builder._schema.Items.Add(builder._attributeGroup);
1611 break;
1612 case SchemaNames.Token.XsdRedefine:
1613 builder._redefine.Items.Add(builder._attributeGroup);
1614 break;
1615 }
1616 }
1617
1619 {
1621 }
1622
1623 private static void InitAttributeGroupRef(XsdBuilder builder, string value)
1624 {
1626 builder.AddAttribute(builder._attributeGroupRef);
1627 }
1628
1630 {
1632 }
1633
1634 private static void InitAnyAttribute(XsdBuilder builder, string value)
1635 {
1637 switch (builder.ParentElement)
1638 {
1639 case SchemaNames.Token.XsdComplexType:
1640 if (builder._complexType.ContentModel != null)
1641 {
1642 builder.SendValidationEvent(System.SR.Sch_AttributeMutuallyExclusive, "anyAttribute");
1643 }
1644 if (builder._complexType.AnyAttribute != null)
1645 {
1646 builder.SendValidationEvent(System.SR.Sch_DupElement, "anyAttribute");
1647 }
1649 break;
1650 case SchemaNames.Token.XsdSimpleContentRestriction:
1651 if (builder._simpleContentRestriction.AnyAttribute != null)
1652 {
1653 builder.SendValidationEvent(System.SR.Sch_DupElement, "anyAttribute");
1654 }
1656 break;
1657 case SchemaNames.Token.XsdSimpleContentExtension:
1658 if (builder._simpleContentExtension.AnyAttribute != null)
1659 {
1660 builder.SendValidationEvent(System.SR.Sch_DupElement, "anyAttribute");
1661 }
1663 break;
1664 case SchemaNames.Token.XsdComplexContentExtension:
1665 if (builder._complexContentExtension.AnyAttribute != null)
1666 {
1667 builder.SendValidationEvent(System.SR.Sch_DupElement, "anyAttribute");
1668 }
1670 break;
1671 case SchemaNames.Token.XsdComplexContentRestriction:
1672 if (builder._complexContentRestriction.AnyAttribute != null)
1673 {
1674 builder.SendValidationEvent(System.SR.Sch_DupElement, "anyAttribute");
1675 }
1677 break;
1678 case SchemaNames.Token.xsdAttributeGroup:
1679 if (builder._attributeGroup.AnyAttribute != null)
1680 {
1681 builder.SendValidationEvent(System.SR.Sch_DupElement, "anyAttribute");
1682 }
1684 break;
1685 }
1686 }
1687
1692
1697
1698 private static void InitGroup(XsdBuilder builder, string value)
1699 {
1702 switch (builder.ParentElement)
1703 {
1704 case SchemaNames.Token.XsdSchema:
1705 builder._schema.Items.Add(builder._group);
1706 break;
1707 case SchemaNames.Token.XsdRedefine:
1708 builder._redefine.Items.Add(builder._group);
1709 break;
1710 }
1711 }
1712
1713 private static void BuildGroup_Name(XsdBuilder builder, string value)
1714 {
1716 }
1717
1718 private static void InitGroupRef(XsdBuilder builder, string value)
1719 {
1721 builder.AddParticle(builder._groupRef);
1722 }
1723
1725 {
1726 builder.SetMaxOccurs(builder._particle, value);
1727 }
1728
1730 {
1731 builder.SetMinOccurs(builder._particle, value);
1732 }
1733
1734 private static void BuildGroupRef_Ref(XsdBuilder builder, string value)
1735 {
1736 builder._groupRef.RefName = builder.ParseQName(value, "ref");
1737 }
1738
1739 private static void InitAll(XsdBuilder builder, string value)
1740 {
1742 builder.AddParticle(builder._all);
1743 }
1744
1745 private static void InitChoice(XsdBuilder builder, string value)
1746 {
1748 builder.AddParticle(builder._choice);
1749 }
1750
1751 private static void InitSequence(XsdBuilder builder, string value)
1752 {
1754 builder.AddParticle(builder._sequence);
1755 }
1756
1757 private static void InitAny(XsdBuilder builder, string value)
1758 {
1760 builder.AddParticle(builder._anyElement);
1761 }
1762
1763 private static void BuildAny_Namespace(XsdBuilder builder, string value)
1764 {
1766 }
1767
1772
1773 private static void InitNotation(XsdBuilder builder, string value)
1774 {
1777 builder._schema.Items.Add(builder._notation);
1778 }
1779
1780 private static void BuildNotation_Name(XsdBuilder builder, string value)
1781 {
1783 }
1784
1785 private static void BuildNotation_Public(XsdBuilder builder, string value)
1786 {
1788 }
1789
1790 private static void BuildNotation_System(XsdBuilder builder, string value)
1791 {
1793 }
1794
1795 private static void InitFacet(XsdBuilder builder, string value)
1796 {
1797 switch (builder.CurrentElement)
1798 {
1799 case SchemaNames.Token.XsdEnumeration:
1801 break;
1802 case SchemaNames.Token.XsdLength:
1804 break;
1805 case SchemaNames.Token.XsdMaxExclusive:
1807 break;
1808 case SchemaNames.Token.XsdMaxInclusive:
1810 break;
1811 case SchemaNames.Token.XsdMaxLength:
1813 break;
1814 case SchemaNames.Token.XsdMinExclusive:
1816 break;
1817 case SchemaNames.Token.XsdMinInclusive:
1819 break;
1820 case SchemaNames.Token.XsdMinLength:
1822 break;
1823 case SchemaNames.Token.XsdPattern:
1825 break;
1826 case SchemaNames.Token.XsdTotalDigits:
1828 break;
1829 case SchemaNames.Token.XsdFractionDigits:
1831 break;
1832 case SchemaNames.Token.XsdWhitespace:
1834 break;
1835 }
1836 builder._xso = builder._facet;
1837 if (SchemaNames.Token.XsdSimpleTypeRestriction == builder.ParentElement)
1838 {
1839 builder._simpleTypeRestriction.Facets.Add(builder._facet);
1840 return;
1841 }
1842 if (builder._simpleContentRestriction.Attributes.Count != 0 || builder._simpleContentRestriction.AnyAttribute != null)
1843 {
1844 builder.SendValidationEvent(System.SR.Sch_InvalidFacetPosition, null);
1845 }
1846 builder._simpleContentRestriction.Facets.Add(builder._facet);
1847 }
1848
1849 private static void BuildFacet_Fixed(XsdBuilder builder, string value)
1850 {
1851 builder._facet.IsFixed = builder.ParseBoolean(value, "fixed");
1852 }
1853
1854 private static void BuildFacet_Value(XsdBuilder builder, string value)
1855 {
1857 }
1858
1859 private static void InitIdentityConstraint(XsdBuilder builder, string value)
1860 {
1861 if (!builder._element.RefName.IsEmpty)
1862 {
1863 builder.SendValidationEvent(System.SR.Sch_ElementRef, null);
1864 }
1865 switch (builder.CurrentElement)
1866 {
1867 case SchemaNames.Token.XsdUnique:
1869 break;
1870 case SchemaNames.Token.XsdKey:
1872 break;
1873 case SchemaNames.Token.XsdKeyref:
1875 break;
1876 }
1877 builder._element.Constraints.Add(builder._identityConstraint);
1878 }
1879
1884
1886 {
1887 if (builder._identityConstraint is XmlSchemaKeyref)
1888 {
1889 ((XmlSchemaKeyref)builder._identityConstraint).Refer = builder.ParseQName(value, "refer");
1890 }
1891 else
1892 {
1893 builder.SendValidationEvent(System.SR.Sch_UnsupportedAttribute, "refer");
1894 }
1895 }
1896
1897 private static void InitSelector(XsdBuilder builder, string value)
1898 {
1900 if (builder._identityConstraint.Selector == null)
1901 {
1903 }
1904 else
1905 {
1906 builder.SendValidationEvent(System.SR.Sch_DupSelector, builder._identityConstraint.Name);
1907 }
1908 }
1909
1910 private static void BuildSelector_XPath(XsdBuilder builder, string value)
1911 {
1913 }
1914
1915 private static void InitField(XsdBuilder builder, string value)
1916 {
1918 if (builder._identityConstraint.Selector == null)
1919 {
1920 builder.SendValidationEvent(System.SR.Sch_SelectorBeforeFields, builder._identityConstraint.Name);
1921 }
1922 builder._identityConstraint.Fields.Add(builder._xpath);
1923 }
1924
1925 private static void BuildField_XPath(XsdBuilder builder, string value)
1926 {
1928 }
1929
1930 private static void InitAnnotation(XsdBuilder builder, string value)
1931 {
1932 if (builder._hasChild && builder.ParentElement != SchemaNames.Token.XsdSchema && builder.ParentElement != SchemaNames.Token.XsdRedefine)
1933 {
1934 builder.SendValidationEvent(System.SR.Sch_AnnotationLocation, null);
1935 }
1937 builder.ParentContainer.AddAnnotation(builder._annotation);
1938 }
1939
1940 private static void InitAppinfo(XsdBuilder builder, string value)
1941 {
1943 builder._annotation.Items.Add(builder._appInfo);
1944 builder._markup = Array.Empty<XmlNode>();
1945 }
1946
1951
1952 private static void EndAppinfo(XsdBuilder builder)
1953 {
1955 }
1956
1957 private static void InitDocumentation(XsdBuilder builder, string value)
1958 {
1960 builder._annotation.Items.Add(builder._documentation);
1961 builder._markup = Array.Empty<XmlNode>();
1962 }
1963
1968
1970 {
1971 try
1972 {
1974 }
1975 catch (XmlSchemaException ex)
1976 {
1977 ex.SetSource(builder._reader.BaseURI, builder._positionInfo.LineNumber, builder._positionInfo.LinePosition);
1978 builder.SendValidationEvent(ex);
1979 }
1980 }
1981
1983 {
1985 }
1986
1988 {
1989 switch (ParentElement)
1990 {
1991 case SchemaNames.Token.XsdComplexType:
1992 if (_complexType.ContentModel != null)
1993 {
1995 }
1996 if (_complexType.AnyAttribute != null)
1997 {
1999 }
2001 break;
2002 case SchemaNames.Token.XsdSimpleContentRestriction:
2004 {
2006 }
2008 break;
2009 case SchemaNames.Token.XsdSimpleContentExtension:
2011 {
2013 }
2015 break;
2016 case SchemaNames.Token.XsdComplexContentExtension:
2018 {
2020 }
2022 break;
2023 case SchemaNames.Token.XsdComplexContentRestriction:
2025 {
2027 }
2029 break;
2030 case SchemaNames.Token.xsdAttributeGroup:
2031 if (_attributeGroup.AnyAttribute != null)
2032 {
2034 }
2036 break;
2037 }
2038 }
2039
2040 private void AddParticle(XmlSchemaParticle particle)
2041 {
2042 switch (ParentElement)
2043 {
2044 case SchemaNames.Token.XsdComplexType:
2046 {
2048 }
2049 _complexType.Particle = particle;
2050 break;
2051 case SchemaNames.Token.XsdComplexContentExtension:
2053 {
2054 SendValidationEvent(System.SR.Sch_ComplexContentContentModel, "ComplexContentExtension");
2055 }
2057 break;
2058 case SchemaNames.Token.XsdComplexContentRestriction:
2060 {
2061 SendValidationEvent(System.SR.Sch_ComplexContentContentModel, "ComplexContentExtension");
2062 }
2064 break;
2065 case SchemaNames.Token.XsdGroup:
2066 if (_group.Particle != null)
2067 {
2069 }
2071 break;
2072 case SchemaNames.Token.XsdChoice:
2073 case SchemaNames.Token.XsdSequence:
2074 ((XmlSchemaGroupBase)ParentContainer).Items.Add(particle);
2075 break;
2076 }
2077 }
2078
2079 private bool GetNextState(XmlQualifiedName qname)
2080 {
2081 if (_currentEntry.NextStates != null)
2082 {
2083 for (int i = 0; i < _currentEntry.NextStates.Length; i++)
2084 {
2085 int num = (int)_currentEntry.NextStates[i];
2086 if (_schemaNames.TokenToQName[(int)s_schemaEntries[num].Name].Equals(qname))
2087 {
2089 return true;
2090 }
2091 }
2092 }
2093 return false;
2094 }
2095
2097 {
2098 if (CurrentElement != SchemaNames.Token.XsdDocumentation)
2099 {
2100 return CurrentElement == SchemaNames.Token.XsdAppInfo;
2101 }
2102 return true;
2103 }
2104
2105 private void SetMinOccurs(XmlSchemaParticle particle, string value)
2106 {
2107 try
2108 {
2110 }
2111 catch (Exception)
2112 {
2114 }
2115 }
2116
2117 private void SetMaxOccurs(XmlSchemaParticle particle, string value)
2118 {
2119 try
2120 {
2122 }
2123 catch (Exception)
2124 {
2126 }
2127 }
2128
2129 private bool ParseBoolean(string value, string attributeName)
2130 {
2131 try
2132 {
2133 return XmlConvert.ToBoolean(value);
2134 }
2135 catch (Exception)
2136 {
2138 return false;
2139 }
2140 }
2141
2142 private int ParseEnum(string value, string attributeName, string[] values)
2143 {
2144 string text = value.Trim();
2145 for (int i = 0; i < values.Length; i++)
2146 {
2147 if (values[i] == text)
2148 {
2149 return i + 1;
2150 }
2151 }
2153 return 0;
2154 }
2155
2157 {
2158 try
2159 {
2161 string prefix;
2163 }
2164 catch (Exception)
2165 {
2167 return XmlQualifiedName.Empty;
2168 }
2169 }
2170
2171 private int ParseBlockFinalEnum(string value, string attributeName)
2172 {
2173 int num = 0;
2174 string[] array = XmlConvert.SplitString(value);
2175 for (int i = 0; i < array.Length; i++)
2176 {
2177 bool flag = false;
2178 for (int j = 0; j < s_derivationMethodStrings.Length; j++)
2179 {
2181 {
2183 {
2185 return 0;
2186 }
2188 flag = true;
2189 break;
2190 }
2191 }
2192 if (!flag)
2193 {
2195 return 0;
2196 }
2197 if (num == 255 && value.Length > 4)
2198 {
2200 return 0;
2201 }
2202 }
2203 return num;
2204 }
2205
2206 private static string ParseUriReference(string s)
2207 {
2208 return s;
2209 }
2210
2211 private void SendValidationEvent(string code, string arg0, string arg1, string arg2)
2212 {
2214 }
2215
2220
2225
2227 {
2230 if (_validationEventHandler != null)
2231 {
2233 }
2234 else if (severity == XmlSeverityType.Error)
2235 {
2236 throw e;
2237 }
2238 }
2239
2241 {
2243 }
2244
2255}
void Add(TKey key, TValue value)
static string Sch_UnsupportedAttribute
Definition SR.cs:424
static string Sch_InvalidXsdAttributeValue
Definition SR.cs:576
static string Sch_UnsupportedElement
Definition SR.cs:426
static string Sch_AttributeMutuallyExclusive
Definition SR.cs:772
static string Sch_TextNotAllowed
Definition SR.cs:556
static string Sch_ElementRef
Definition SR.cs:548
static string Sch_InvalidXsdAttributeDatatypeValue
Definition SR.cs:578
static string Sch_DupSelector
Definition SR.cs:836
static string Sch_ComplexTypeContentModel
Definition SR.cs:776
static string Sch_AnnotationLocation
Definition SR.cs:430
static string Sch_ComplexContentContentModel
Definition SR.cs:778
static string Sch_SelectorBeforeFields
Definition SR.cs:844
static string Sch_DupGroupParticle
Definition SR.cs:482
static string Sch_AnyAttributeLastChild
Definition SR.cs:774
static string Sch_IncludeLocation
Definition SR.cs:500
static string Sch_DupElement
Definition SR.cs:480
static string Sch_MaxOccursInvalidXsd
Definition SR.cs:752
static string Sch_DupXsdElement
Definition SR.cs:542
static string Sch_RedefineLocation
Definition SR.cs:504
static string Sch_TypeAfterConstraints
Definition SR.cs:1130
static string Sch_ImportLocation
Definition SR.cs:502
static string Sch_InvalidFacetPosition
Definition SR.cs:770
static string Sch_MinOccursInvalidXsd
Definition SR.cs:754
static string Sch_DupSimpleTypeChild
Definition SR.cs:1134
static string Sch_SimpleTypeRestriction
Definition SR.cs:768
Definition SR.cs:7
object Push()
Definition HWStack.cs:52
static PositionInfo GetPositionInfo(object o)
XmlQualifiedName[] TokenToQName
static XmlSchemaDatatype FromXmlTokenizedTypeXsd(XmlTokenizedType token)
void SetSchemaObject(XmlSchemaObject source)
virtual void SetUnhandledAttributes(XmlAttribute[] moreAttributes)
BuilderNamespaceManager(XmlNamespaceManager nsMgr, XmlReader reader)
override string LookupNamespace(string prefix)
XsdAttributeEntry(SchemaNames.Token a, XsdBuildFunction build)
Definition XsdBuilder.cs:72
XsdEntry(SchemaNames.Token n, State state, State[] nextStates, XsdAttributeEntry[] attributes, XsdInitFunction init, XsdEndChildFunction end, bool parseContent)
Definition XsdBuilder.cs:95
static void BuildFacet_Value(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_annotationAttributes
static void InitChoice(XsdBuilder builder, string value)
static readonly State[] s_elementSubelements
static void InitSimpleTypeRestriction(XsdBuilder builder, string value)
static readonly string[] s_formStringValues
static readonly State[] s_schemaElement
static readonly State[] s_simpleTypeListSubelements
readonly XmlNamespaceManager _namespaceManager
XmlSchemaAnnotation _annotation
void SetContainer(State state, object container)
static readonly XsdEntry[] s_schemaEntries
static void BuildImport_SchemaLocation(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_groupRefAttributes
XmlSchemaObject GetContainer(State state)
static void BuildElement_Block(XsdBuilder builder, string value)
static void BuildSchema_ElementFormDefault(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_schemaAttributes
static readonly XsdAttributeEntry[] s_importAttributes
static void InitComplexType(XsdBuilder builder, string value)
static void EndAppinfo(XsdBuilder builder)
static readonly State[] s_attributeGroupSubelements
XmlSchemaRedefine _redefine
static void InitGroup(XsdBuilder builder, string value)
override void ProcessCData(string value)
static void InitImport(XsdBuilder builder, string value)
static void InitComplexContent(XsdBuilder builder, string value)
static void BuildSimpleTypeUnion_MemberTypes(XsdBuilder builder, string value)
static void BuildSimpleContentRestriction_Base(XsdBuilder builder, string value)
static void InitDocumentation(XsdBuilder builder, string value)
static void BuildParticle_MaxOccurs(XsdBuilder builder, string value)
XmlSchemaSimpleContentExtension _simpleContentExtension
static void BuildNotation_Name(XsdBuilder builder, string value)
void SendValidationEvent(XmlSchemaException e)
XmlSchemaAttribute _attribute
static readonly string[] s_useStringValues
XmlQualifiedName ParseQName(string value, string attributeName)
void SendValidationEvent(string code, string arg0, string arg1, string arg2)
static readonly XsdAttributeEntry[] s_simpleContentRestrictionAttributes
static void InitSimpleType(XsdBuilder builder, string value)
static void InitSimpleContentExtension(XsdBuilder builder, string value)
static void BuildAttribute_Type(XsdBuilder builder, string value)
static void InitAny(XsdBuilder builder, string value)
static void BuildSchema_TargetNamespace(XsdBuilder builder, string value)
static void BuildElement_Abstract(XsdBuilder builder, string value)
static void InitSchema(XsdBuilder builder, string value)
static void BuildSchema_BlockDefault(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_complexContentAttributes
static readonly State[] s_complexContentRestrictionSubelements
XmlSchemaAnyAttribute _anyAttribute
override bool IsContentParsed()
static void InitElement(XsdBuilder builder, string value)
XmlSchemaSimpleTypeList _simpleTypeList
XmlSchemaObject ParentContainer
readonly XmlSchema _schema
bool GetNextState(XmlQualifiedName qname)
static void BuildFacet_Fixed(XsdBuilder builder, string value)
static void BuildAttribute_Use(XsdBuilder builder, string value)
delegate void XsdEndChildFunction(XsdBuilder builder)
static void BuildAttribute_Ref(XsdBuilder builder, string value)
static void BuildAppinfo_Source(XsdBuilder builder, string value)
static readonly State[] s_simpleContentExtensionSubelements
XmlSchemaAppInfo _appInfo
delegate void XsdInitFunction(XsdBuilder builder, string value)
static void InitAll(XsdBuilder builder, string value)
static void BuildAttributeGroup_Name(XsdBuilder builder, string value)
static void BuildAttribute_Name(XsdBuilder builder, string value)
static readonly State[] s_simpleContentSubelements
static void BuildElement_Form(XsdBuilder builder, string value)
void SetMinOccurs(XmlSchemaParticle particle, string value)
static readonly XsdAttributeEntry[] s_identityConstraintAttributes
static readonly XsdAttributeEntry[] s_attributeGroupAttributes
static void EndRedefine(XsdBuilder builder)
static readonly State[] s_choiceSequenceSubelements
static void BuildElement_SubstitutionGroup(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_simpleTypeRestrictionAttributes
readonly Stack< XmlSchemaObject > _containerStack
static readonly State[] s_allSubelements
readonly SchemaNames _schemaNames
override void ProcessAttribute(string prefix, string name, string ns, string value)
XmlSchemaComplexContent _complexContent
static void BuildGroupRef_Ref(XsdBuilder builder, string value)
static void EndDocumentation(XsdBuilder builder)
static void BuildIdentityConstraint_Refer(XsdBuilder builder, string value)
static void BuildDocumentation_XmlLang(XsdBuilder builder, string value)
static void BuildComplexType_Mixed(XsdBuilder builder, string value)
static void BuildNotation_System(XsdBuilder builder, string value)
static void BuildComplexContentExtension_Base(XsdBuilder builder, string value)
static void BuildRedefine_SchemaLocation(XsdBuilder builder, string value)
XmlSchemaComplexContentExtension _complexContentExtension
static void BuildInclude_SchemaLocation(XsdBuilder builder, string value)
XmlSchemaParticle _particle
static void BuildSchema_AttributeFormDefault(XsdBuilder builder, string value)
static void InitSimpleContent(XsdBuilder builder, string value)
XmlSchemaAttributeGroup _attributeGroup
static readonly State[] s_simpleTypeUnionSubelements
static readonly State[] s_complexContentSubelements
int ParseBlockFinalEnum(string value, string attributeName)
static void InitRedefine(XsdBuilder builder, string value)
static void InitSimpleContentRestriction(XsdBuilder builder, string value)
static void BuildImport_Namespace(XsdBuilder builder, string value)
static void BuildGroup_Name(XsdBuilder builder, string value)
static void InitSimpleTypeUnion(XsdBuilder builder, string value)
override void EndChildren()
static void BuildDocumentation_Source(XsdBuilder builder, string value)
static void BuildElement_Ref(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_simpleTypeAttributes
static void BuildSimpleType_Final(XsdBuilder builder, string value)
static readonly State[] s_attributeSubelements
static void BuildAttribute_Fixed(XsdBuilder builder, string value)
void SendValidationEvent(string code, string[] args, XmlSeverityType severity)
List< XmlQualifiedName > _namespaces
readonly List< XmlAttribute > _unhandledAttributes
readonly XmlNameTable _nameTable
readonly HWStack _stateHistory
readonly XmlReader _reader
static void BuildElement_Nillable(XsdBuilder builder, string value)
static void BuildAttribute_Form(XsdBuilder builder, string value)
XmlSchemaSimpleContentRestriction _simpleContentRestriction
static void BuildElement_Default(XsdBuilder builder, string value)
static void InitComplexContentExtension(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_notationAttributes
static void InitAnyAttribute(XsdBuilder builder, string value)
static void InitGroupRef(XsdBuilder builder, string value)
void SendValidationEvent(string code, string msg)
static readonly XsdAttributeEntry[] s_attributeAttributes
static readonly XsdAttributeEntry[] s_simpleTypeUnionAttributes
static void BuildAnnotated_Id(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_anyAttributes
static readonly State[] s_simpleTypeSubelements
static void BuildSchema_FinalDefault(XsdBuilder builder, string value)
static string ParseUriReference(string s)
XmlSchemaNotation _notation
static void BuildAttributeGroupRef_Ref(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_particleAttributes
static void InitSelector(XsdBuilder builder, string value)
static void InitAppinfo(XsdBuilder builder, string value)
static void BuildElement_Type(XsdBuilder builder, string value)
static void BuildElement_MinOccurs(XsdBuilder builder, string value)
static void BuildSimpleType_Name(XsdBuilder builder, string value)
static void InitIdentityConstraint(XsdBuilder builder, string value)
static void BuildSimpleTypeList_ItemType(XsdBuilder builder, string value)
XmlSchemaSimpleTypeRestriction _simpleTypeRestriction
static void BuildSimpleTypeRestriction_Base(XsdBuilder builder, string value)
XmlSchemaSimpleTypeUnion _simpleTypeUnion
static void InitSimpleTypeList(XsdBuilder builder, string value)
static void BuildAny_ProcessContents(XsdBuilder builder, string value)
delegate void XsdBuildFunction(XsdBuilder builder, string value)
static void BuildIdentityConstraint_Name(XsdBuilder builder, string value)
static void InitAttribute(XsdBuilder builder, string value)
static void BuildElement_Fixed(XsdBuilder builder, string value)
static void BuildAnyAttribute_ProcessContents(XsdBuilder builder, string value)
static void InitField(XsdBuilder builder, string value)
static void BuildElement_Final(XsdBuilder builder, string value)
static void BuildElement_MaxOccurs(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_simpleContentExtensionAttributes
static void BuildAnyAttribute_Namespace(XsdBuilder builder, string value)
XmlSchemaSimpleContent _simpleContent
bool IsSkipableElement(XmlQualifiedName qname)
static readonly XsdAttributeEntry[] s_selectorAttributes
static readonly int[] s_derivationMethodValues
static readonly State[] s_complexTypeSubelements
static readonly XsdAttributeEntry[] s_anyAttributeAttributes
static void BuildComplexType_Abstract(XsdBuilder builder, string value)
static void BuildComplexType_Name(XsdBuilder builder, string value)
XmlSchemaIdentityConstraint _identityConstraint
static void BuildField_XPath(XsdBuilder builder, string value)
static readonly State[] s_simpleContentRestrictionSubelements
static readonly XsdAttributeEntry[] s_redefineAttributes
static readonly XsdAttributeEntry[] s_documentationAttributes
override void StartChildren()
static readonly XsdAttributeEntry[] s_complexContentRestrictionAttributes
static readonly XsdAttributeEntry[] s_groupAttributes
static void InitInclude(XsdBuilder builder, string value)
static readonly State[] s_annotationSubelements
static void InitAnnotation(XsdBuilder builder, string value)
static void InitAttributeGroup(XsdBuilder builder, string value)
static void BuildParticle_MinOccurs(XsdBuilder builder, string value)
readonly PositionInfo _positionInfo
static readonly XsdAttributeEntry[] s_complexTypeAttributes
static void BuildAny_Namespace(XsdBuilder builder, string value)
XmlSchemaElement _element
static void BuildAttribute_Default(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_fieldAttributes
static void BuildComplexType_Final(XsdBuilder builder, string value)
XmlSchemaInclude _include
static void InitAttributeGroupRef(XsdBuilder builder, string value)
static void BuildNotation_Public(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_complexContentExtensionAttributes
static readonly XsdAttributeEntry[] s_simpleTypeListAttributes
SchemaNames.Token CurrentElement
static readonly State[] s_redefineSubelements
override void ProcessMarkup(XmlNode[] markup)
XmlSchemaAttributeGroupRef _attributeGroupRef
static readonly State[] s_annotatedSubelements
override bool ProcessElement(string prefix, string name, string ns)
static readonly State[] s_complexContentExtensionSubelements
static readonly State[] s_schemaSubelements
static void InitComplexContentRestriction(XsdBuilder builder, string value)
XmlSchemaDocumentation _documentation
void SendValidationEvent(XmlSchemaException e, XmlSeverityType severity)
static void BuildSelector_XPath(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_appinfoAttributes
static void BuildElement_Name(XsdBuilder builder, string value)
void AddAttribute(XmlSchemaObject value)
static void BuildComplexContentRestriction_Base(XsdBuilder builder, string value)
static void InitNotation(XsdBuilder builder, string value)
XmlSchemaComplexType _complexType
static readonly string[] s_derivationMethodStrings
static readonly XsdAttributeEntry[] s_elementAttributes
static readonly XsdAttributeEntry[] s_attributeGroupRefAttributes
void SetMaxOccurs(XmlSchemaParticle particle, string value)
static void InitFacet(XsdBuilder builder, string value)
static void BuildSimpleContentExtension_Base(XsdBuilder builder, string value)
XmlSchemaSequence _sequence
static void BuildComplexContent_Mixed(XsdBuilder builder, string value)
static void BuildSchema_Version(XsdBuilder builder, string value)
static readonly XsdAttributeEntry[] s_facetAttributes
static readonly XsdAttributeEntry[] s_includeAttributes
readonly ValidationEventHandler _validationEventHandler
static readonly State[] s_identityConstraintSubelements
static readonly State[] s_groupSubelements
XmlSchemaGroupRef _groupRef
XmlSchemaSimpleType _simpleType
XmlSchemaComplexContentRestriction _complexContentRestriction
static void BuildComplexType_Block(XsdBuilder builder, string value)
bool ParseBoolean(string value, string attributeName)
static readonly State[] s_simpleTypeRestrictionSubelements
SchemaNames.Token ParentElement
XsdBuilder(XmlReader reader, XmlNamespaceManager curmgr, XmlSchema schema, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventhandler)
static readonly XsdAttributeEntry[] s_simpleContentAttributes
static void InitSequence(XsdBuilder builder, string value)
void AddParticle(XmlSchemaParticle particle)
static readonly string[] s_processContentsStringValues
int ParseEnum(string value, string attributeName, string[] values)
static string NonCDataNormalize(string value)
static bool ToBoolean(string s)
static string[] SplitString(string value)
virtual ? string LookupNamespace(string prefix)
static XmlQualifiedName Parse(string s, IXmlNamespaceResolver nsmgr, out string prefix)
override bool Equals([NotNullWhen(true)] object? other)
static readonly XmlQualifiedName Empty
string? LookupNamespace(string prefix)