Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XsdValidatingReader.cs
Go to the documentation of this file.
6
7namespace System.Xml;
8
10{
12 {
13 None = 0,
14 Init = 1,
15 Read = 2,
18 OnAttribute = 3,
21 ReadAhead = 6,
23 ReaderClosed = 8,
24 EOF = 9,
25 Error = 10
26 }
27
29
31
33
35
36 private readonly XmlResolver _xmlResolver;
37
38 private readonly ValidationEventHandler _validationEvent;
39
41
42 private XmlValueGetter _valueGetter;
43
45
46 private readonly bool _manageNamespaces;
47
48 private readonly bool _processInlineSchema;
49
50 private bool _replayCache;
51
53
55
56 private int _attributeCount;
57
59
60 private int _currentAttrIndex;
61
63
65
67
68 private object _atomicValue;
69
71
73
75
77
79
80 private string _nsXmlNs;
81
82 private string _nsXs;
83
84 private string _nsXsi;
85
86 private string _xsiType;
87
88 private string _xsiNil;
89
90 private string _xsdSchema;
91
92 private string _xsiSchemaLocation;
93
95
97
99
101
102 private static volatile Type s_typeOfString;
103
105 {
106 get
107 {
109 settings = ((settings != null) ? settings.Clone() : new XmlReaderSettings());
113 settings.ReadOnly = true;
114 return settings;
115 }
116 }
117
118 public override XmlNodeType NodeType
119 {
120 get
121 {
123 {
124 return _cachedNode.NodeType;
125 }
128 {
129 return XmlNodeType.SignificantWhitespace;
130 }
131 return nodeType;
132 }
133 }
134
135 public override string Name
136 {
137 get
138 {
139 if (_validationState == ValidatingReaderState.OnDefaultAttribute)
140 {
142 if (defaultAttributePrefix != null && defaultAttributePrefix.Length != 0)
143 {
145 }
146 return _cachedNode.LocalName;
147 }
148 return _coreReader.Name;
149 }
150 }
151
152 public override string LocalName
153 {
154 get
155 {
157 {
158 return _cachedNode.LocalName;
159 }
160 return _coreReader.LocalName;
161 }
162 }
163
164 public override string NamespaceURI
165 {
166 get
167 {
169 {
170 return _cachedNode.Namespace;
171 }
173 }
174 }
175
176 public override string Prefix
177 {
178 get
179 {
181 {
182 return _cachedNode.Prefix;
183 }
184 return _coreReader.Prefix;
185 }
186 }
187
188 public override bool HasValue
189 {
190 get
191 {
193 {
194 return true;
195 }
196 return _coreReader.HasValue;
197 }
198 }
199
200 public override string Value
201 {
202 get
203 {
205 {
206 return _cachedNode.RawValue;
207 }
208 return _coreReader.Value;
209 }
210 }
211
212 public override int Depth
213 {
214 get
215 {
217 {
218 return _cachedNode.Depth;
219 }
220 return _coreReader.Depth;
221 }
222 }
223
224 public override string BaseURI => _coreReader.BaseURI;
225
227
228 public override bool IsDefault
229 {
230 get
231 {
232 if (_validationState == ValidatingReaderState.OnDefaultAttribute)
233 {
234 return true;
235 }
236 return _coreReader.IsDefault;
237 }
238 }
239
240 public override char QuoteChar => _coreReader.QuoteChar;
241
243
244 public override string XmlLang => _coreReader.XmlLang;
245
246 public override IXmlSchemaInfo SchemaInfo => this;
247
248 public override Type ValueType
249 {
250 get
251 {
252 switch (NodeType)
253 {
254 case XmlNodeType.Element:
255 case XmlNodeType.EndElement:
257 {
259 }
260 break;
261 case XmlNodeType.Attribute:
263 {
265 }
266 break;
267 }
268 return s_typeOfString;
269 }
270 }
271
272 public override int AttributeCount => _attributeCount;
273
274 public override bool EOF => _coreReader.EOF;
275
276 public override ReadState ReadState
277 {
278 get
279 {
281 {
282 return _coreReader.ReadState;
283 }
284 return ReadState.Initial;
285 }
286 }
287
289
290 public override bool CanReadBinaryContent => true;
291
293 {
294 get
295 {
296 switch (NodeType)
297 {
298 case XmlNodeType.Element:
300 {
301 GetIsDefault();
302 }
304 case XmlNodeType.EndElement:
306 case XmlNodeType.Attribute:
307 if (_attributePSVI != null)
308 {
310 }
311 break;
312 }
313 return false;
314 }
315 }
316
318 {
319 get
320 {
321 XmlNodeType nodeType = NodeType;
322 if (nodeType == XmlNodeType.Element || nodeType == XmlNodeType.EndElement)
323 {
324 return _xmlSchemaInfo.IsNil;
325 }
326 return false;
327 }
328 }
329
331 {
332 get
333 {
334 switch (NodeType)
335 {
336 case XmlNodeType.Element:
338 {
340 }
342 {
343 return XmlSchemaValidity.NotKnown;
344 }
346 case XmlNodeType.EndElement:
348 case XmlNodeType.Attribute:
349 if (_attributePSVI != null)
350 {
352 }
353 break;
354 }
355 return XmlSchemaValidity.NotKnown;
356 }
357 }
358
360 {
361 get
362 {
363 switch (NodeType)
364 {
365 case XmlNodeType.Element:
367 {
369 }
371 case XmlNodeType.EndElement:
373 case XmlNodeType.Attribute:
374 if (_attributePSVI != null)
375 {
377 }
378 return null;
379 default:
380 return null;
381 }
382 }
383 }
384
386 {
387 get
388 {
389 switch (NodeType)
390 {
391 case XmlNodeType.Element:
392 case XmlNodeType.EndElement:
394 case XmlNodeType.Attribute:
395 if (_attributePSVI != null)
396 {
398 }
399 return null;
400 default:
401 return null;
402 }
403 }
404 }
405
407 {
408 get
409 {
410 if (NodeType == XmlNodeType.Element || NodeType == XmlNodeType.EndElement)
411 {
413 }
414 return null;
415 }
416 }
417
419 {
420 get
421 {
422 if (NodeType == XmlNodeType.Attribute && _attributePSVI != null)
423 {
425 }
426 return null;
427 }
428 }
429
430 public int LineNumber
431 {
432 get
433 {
434 if (_lineInfo != null)
435 {
436 return _lineInfo.LineNumber;
437 }
438 return 0;
439 }
440 }
441
442 public int LinePosition
443 {
444 get
445 {
446 if (_lineInfo != null)
447 {
448 return _lineInfo.LinePosition;
449 }
450 return 0;
451 }
452 }
453
455
457 {
458 get
459 {
460 if (_attributePSVI != null)
461 {
463 }
464 return null;
465 }
466 }
467
469
471 {
472 _coreReader = reader;
474 _lineInfo = reader as IXmlLineInfo;
476 if (_coreReaderNSResolver == null)
477 {
479 _manageNamespaces = true;
480 }
481 _thisNSResolver = this;
489 s_typeOfString = typeof(string);
491 _nsXmlNs = _coreReaderNameTable.Add("http://www.w3.org/2000/xmlns/");
492 _nsXs = _coreReaderNameTable.Add("http://www.w3.org/2001/XMLSchema");
493 _nsXsi = _coreReaderNameTable.Add("http://www.w3.org/2001/XMLSchema-instance");
496 _xsiSchemaLocation = _coreReaderNameTable.Add("schemaLocation");
497 _xsiNoNamespaceSchemaLocation = _coreReaderNameTable.Add("noNamespaceSchemaLocation");
500 _validationEvent = readerSettings.GetEventHandler();
501 }
502
507
508 [MemberNotNull("_validator")]
531
532 public override object ReadContentAsObject()
533 {
535 {
536 throw CreateReadContentAsException("ReadContentAsObject");
537 }
539 }
540
541 public override bool ReadContentAsBoolean()
542 {
544 {
545 throw CreateReadContentAsException("ReadContentAsBoolean");
546 }
549 try
550 {
551 return xmlSchemaType?.ValueConverter.ToBoolean(value) ?? XmlUntypedConverter.Untyped.ToBoolean(value);
552 }
554 {
556 }
558 {
560 }
562 {
564 }
565 }
566
568 {
570 {
571 throw CreateReadContentAsException("ReadContentAsDateTime");
572 }
575 try
576 {
577 return xmlSchemaType?.ValueConverter.ToDateTime(value) ?? XmlUntypedConverter.Untyped.ToDateTime(value);
578 }
580 {
582 }
584 {
586 }
588 {
590 }
591 }
592
593 public override double ReadContentAsDouble()
594 {
596 {
597 throw CreateReadContentAsException("ReadContentAsDouble");
598 }
601 try
602 {
603 return xmlSchemaType?.ValueConverter.ToDouble(value) ?? XmlUntypedConverter.Untyped.ToDouble(value);
604 }
606 {
608 }
610 {
612 }
614 {
616 }
617 }
618
619 public override float ReadContentAsFloat()
620 {
622 {
623 throw CreateReadContentAsException("ReadContentAsFloat");
624 }
627 try
628 {
629 return xmlSchemaType?.ValueConverter.ToSingle(value) ?? XmlUntypedConverter.Untyped.ToSingle(value);
630 }
632 {
634 }
636 {
638 }
640 {
642 }
643 }
644
645 public override decimal ReadContentAsDecimal()
646 {
648 {
649 throw CreateReadContentAsException("ReadContentAsDecimal");
650 }
653 try
654 {
655 return xmlSchemaType?.ValueConverter.ToDecimal(value) ?? XmlUntypedConverter.Untyped.ToDecimal(value);
656 }
658 {
660 }
662 {
664 }
666 {
668 }
669 }
670
671 public override int ReadContentAsInt()
672 {
674 {
675 throw CreateReadContentAsException("ReadContentAsInt");
676 }
679 try
680 {
681 return xmlSchemaType?.ValueConverter.ToInt32(value) ?? XmlUntypedConverter.Untyped.ToInt32(value);
682 }
684 {
686 }
688 {
690 }
692 {
694 }
695 }
696
697 public override long ReadContentAsLong()
698 {
700 {
701 throw CreateReadContentAsException("ReadContentAsLong");
702 }
705 try
706 {
707 return xmlSchemaType?.ValueConverter.ToInt64(value) ?? XmlUntypedConverter.Untyped.ToInt64(value);
708 }
710 {
712 }
714 {
716 }
718 {
720 }
721 }
722
723 public override string ReadContentAsString()
724 {
726 {
727 throw CreateReadContentAsException("ReadContentAsString");
728 }
731 try
732 {
733 if (xmlSchemaType != null)
734 {
735 return xmlSchemaType.ValueConverter.ToString(obj);
736 }
737 return obj as string;
738 }
740 {
742 }
744 {
746 }
748 {
750 }
751 }
752
787
788 public override object ReadElementContentAsObject()
789 {
790 if (NodeType != XmlNodeType.Element)
791 {
792 throw CreateReadElementContentAsException("ReadElementContentAsObject");
793 }
794 XmlSchemaType xmlType;
796 }
797
798 public override bool ReadElementContentAsBoolean()
799 {
800 if (NodeType != XmlNodeType.Element)
801 {
802 throw CreateReadElementContentAsException("ReadElementContentAsBoolean");
803 }
804 XmlSchemaType xmlType;
806 try
807 {
808 return xmlType?.ValueConverter.ToBoolean(value) ?? XmlUntypedConverter.Untyped.ToBoolean(value);
809 }
811 {
813 }
815 {
817 }
819 {
821 }
822 }
823
825 {
826 if (NodeType != XmlNodeType.Element)
827 {
828 throw CreateReadElementContentAsException("ReadElementContentAsDateTime");
829 }
830 XmlSchemaType xmlType;
832 try
833 {
834 return xmlType?.ValueConverter.ToDateTime(value) ?? XmlUntypedConverter.Untyped.ToDateTime(value);
835 }
837 {
839 }
841 {
843 }
845 {
847 }
848 }
849
850 public override double ReadElementContentAsDouble()
851 {
852 if (NodeType != XmlNodeType.Element)
853 {
854 throw CreateReadElementContentAsException("ReadElementContentAsDouble");
855 }
856 XmlSchemaType xmlType;
858 try
859 {
860 return xmlType?.ValueConverter.ToDouble(value) ?? XmlUntypedConverter.Untyped.ToDouble(value);
861 }
863 {
865 }
867 {
869 }
871 {
873 }
874 }
875
876 public override float ReadElementContentAsFloat()
877 {
878 if (NodeType != XmlNodeType.Element)
879 {
880 throw CreateReadElementContentAsException("ReadElementContentAsFloat");
881 }
882 XmlSchemaType xmlType;
884 try
885 {
886 return xmlType?.ValueConverter.ToSingle(value) ?? XmlUntypedConverter.Untyped.ToSingle(value);
887 }
889 {
891 }
893 {
895 }
897 {
899 }
900 }
901
902 public override decimal ReadElementContentAsDecimal()
903 {
904 if (NodeType != XmlNodeType.Element)
905 {
906 throw CreateReadElementContentAsException("ReadElementContentAsDecimal");
907 }
908 XmlSchemaType xmlType;
910 try
911 {
912 return xmlType?.ValueConverter.ToDecimal(value) ?? XmlUntypedConverter.Untyped.ToDecimal(value);
913 }
915 {
917 }
919 {
921 }
923 {
925 }
926 }
927
928 public override int ReadElementContentAsInt()
929 {
930 if (NodeType != XmlNodeType.Element)
931 {
932 throw CreateReadElementContentAsException("ReadElementContentAsInt");
933 }
934 XmlSchemaType xmlType;
936 try
937 {
938 return xmlType?.ValueConverter.ToInt32(value) ?? XmlUntypedConverter.Untyped.ToInt32(value);
939 }
941 {
943 }
945 {
947 }
949 {
951 }
952 }
953
954 public override long ReadElementContentAsLong()
955 {
956 if (NodeType != XmlNodeType.Element)
957 {
958 throw CreateReadElementContentAsException("ReadElementContentAsLong");
959 }
960 XmlSchemaType xmlType;
962 try
963 {
964 return xmlType?.ValueConverter.ToInt64(value) ?? XmlUntypedConverter.Untyped.ToInt64(value);
965 }
967 {
969 }
971 {
973 }
975 {
977 }
978 }
979
980 public override string ReadElementContentAsString()
981 {
982 if (NodeType != XmlNodeType.Element)
983 {
984 throw CreateReadElementContentAsException("ReadElementContentAsString");
985 }
986 XmlSchemaType xmlType;
988 try
989 {
990 if (xmlType != null && obj != null)
991 {
992 return xmlType.ValueConverter.ToString(obj);
993 }
994 return (obj as string) ?? string.Empty;
995 }
997 {
999 }
1001 {
1003 }
1005 {
1007 }
1008 }
1009
1011 {
1012 if (NodeType != XmlNodeType.Element)
1013 {
1014 throw CreateReadElementContentAsException("ReadElementContentAs");
1015 }
1016 XmlSchemaType xmlType;
1017 string originalString;
1019 try
1020 {
1021 if (xmlType != null)
1022 {
1024 {
1026 }
1028 }
1030 }
1032 {
1034 }
1036 {
1038 }
1040 {
1042 }
1043 }
1044
1045 public override string GetAttribute(string name)
1046 {
1047 string text = _coreReader.GetAttribute(name);
1048 if (text == null && _attributeCount > 0)
1049 {
1051 if (defaultAttribute != null)
1052 {
1053 text = defaultAttribute.RawValue;
1054 }
1055 }
1056 return text;
1057 }
1058
1059 public override string GetAttribute(string name, string namespaceURI)
1060 {
1062 if (attribute == null && _attributeCount > 0)
1063 {
1064 string text = ((namespaceURI == null) ? string.Empty : _coreReaderNameTable.Get(namespaceURI));
1065 string text2 = _coreReaderNameTable.Get(name);
1066 if (text2 == null || text == null)
1067 {
1068 return null;
1069 }
1071 if (defaultAttribute != null)
1072 {
1073 return defaultAttribute.RawValue;
1074 }
1075 }
1076 return attribute;
1077 }
1078
1079 public override string GetAttribute(int i)
1080 {
1082 {
1083 throw new ArgumentOutOfRangeException("i");
1084 }
1086 {
1087 return _coreReader.GetAttribute(i);
1088 }
1091 return validatingReaderNodeData.RawValue;
1092 }
1093
1094 public override bool MoveToAttribute(string name)
1095 {
1096 if (_coreReader.MoveToAttribute(name))
1097 {
1100 goto IL_0057;
1101 }
1102 if (_attributeCount > 0)
1103 {
1105 if (defaultAttribute != null)
1106 {
1107 _validationState = ValidatingReaderState.OnDefaultAttribute;
1110 goto IL_0057;
1111 }
1112 }
1113 return false;
1114 IL_0057:
1115 if (_validationState == ValidatingReaderState.OnReadBinaryContent)
1116 {
1119 }
1120 return true;
1121 }
1122
1123 public override bool MoveToAttribute(string name, string ns)
1124 {
1125 string text = _coreReaderNameTable.Get(name);
1126 ns = ((ns != null) ? _coreReaderNameTable.Get(ns) : string.Empty);
1127 if (text == null || ns == null)
1128 {
1129 return false;
1130 }
1132 {
1134 if (_inlineSchemaParser == null)
1135 {
1137 }
1138 else
1139 {
1140 _attributePSVI = null;
1141 }
1142 }
1143 else
1144 {
1146 if (defaultAttribute == null)
1147 {
1148 return false;
1149 }
1152 _validationState = ValidatingReaderState.OnDefaultAttribute;
1153 }
1154 if (_validationState == ValidatingReaderState.OnReadBinaryContent)
1155 {
1158 }
1159 return true;
1160 }
1161
1162 public override void MoveToAttribute(int i)
1163 {
1165 {
1166 throw new ArgumentOutOfRangeException("i");
1167 }
1170 {
1172 if (_inlineSchemaParser == null)
1173 {
1175 }
1176 else
1177 {
1178 _attributePSVI = null;
1179 }
1181 }
1182 else
1183 {
1187 _validationState = ValidatingReaderState.OnDefaultAttribute;
1188 }
1189 if (_validationState == ValidatingReaderState.OnReadBinaryContent)
1190 {
1193 }
1194 }
1195
1196 public override bool MoveToFirstAttribute()
1197 {
1199 {
1201 if (_inlineSchemaParser == null)
1202 {
1204 }
1205 else
1206 {
1207 _attributePSVI = null;
1208 }
1210 }
1211 else
1212 {
1213 if (_defaultAttributes.Count <= 0)
1214 {
1215 return false;
1216 }
1220 _validationState = ValidatingReaderState.OnDefaultAttribute;
1221 }
1222 if (_validationState == ValidatingReaderState.OnReadBinaryContent)
1223 {
1226 }
1227 return true;
1228 }
1229
1230 public override bool MoveToNextAttribute()
1231 {
1233 {
1234 bool flag = _coreReader.MoveToNextAttribute();
1236 if (_inlineSchemaParser == null)
1237 {
1239 }
1240 else
1241 {
1242 _attributePSVI = null;
1243 }
1245 }
1246 else
1247 {
1249 {
1250 return false;
1251 }
1255 _validationState = ValidatingReaderState.OnDefaultAttribute;
1256 }
1257 if (_validationState == ValidatingReaderState.OnReadBinaryContent)
1258 {
1261 }
1262 return true;
1263 }
1264
1265 public override bool MoveToElement()
1266 {
1268 {
1269 _currentAttrIndex = -1;
1270 _validationState = ValidatingReaderState.ClearAttributes;
1271 return true;
1272 }
1273 return false;
1274 }
1275
1276 public override bool Read()
1277 {
1278 switch (_validationState)
1279 {
1280 case ValidatingReaderState.Read:
1281 if (_coreReader.Read())
1282 {
1284 return true;
1285 }
1287 if (_coreReader.EOF)
1288 {
1290 }
1291 return false;
1292 case ValidatingReaderState.ParseInlineSchema:
1294 return true;
1295 case ValidatingReaderState.OnReadAttributeValue:
1296 case ValidatingReaderState.OnDefaultAttribute:
1297 case ValidatingReaderState.OnAttribute:
1298 case ValidatingReaderState.ClearAttributes:
1300 if (_inlineSchemaParser != null)
1301 {
1302 _validationState = ValidatingReaderState.ParseInlineSchema;
1303 goto case ValidatingReaderState.ParseInlineSchema;
1304 }
1306 goto case ValidatingReaderState.Read;
1307 case ValidatingReaderState.ReadAhead:
1311 return true;
1312 case ValidatingReaderState.OnReadBinaryContent:
1315 return Read();
1316 case ValidatingReaderState.Init:
1318 if (_coreReader.ReadState == ReadState.Interactive)
1319 {
1321 return true;
1322 }
1323 goto case ValidatingReaderState.Read;
1324 case ValidatingReaderState.ReaderClosed:
1325 case ValidatingReaderState.EOF:
1326 return false;
1327 default:
1328 return false;
1329 }
1330 }
1331
1332 public override void Close()
1333 {
1336 }
1337
1338 public override void Skip()
1339 {
1340 XmlNodeType nodeType = NodeType;
1341 if (nodeType != XmlNodeType.Element)
1342 {
1343 if (nodeType != XmlNodeType.Attribute)
1344 {
1345 goto IL_007a;
1346 }
1347 MoveToElement();
1348 }
1350 {
1351 bool flag = true;
1353 {
1354 flag = false;
1355 }
1356 _coreReader.Skip();
1358 if (flag)
1359 {
1361 }
1362 }
1363 goto IL_007a;
1364 IL_007a:
1365 Read();
1366 }
1367
1368 public override string LookupNamespace(string prefix)
1369 {
1371 }
1372
1373 public override void ResolveEntity()
1374 {
1375 throw new InvalidOperationException();
1376 }
1377
1378 public override bool ReadAttributeValue()
1379 {
1380 if (_validationState == ValidatingReaderState.OnReadBinaryContent)
1381 {
1384 }
1385 if (NodeType == XmlNodeType.Attribute)
1386 {
1387 if (_validationState == ValidatingReaderState.OnDefaultAttribute)
1388 {
1390 _validationState = ValidatingReaderState.OnReadAttributeValue;
1391 return true;
1392 }
1394 }
1395 return false;
1396 }
1397
1398 public override int ReadContentAsBase64(byte[] buffer, int index, int count)
1399 {
1400 if (ReadState != ReadState.Interactive)
1401 {
1402 return 0;
1403 }
1404 if (_validationState != ValidatingReaderState.OnReadBinaryContent)
1405 {
1408 }
1412 _validationState = ValidatingReaderState.OnReadBinaryContent;
1413 return result;
1414 }
1415
1416 public override int ReadContentAsBinHex(byte[] buffer, int index, int count)
1417 {
1418 if (ReadState != ReadState.Interactive)
1419 {
1420 return 0;
1421 }
1422 if (_validationState != ValidatingReaderState.OnReadBinaryContent)
1423 {
1426 }
1430 _validationState = ValidatingReaderState.OnReadBinaryContent;
1431 return result;
1432 }
1433
1434 public override int ReadElementContentAsBase64(byte[] buffer, int index, int count)
1435 {
1436 if (ReadState != ReadState.Interactive)
1437 {
1438 return 0;
1439 }
1440 if (_validationState != ValidatingReaderState.OnReadBinaryContent)
1441 {
1444 }
1448 _validationState = ValidatingReaderState.OnReadBinaryContent;
1449 return result;
1450 }
1451
1452 public override int ReadElementContentAsBinHex(byte[] buffer, int index, int count)
1453 {
1454 if (ReadState != ReadState.Interactive)
1455 {
1456 return 0;
1457 }
1458 if (_validationState != ValidatingReaderState.OnReadBinaryContent)
1459 {
1462 }
1466 _validationState = ValidatingReaderState.OnReadBinaryContent;
1467 return result;
1468 }
1469
1470 public bool HasLineInfo()
1471 {
1472 return true;
1473 }
1474
1483
1485 {
1486 if (_coreReaderNSResolver != null)
1487 {
1489 }
1491 }
1492
1501
1502 private object GetStringValue()
1503 {
1504 return _coreReader.Value;
1505 }
1506
1507 private void ProcessReaderEvent()
1508 {
1509 if (!_replayCache)
1510 {
1511 switch (_coreReader.NodeType)
1512 {
1513 case XmlNodeType.Element:
1515 break;
1516 case XmlNodeType.Whitespace:
1517 case XmlNodeType.SignificantWhitespace:
1519 break;
1520 case XmlNodeType.Text:
1521 case XmlNodeType.CDATA:
1523 break;
1524 case XmlNodeType.EndElement:
1526 break;
1527 case XmlNodeType.EntityReference:
1528 throw new InvalidOperationException();
1529 case XmlNodeType.DocumentType:
1531 break;
1532 case XmlNodeType.Attribute:
1533 case XmlNodeType.Entity:
1534 case XmlNodeType.ProcessingInstruction:
1535 case XmlNodeType.Comment:
1536 case XmlNodeType.Document:
1537 case XmlNodeType.DocumentFragment:
1538 case XmlNodeType.Notation:
1539 break;
1540 }
1541 }
1542 }
1543
1544 private void ProcessElementEvent()
1545 {
1547 {
1551 {
1555 _validationState = ValidatingReaderState.ParseInlineSchema;
1556 }
1557 else
1558 {
1559 _validationState = ValidatingReaderState.ClearAttributes;
1560 }
1561 return;
1562 }
1563 _atomicValue = null;
1567 {
1569 }
1570 string xsiSchemaLocation = null;
1571 string xsiNoNamespaceSchemaLocation = null;
1572 string xsiNil = null;
1573 string xsiType = null;
1575 {
1576 do
1577 {
1579 string localName = _coreReader.LocalName;
1581 {
1582 if (Ref.Equal(localName, _xsiSchemaLocation))
1583 {
1585 }
1586 else if (Ref.Equal(localName, _xsiNoNamespaceSchemaLocation))
1587 {
1589 }
1590 else if (Ref.Equal(localName, _xsiType))
1591 {
1593 }
1594 else if (Ref.Equal(localName, _xsiNil))
1595 {
1597 }
1598 }
1600 {
1602 }
1603 }
1606 }
1611 {
1613 }
1614 _validationState = ValidatingReaderState.ClearAttributes;
1615 }
1616
1635
1636 private void ValidateAttributes()
1637 {
1639 int num = 0;
1640 bool flag = false;
1642 {
1643 do
1644 {
1645 string localName = _coreReader.LocalName;
1648 attributePSVIInfo.localName = localName;
1650 if ((object)namespaceURI == _nsXmlNs)
1651 {
1652 num++;
1653 continue;
1654 }
1656 if (!flag)
1657 {
1659 }
1660 num++;
1661 }
1663 }
1665 if (flag)
1666 {
1668 }
1671 }
1672
1673 private void ClearAttributesInfo()
1674 {
1675 _attributeCount = 0;
1677 _currentAttrIndex = -1;
1679 _attributePSVI = null;
1680 }
1681
1683 {
1684 if (_inlineSchemaParser != null)
1685 {
1686 return null;
1687 }
1691 string ns = ((prefix.Length != 0) ? _thisNSResolver.LookupNamespace(prefix) : string.Empty);
1692 return GetAttributePSVI(lname, ns);
1693 }
1694
1695 private AttributePSVIInfo GetAttributePSVI(string localName, string ns)
1696 {
1698 for (int i = 0; i < _coreReaderAttributeCount; i++)
1699 {
1701 if (attributePSVIInfo != null && Ref.Equal(localName, attributePSVIInfo.localName) && Ref.Equal(ns, attributePSVIInfo.namespaceUri))
1702 {
1704 return attributePSVIInfo;
1705 }
1706 }
1707 return null;
1708 }
1709
1718
1720 {
1722 for (int i = 0; i < _defaultAttributes.Count; i++)
1723 {
1726 {
1727 if (updatePosition)
1728 {
1730 }
1732 }
1733 }
1734 return null;
1735 }
1736
1759
1760 private bool IsXSDRoot(string localName, string ns)
1761 {
1762 if (Ref.Equal(ns, _nsXs))
1763 {
1764 return Ref.Equal(localName, _xsdSchema);
1765 }
1766 return false;
1767 }
1768
1769 private void ProcessInlineSchema()
1770 {
1771 if (_coreReader.Read())
1772 {
1773 if (_coreReader.NodeType == XmlNodeType.Element)
1774 {
1776 }
1777 else
1778 {
1780 }
1782 {
1786 _inlineSchemaParser = null;
1788 }
1789 }
1790 }
1791
1793 {
1795 }
1796
1802
1804 {
1805 switch (NodeType)
1806 {
1807 case XmlNodeType.Attribute:
1809 if (_attributePSVI != null && _attributePSVI.typedAttributeValue != null)
1810 {
1811 if (_validationState == ValidatingReaderState.OnDefaultAttribute)
1812 {
1814 originalStringValue = ((schemaAttribute.DefaultValue != null) ? schemaAttribute.DefaultValue : schemaAttribute.FixedValue);
1815 }
1817 }
1818 return Value;
1819 case XmlNodeType.EndElement:
1820 if (_atomicValue != null)
1821 {
1823 return _atomicValue;
1824 }
1825 originalStringValue = string.Empty;
1826 return string.Empty;
1827 default:
1829 {
1832 return result;
1833 }
1835 {
1836 originalStringValue = xsdCachingReader.ReadOriginalContentAsString();
1837 }
1838 else
1839 {
1841 }
1842 return originalStringValue;
1843 }
1844 }
1845
1847 {
1849 }
1850
1856
1858 {
1859 object obj = null;
1860 xmlType = null;
1861 if (IsEmptyElement)
1862 {
1865 xmlType = ElementXmlType;
1866 Read();
1867 return obj;
1868 }
1869 Read();
1870 if (NodeType == XmlNodeType.EndElement)
1871 {
1873 {
1876 }
1877 else
1878 {
1879 obj = string.Empty;
1880 originalString = string.Empty;
1881 }
1882 }
1883 else
1884 {
1885 if (NodeType == XmlNodeType.Element)
1886 {
1887 throw new XmlException(System.SR.Xml_MixedReadElementContentAs, string.Empty, this);
1888 }
1890 if (NodeType != XmlNodeType.EndElement)
1891 {
1892 throw new XmlException(System.SR.Xml_MixedReadElementContentAs, string.Empty, this);
1893 }
1894 }
1895 xmlType = ElementXmlType;
1896 Read();
1897 return obj;
1898 }
1899
1900 private object ReadTillEndElement()
1901 {
1902 if (_atomicValue == null)
1903 {
1904 while (_coreReader.Read())
1905 {
1906 if (_replayCache)
1907 {
1908 continue;
1909 }
1910 switch (_coreReader.NodeType)
1911 {
1912 case XmlNodeType.Element:
1914 break;
1915 case XmlNodeType.Text:
1916 case XmlNodeType.CDATA:
1918 continue;
1919 case XmlNodeType.Whitespace:
1920 case XmlNodeType.SignificantWhitespace:
1922 continue;
1923 case XmlNodeType.EndElement:
1927 {
1929 }
1930 break;
1931 default:
1932 continue;
1933 }
1934 break;
1935 }
1936 }
1937 else
1938 {
1939 if (_atomicValue == this)
1940 {
1941 _atomicValue = null;
1942 }
1943 SwitchReader();
1944 }
1945 return _atomicValue;
1946 }
1947
1948 private void SwitchReader()
1949 {
1951 {
1952 _coreReader = xsdCachingReader.GetCoreReader();
1953 }
1954 _replayCache = false;
1955 }
1956
1958 {
1959 while (_coreReader.Read())
1960 {
1961 switch (_coreReader.NodeType)
1962 {
1963 case XmlNodeType.Text:
1964 case XmlNodeType.CDATA:
1966 break;
1967 case XmlNodeType.Whitespace:
1968 case XmlNodeType.SignificantWhitespace:
1970 break;
1971 case XmlNodeType.EndElement:
1974 if (_atomicValue == null)
1975 {
1976 _atomicValue = this;
1977 }
1978 else if (_xmlSchemaInfo.IsDefault)
1979 {
1981 }
1982 return;
1983 }
1984 }
1985 }
1986
1987 private void GetIsDefault()
1988 {
1991 {
1992 return;
1993 }
1996 {
1998 }
1999 else if (_coreReader.Read())
2000 {
2001 switch (_coreReader.NodeType)
2002 {
2003 case XmlNodeType.Text:
2004 case XmlNodeType.CDATA:
2006 break;
2007 case XmlNodeType.Whitespace:
2008 case XmlNodeType.SignificantWhitespace:
2010 break;
2011 case XmlNodeType.EndElement:
2015 {
2017 }
2018 break;
2019 }
2020 }
2022 _replayCache = true;
2023 }
2024
2025 private void GetMemberType()
2026 {
2027 if (_xmlSchemaInfo.MemberType == null && _atomicValue != this)
2028 {
2031 {
2035 _replayCache = true;
2036 }
2037 }
2038 }
2039
2040 private object ReturnBoxedValue(object typedValue, XmlSchemaType xmlType, bool unWrap)
2041 {
2042 if (typedValue != null)
2043 {
2044 if (unWrap && xmlType.Datatype.Variety == XmlSchemaDatatypeVariety.List)
2045 {
2047 if (datatype_List.ItemType.Variety == XmlSchemaDatatypeVariety.Union)
2048 {
2049 typedValue = xmlType.ValueConverter.ChangeType(typedValue, xmlType.Datatype.ValueType, _thisNSResolver);
2050 }
2051 }
2052 return typedValue;
2053 }
2054 typedValue = _validator.GetConcatenatedValue();
2055 return typedValue;
2056 }
2057
2059 {
2060 if (_cachingReader == null)
2061 {
2063 }
2064 else
2065 {
2067 }
2069 return _cachingReader;
2070 }
2071
2073 {
2074 if (_textNode == null)
2075 {
2077 }
2078 _textNode.Depth = depth;
2080 return _textNode;
2081 }
2082
2084 {
2085 _coreReader = cachingReader.GetCoreReader();
2086 _lineInfo = cachingReader.GetLineInfo();
2087 _replayCache = false;
2088 }
2089
2091 {
2093 {
2095 if (schemaElement != null)
2096 {
2097 if (schemaElement.DefaultValue == null)
2098 {
2099 return schemaElement.FixedValue;
2100 }
2101 return schemaElement.DefaultValue;
2102 }
2103 return string.Empty;
2104 }
2106 }
2107
2108 public override Task<string> GetValueAsync()
2109 {
2111 {
2112 return Task.FromResult(_cachedNode.RawValue);
2113 }
2114 return _coreReader.GetValueAsync();
2115 }
2116
2118 {
2120 {
2121 throw CreateReadContentAsException("ReadContentAsObject");
2122 }
2124 }
2125
2127 {
2129 {
2130 throw CreateReadContentAsException("ReadContentAsString");
2131 }
2132 object obj = await InternalReadContentAsObjectAsync().ConfigureAwait(continueOnCapturedContext: false);
2134 try
2135 {
2136 if (xmlSchemaType != null)
2137 {
2138 return xmlSchemaType.ValueConverter.ToString(obj);
2139 }
2140 return obj as string;
2141 }
2143 {
2145 }
2147 {
2149 }
2151 {
2153 }
2154 }
2155
2157 {
2159 {
2160 throw CreateReadContentAsException("ReadContentAs");
2161 }
2163 string item = tuple.Item1;
2164 object value = tuple.Item2;
2166 try
2167 {
2168 if (xmlSchemaType != null)
2169 {
2171 {
2172 value = item;
2173 }
2174 return xmlSchemaType.ValueConverter.ChangeType(value, returnType);
2175 }
2177 }
2179 {
2181 }
2183 {
2185 }
2187 {
2189 }
2190 }
2191
2193 {
2194 if (NodeType != XmlNodeType.Element)
2195 {
2196 throw CreateReadElementContentAsException("ReadElementContentAsObject");
2197 }
2199 }
2200
2202 {
2203 if (NodeType != XmlNodeType.Element)
2204 {
2205 throw CreateReadElementContentAsException("ReadElementContentAsString");
2206 }
2208 try
2209 {
2210 if (xmlSchemaType != null)
2211 {
2212 return xmlSchemaType.ValueConverter.ToString(obj);
2213 }
2214 return obj as string;
2215 }
2217 {
2219 }
2221 {
2223 }
2225 {
2227 }
2228 }
2229
2231 {
2232 if (NodeType != XmlNodeType.Element)
2233 {
2234 throw CreateReadElementContentAsException("ReadElementContentAs");
2235 }
2237 try
2238 {
2239 if (xmlSchemaType != null)
2240 {
2242 {
2243 value = text;
2244 }
2245 return xmlSchemaType.ValueConverter.ChangeType(value, returnType, namespaceResolver);
2246 }
2248 }
2250 {
2252 }
2254 {
2256 }
2258 {
2260 }
2261 }
2262
2264 {
2265 if (task.IsSuccess())
2266 {
2267 if (task.Result)
2268 {
2269 return ProcessReaderEventAsync().ReturnTrueTaskWhenFinishAsync();
2270 }
2272 if (_coreReader.EOF)
2273 {
2275 }
2277 }
2278 return _ReadAsync_Read(task);
2279 }
2280
2282 {
2283 if (await task.ConfigureAwait(continueOnCapturedContext: false))
2284 {
2286 return true;
2287 }
2289 if (_coreReader.EOF)
2290 {
2292 }
2293 return false;
2294 }
2295
2297 {
2298 if (task.IsSuccess())
2299 {
2302 }
2303 return _ReadAsync_ReadAhead(task);
2304 }
2305
2307 {
2308 await task.ConfigureAwait(continueOnCapturedContext: false);
2310 return true;
2311 }
2312
2313 public override Task<bool> ReadAsync()
2314 {
2315 switch (_validationState)
2316 {
2317 case ValidatingReaderState.Read:
2318 {
2320 return ReadAsync_Read(task);
2321 }
2322 case ValidatingReaderState.ParseInlineSchema:
2323 return ProcessInlineSchemaAsync().ReturnTrueTaskWhenFinishAsync();
2324 case ValidatingReaderState.OnReadAttributeValue:
2325 case ValidatingReaderState.OnDefaultAttribute:
2326 case ValidatingReaderState.OnAttribute:
2327 case ValidatingReaderState.ClearAttributes:
2329 if (_inlineSchemaParser != null)
2330 {
2331 _validationState = ValidatingReaderState.ParseInlineSchema;
2332 goto case ValidatingReaderState.ParseInlineSchema;
2333 }
2335 goto case ValidatingReaderState.Read;
2336 case ValidatingReaderState.ReadAhead:
2337 {
2340 return ReadAsync_ReadAhead(task2);
2341 }
2342 case ValidatingReaderState.OnReadBinaryContent:
2344 return _readBinaryHelper.FinishAsync().CallBoolTaskFuncWhenFinishAsync((XsdValidatingReader thisRef) => thisRef.ReadAsync(), this);
2345 case ValidatingReaderState.Init:
2347 if (_coreReader.ReadState == ReadState.Interactive)
2348 {
2349 return ProcessReaderEventAsync().ReturnTrueTaskWhenFinishAsync();
2350 }
2351 goto case ValidatingReaderState.Read;
2352 case ValidatingReaderState.ReaderClosed:
2353 case ValidatingReaderState.EOF:
2355 default:
2357 }
2358 }
2359
2360 public override async Task SkipAsync()
2361 {
2362 XmlNodeType nodeType = NodeType;
2363 if (nodeType != XmlNodeType.Element)
2364 {
2365 if (nodeType != XmlNodeType.Attribute)
2366 {
2367 goto IL_010f;
2368 }
2369 MoveToElement();
2370 }
2372 {
2373 bool callSkipToEndElem = true;
2375 {
2376 callSkipToEndElem = false;
2377 }
2378 await _coreReader.SkipAsync().ConfigureAwait(continueOnCapturedContext: false);
2381 {
2383 }
2384 }
2385 goto IL_010f;
2386 IL_010f:
2387 await ReadAsync().ConfigureAwait(continueOnCapturedContext: false);
2388 }
2389
2390 public override async Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
2391 {
2392 if (ReadState != ReadState.Interactive)
2393 {
2394 return 0;
2395 }
2396 if (_validationState != ValidatingReaderState.OnReadBinaryContent)
2397 {
2400 }
2404 _validationState = ValidatingReaderState.OnReadBinaryContent;
2405 return result;
2406 }
2407
2408 public override async Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
2409 {
2410 if (ReadState != ReadState.Interactive)
2411 {
2412 return 0;
2413 }
2414 if (_validationState != ValidatingReaderState.OnReadBinaryContent)
2415 {
2418 }
2422 _validationState = ValidatingReaderState.OnReadBinaryContent;
2423 return result;
2424 }
2425
2427 {
2428 if (ReadState != ReadState.Interactive)
2429 {
2430 return 0;
2431 }
2432 if (_validationState != ValidatingReaderState.OnReadBinaryContent)
2433 {
2436 }
2440 _validationState = ValidatingReaderState.OnReadBinaryContent;
2441 return result;
2442 }
2443
2445 {
2446 if (ReadState != ReadState.Interactive)
2447 {
2448 return 0;
2449 }
2450 if (_validationState != ValidatingReaderState.OnReadBinaryContent)
2451 {
2454 }
2458 _validationState = ValidatingReaderState.OnReadBinaryContent;
2459 return result;
2460 }
2461
2463 {
2464 if (_replayCache)
2465 {
2466 return Task.CompletedTask;
2467 }
2468 switch (_coreReader.NodeType)
2469 {
2470 case XmlNodeType.Element:
2471 return ProcessElementEventAsync();
2472 case XmlNodeType.Whitespace:
2473 case XmlNodeType.SignificantWhitespace:
2475 break;
2476 case XmlNodeType.Text:
2477 case XmlNodeType.CDATA:
2479 break;
2480 case XmlNodeType.EndElement:
2482 case XmlNodeType.EntityReference:
2483 throw new InvalidOperationException();
2484 case XmlNodeType.DocumentType:
2486 break;
2487 }
2488 return Task.CompletedTask;
2489 }
2490
2492 {
2494 {
2498 {
2502 _validationState = ValidatingReaderState.ParseInlineSchema;
2503 }
2504 else
2505 {
2506 _validationState = ValidatingReaderState.ClearAttributes;
2507 }
2508 return;
2509 }
2510 _atomicValue = null;
2514 {
2516 }
2517 string xsiSchemaLocation = null;
2518 string xsiNoNamespaceSchemaLocation = null;
2519 string xsiNil = null;
2520 string xsiType = null;
2522 {
2523 do
2524 {
2526 string localName = _coreReader.LocalName;
2528 {
2529 if (Ref.Equal(localName, _xsiSchemaLocation))
2530 {
2532 }
2533 else if (Ref.Equal(localName, _xsiNoNamespaceSchemaLocation))
2534 {
2536 }
2537 else if (Ref.Equal(localName, _xsiType))
2538 {
2540 }
2541 else if (Ref.Equal(localName, _xsiNil))
2542 {
2544 }
2545 }
2547 {
2549 }
2550 }
2553 }
2558 {
2560 }
2561 _validationState = ValidatingReaderState.ClearAttributes;
2562 }
2563
2582
2605
2610
2615
2617 {
2618 switch (NodeType)
2619 {
2620 case XmlNodeType.Attribute:
2621 {
2623 if (_attributePSVI != null && _attributePSVI.typedAttributeValue != null)
2624 {
2625 if (_validationState == ValidatingReaderState.OnDefaultAttribute)
2626 {
2629 }
2631 }
2633 }
2634 case XmlNodeType.EndElement:
2635 {
2637 if (_atomicValue != null)
2638 {
2641 }
2642 originalAtomicValueString = string.Empty;
2643 return (originalAtomicValueString, string.Empty);
2644 }
2645 default:
2646 {
2649 {
2653 }
2656 }
2657 }
2658 }
2659
2664
2670
2672 {
2673 object typedValue;
2674 string originalString;
2675 XmlSchemaType xmlType;
2676 if (IsEmptyElement)
2677 {
2680 xmlType = ElementXmlType;
2681 await ReadAsync().ConfigureAwait(continueOnCapturedContext: false);
2682 return (xmlType, originalString, typedValue);
2683 }
2684 await ReadAsync().ConfigureAwait(continueOnCapturedContext: false);
2685 if (NodeType == XmlNodeType.EndElement)
2686 {
2688 {
2691 }
2692 else
2693 {
2694 typedValue = string.Empty;
2695 originalString = string.Empty;
2696 }
2697 }
2698 else
2699 {
2700 if (NodeType == XmlNodeType.Element)
2701 {
2702 throw new XmlException(System.SR.Xml_MixedReadElementContentAs, string.Empty, this);
2703 }
2705 if (NodeType != XmlNodeType.EndElement)
2706 {
2707 throw new XmlException(System.SR.Xml_MixedReadElementContentAs, string.Empty, this);
2708 }
2709 }
2710 xmlType = ElementXmlType;
2711 await ReadAsync().ConfigureAwait(continueOnCapturedContext: false);
2712 return (xmlType, originalString, typedValue);
2713 }
2714
2716 {
2717 if (_atomicValue == null)
2718 {
2719 while (await _coreReader.ReadAsync().ConfigureAwait(continueOnCapturedContext: false))
2720 {
2721 if (_replayCache)
2722 {
2723 continue;
2724 }
2725 switch (_coreReader.NodeType)
2726 {
2727 case XmlNodeType.Element:
2729 break;
2730 case XmlNodeType.Text:
2731 case XmlNodeType.CDATA:
2733 continue;
2734 case XmlNodeType.Whitespace:
2735 case XmlNodeType.SignificantWhitespace:
2737 continue;
2738 case XmlNodeType.EndElement:
2742 {
2744 }
2745 break;
2746 default:
2747 continue;
2748 }
2749 break;
2750 }
2751 }
2752 else
2753 {
2754 if (_atomicValue == this)
2755 {
2756 _atomicValue = null;
2757 }
2758 SwitchReader();
2759 }
2760 return _atomicValue;
2761 }
2762}
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
static string Xml_ReadContentAsFormatException
Definition SR.cs:190
static string Xml_MixedReadElementContentAs
Definition SR.cs:180
Definition SR.cs:7
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Definition Task.cs:226
static Task CompletedTask
Definition Task.cs:1120
static readonly Task< bool > DoneTaskTrue
Definition AsyncHelper.cs:7
static readonly Task< bool > DoneTaskFalse
Definition AsyncHelper.cs:9
async Task< int > ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
static ReadContentAsBinaryHelper CreateOrReset(ReadContentAsBinaryHelper helper, XmlReader reader)
async Task< int > ReadContentAsBase64Async(byte[] buffer, int index, int count)
int ReadContentAsBase64(byte[] buffer, int index, int count)
int ReadContentAsBinHex(byte[] buffer, int index, int count)
int ReadElementContentAsBinHex(byte[] buffer, int index, int count)
int ReadElementContentAsBase64(byte[] buffer, int index, int count)
async Task< int > ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
async Task< int > ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
static bool Equal(string strA, string strB)
Definition Ref.cs:5
async Task StartParsingAsync(XmlReader reader, string targetNamespace)
Definition Parser.cs:422
SchemaType FinishParsing()
Definition Parser.cs:157
void StartParsing(XmlReader reader, string targetNamespace)
Definition Parser.cs:78
virtual XmlSchemaDatatypeVariety Variety
XmlSchemaAttribute? SchemaAttribute
XmlSchemaContentType ContentType
XmlSchemaSimpleType? MemberType
SchemaNames GetSchemaNames(XmlNameTable nt)
void SkipToEndElement(XmlSchemaInfo? schemaInfo)
void SetDtdSchemaInfo(IDtdInfo dtdSchemaInfo)
void ValidateElement(string localName, string namespaceUri, XmlSchemaInfo? schemaInfo)
object? ValidateAttribute(string localName, string namespaceUri, string attributeValue, XmlSchemaInfo? schemaInfo)
string GetDefaultAttributePrefix(string attributeNS)
object? ValidateEndElement(XmlSchemaInfo? schemaInfo)
void ValidateEndOfAttributes(XmlSchemaInfo? schemaInfo)
void GetUnspecifiedDefaultAttributes(ArrayList defaultAttributes)
void ValidateWhitespace(string elementValue)
static readonly XmlValueConverter Untyped
object ChangeType(bool value, Type destinationType)
decimal ToDecimal(string value)
DateTime ToDateTime(bool value)
static void SplitQName(string name, out string prefix, out string lname)
static Uri ToUri(string s)
string Add(char[] array, int offset, int length)
string? Get(char[] array, int offset, int length)
virtual ? string LookupNamespace(string prefix)
virtual ? string LookupPrefix(string uri)
virtual IDictionary< string, string > GetNamespacesInScope(XmlNamespaceScope scope)
virtual void AddNamespace(string prefix, string uri)
virtual XmlSpace XmlSpace
Definition XmlReader.cs:96
Exception CreateReadElementContentAsException(string methodName)
string? GetAttribute(string name)
virtual bool HasValue
Definition XmlReader.cs:82
async Task< string > InternalReadContentAsStringAsync()
virtual void Skip()
Definition XmlReader.cs:532
virtual Task SkipAsync()
bool MoveToAttribute(string name)
Exception CreateReadContentAsException(string methodName)
virtual ? XmlReaderSettings Settings
Definition XmlReader.cs:60
virtual bool IsDefault
Definition XmlReader.cs:92
virtual char QuoteChar
Definition XmlReader.cs:94
virtual ? IDtdInfo DtdInfo
Definition XmlReader.cs:145
virtual Task< bool > ReadAsync()
virtual string XmlLang
Definition XmlReader.cs:98
virtual void Close()
Definition XmlReader.cs:528
XmlNodeType NodeType
Definition XmlReader.cs:62
static bool CanReadContentAs(XmlNodeType nodeType)
XmlNameTable NameTable
Definition XmlReader.cs:116
virtual Task< string > GetValueAsync()
virtual string Name
Definition XmlReader.cs:65
string InternalReadContentAsString()
void Reset(XmlReader reader)
ValidatingReaderNodeData RecordTextNode(string textValue, string originalStringValue, int depth, int lineNo, int linePos)
void SwitchTextNodeAndEndElement(string textValue, string originalStringValue)
override async Task< string > ReadContentAsStringAsync()
void CachingCallBack(XsdCachingReader cachingReader)
XsdValidatingReader(XmlReader reader, XmlResolver xmlResolver, XmlReaderSettings readerSettings, XmlSchemaObject partialValidationType)
override bool MoveToAttribute(string name)
readonly IXmlNamespaceResolver _coreReaderNSResolver
Task< bool > ReadAsync_ReadAhead(Task task)
override DateTime ReadContentAsDateTime()
override DateTime ReadElementContentAsDateTime()
override Task< object > ReadContentAsObjectAsync()
void SetupValidator(XmlReaderSettings readerSettings, XmlReader reader, XmlSchemaObject partialValidationType)
ValidatingReaderNodeData _cachedNode
ValidatingReaderNodeData CreateDummyTextNode(string attributeValue, int depth)
Task< object > InternalReadContentAsObjectAsync()
override int ReadElementContentAsBase64(byte[] buffer, int index, int count)
ValidatingReaderNodeData GetDefaultAttribute(string name, bool updatePosition)
ValidatingReaderNodeData GetDefaultAttribute(string attrLocalName, string ns, bool updatePosition)
object InternalReadContentAsObject(bool unwrapTypedValue)
object InternalReadElementContentAsObject(out XmlSchemaType xmlType, bool unwrapTypedValue, out string originalString)
override int ReadElementContentAsBinHex(byte[] buffer, int index, int count)
override int ReadContentAsBinHex(byte[] buffer, int index, int count)
override async Task< int > ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
Task<(XmlSchemaType, object)> InternalReadElementContentAsObjectAsync()
override async Task< int > ReadContentAsBase64Async(byte[] buffer, int index, int count)
async Task<(string, object)> InternalReadContentAsObjectTupleAsync(bool unwrapTypedValue)
override string GetAttribute(string name)
override async Task< object > ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
async Task<(XmlSchemaType, object)> InternalReadElementContentAsObjectAsync(bool unwrapTypedValue)
object InternalReadElementContentAsObject(out XmlSchemaType xmlType)
override async Task< string > ReadElementContentAsStringAsync()
async Task<(XmlSchemaType, string, object)> InternalReadElementContentAsObjectTupleAsync(bool unwrapTypedValue)
override string GetAttribute(string name, string namespaceURI)
readonly ValidationEventHandler _validationEvent
readonly IXmlNamespaceResolver _thisNSResolver
override XmlReaderSettings Settings
override decimal ReadElementContentAsDecimal()
override async Task< int > ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
override async Task< object > ReadElementContentAsObjectAsync()
async Task< bool > _ReadAsync_Read(Task< bool > task)
override bool MoveToAttribute(string name, string ns)
override async Task< object > ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
ValidatingReaderNodeData _textNode
async Task< object > InternalReadContentAsObjectAsync(bool unwrapTypedValue)
AttributePSVIInfo GetAttributePSVI(string name)
AttributePSVIInfo GetAttributePSVI(string localName, string ns)
ReadContentAsBinaryHelper _readBinaryHelper
Task< bool > ReadAsync_Read(Task< bool > task)
bool IsXSDRoot(string localName, string ns)
override string LookupNamespace(string prefix)
override object ReadContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver)
async Task< bool > _ReadAsync_ReadAhead(Task task)
readonly XmlNamespaceManager _nsManager
AttributePSVIInfo AddAttributePSVI(int attIndex)
AttributePSVIInfo[] _attributePSVINodes
override int ReadContentAsBase64(byte[] buffer, int index, int count)
override object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver)
object ReturnBoxedValue(object typedValue, XmlSchemaType xmlType, bool unWrap)
async Task< object > ReadTillEndElementAsync()
object InternalReadContentAsObject(bool unwrapTypedValue, out string originalStringValue)
override Task< string > GetValueAsync()
object InternalReadElementContentAsObject(out XmlSchemaType xmlType, bool unwrapTypedValue)
ValidatingReaderState _validationState
override async Task< int > ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
readonly XmlNameTable _coreReaderNameTable
XsdValidatingReader(XmlReader reader, XmlResolver xmlResolver, XmlReaderSettings readerSettings)
IDictionary< string, string > GetNamespacesInScope(XmlNamespaceScope scope)
string? LookupPrefix(string namespaceName)
string? LookupNamespace(string prefix)