187 writes to curPos
System.Xml (187)
System\Xml\Schema\DtdParser.cs (104)
1589
curPos
++;
1599
curPos
+= 2;
1603
curPos
++;
1613
curPos
++;
1621
curPos
++;
1708
curPos
+= 9;
1721
curPos
+= 8;
1742
curPos
+= 9;
1757
curPos
+= 10;
1763
curPos
+= 3;
1768
curPos
+= 4;
1787
curPos
+= 2;
1802
curPos
++;
1810
curPos
+= 3;
1863
curPos
++;
1867
curPos
++;
1879
curPos
++;
1883
curPos
++;
1896
curPos
++;
1906
curPos
++;
1914
curPos
+= 5;
1924
curPos
+= 3;
1950
curPos
+= 7;
1966
curPos
++;
1969
curPos
++;
1999
curPos
++;
2006
curPos
++;
2010
curPos
++;
2014
curPos
++;
2018
curPos
++;
2030
curPos
++;
2034
curPos
++;
2047
curPos
++;
2056
curPos
++;
2073
curPos
++;
2084
curPos
+= 5;
2100
curPos
+= 8;
2103
curPos
+= 6;
2119
curPos
+= 2;
2128
curPos
+= 5;
2132
curPos
+= 6;
2146
curPos
+= 8;
2158
curPos
+= 8;
2162
curPos
+= 7;
2184
curPos
++;
2198
curPos
++;
2202
curPos
++;
2215
curPos
++;
2219
curPos
++;
2251
curPos
+= 9;
2262
curPos
+= 8;
2270
curPos
+= 6;
2311
curPos
++;
2329
curPos
++;
2338
curPos
++;
2353
curPos
++;
2357
curPos
++;
2378
curPos
+= 2;
2384
curPos
++;
2398
curPos
++;
2405
curPos
++;
2410
curPos
++;
2419
curPos
++;
2433
curPos
= endPos;
2447
curPos
= endPos;
2462
curPos
= endPos;
2467
curPos
++;
2488
curPos
++;
2490
curPos
++;
2524
curPos
++;
2564
curPos
++;
2613
curPos
+= 5;
2651
curPos
++;
2673
curPos
+= 6;
2687
curPos
+= 5;
2704
curPos
++;
2722
curPos
++;
2732
curPos
++;
2736
curPos
++;
2741
curPos
+= 2;
2744
curPos
++;
2756
curPos
++;
2760
curPos
+= 3;
2767
curPos
++;
2772
curPos
+= 3;
2776
curPos
+= 3;
2792
curPos
++;
2794
curPos
++;
2837
curPos
++;
2867
curPos
++;
2886
curPos
++;
2890
curPos
++;
2915
curPos
= tokenStartPos;
2918
curPos
+= offset;
2935
curPos
++;
2960
curPos
= tokenStartPos;
2964
curPos
+= len;
2970
curPos
+= len;
2986
curPos
+= 6;
3002
curPos
+= 6;
3064
curPos
= readerAdapter.CurrentPosition;
3088
curPos
++;
3272
this.
curPos
= curPos;
3277
this.
curPos
= curPos;
System\Xml\Schema\DtdParserAsync.cs (83)
1206
curPos
++;
1216
curPos
+= 2;
1220
curPos
++;
1230
curPos
++;
1238
curPos
++;
1325
curPos
+= 9;
1338
curPos
+= 8;
1359
curPos
+= 9;
1374
curPos
+= 10;
1380
curPos
+= 3;
1385
curPos
+= 4;
1404
curPos
+= 2;
1419
curPos
++;
1427
curPos
+= 3;
1480
curPos
++;
1484
curPos
++;
1498
curPos
++;
1506
curPos
+= 5;
1516
curPos
+= 3;
1542
curPos
+= 7;
1558
curPos
++;
1561
curPos
++;
1574
curPos
++;
1591
curPos
++;
1602
curPos
+= 5;
1618
curPos
+= 8;
1621
curPos
+= 6;
1637
curPos
+= 2;
1646
curPos
+= 5;
1650
curPos
+= 6;
1664
curPos
+= 8;
1676
curPos
+= 8;
1680
curPos
+= 7;
1721
curPos
+= 9;
1732
curPos
+= 8;
1740
curPos
+= 6;
1768
curPos
++;
1786
curPos
++;
1795
curPos
++;
1810
curPos
++;
1814
curPos
++;
1835
curPos
+= 2;
1841
curPos
++;
1855
curPos
++;
1862
curPos
++;
1867
curPos
++;
1876
curPos
++;
1890
curPos
= endPos;
1904
curPos
= endPos;
1919
curPos
= endPos;
1924
curPos
++;
1945
curPos
++;
1947
curPos
++;
2004
curPos
++;
2053
curPos
+= 5;
2091
curPos
++;
2113
curPos
+= 6;
2127
curPos
+= 5;
2153
curPos
++;
2163
curPos
++;
2167
curPos
++;
2172
curPos
+= 2;
2175
curPos
++;
2187
curPos
++;
2191
curPos
+= 3;
2198
curPos
++;
2203
curPos
+= 3;
2207
curPos
+= 3;
2223
curPos
++;
2225
curPos
++;
2268
curPos
++;
2301
curPos
++;
2320
curPos
++;
2324
curPos
++;
2349
curPos
= tokenStartPos;
2352
curPos
+= offset;
2368
curPos
++;
2393
curPos
= tokenStartPos;
2397
curPos
+= len;
2403
curPos
+= len;
2419
curPos
+= 6;
2435
curPos
+= 6;
2454
curPos
++;
748 references to curPos
System.Xml (748)
System\Xml\Schema\DtdParser.cs (398)
305
ThrowInvalidChar(
curPos
, systemId, i );
313
ThrowInvalidChar(
curPos
, publicId, i );
542
Throw(
curPos
- 3, Res.Xml_InvalidConditionalSection ); // 3==strlen("<![")
552
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
557
Throw(
curPos
- 3, Res.Xml_UnexpectedCDataEnd );
563
Throw(
curPos
, Res.Xml_UnclosedConditionalSection );
567
Debug.Assert(
curPos
> 0 && chars[
curPos
-1] == ']' );
568
SaveParsingBuffer(
curPos
- 1 );
574
ThrowUnexpectedToken(
curPos
, ">" );
583
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
588
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
591
Throw(
curPos
, Res.Xml_UnclosedConditionalSection );
606
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
610
Throw(
curPos
, Res.Sch_ParEntityRefNesting );
641
attrDef.LinePosition = (int)LinePos - (
curPos
- tokenStartPos);
747
SendValidationEvent(
curPos
- 8, XmlSeverityType.Error, Res.Sch_DupNotationAttribute, elementDecl.Name.ToString() ); // 8 == strlen("NOTATION")
753
SendValidationEvent(
curPos
- 8, XmlSeverityType.Error, Res.Sch_NotationAttributeOnEmptyElement, elementDecl.Name.ToString() );// 8 == strlen("NOTATION")
856
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_AttListPresence, string.Empty );
892
SendValidationEvent(
curPos
- name.Name.Length, XmlSeverityType.Error, Res.Sch_DupElementDecl, GetNameString() );
971
ThrowUnexpectedToken(
curPos
, ">" );
1141
Throw(
curPos
, Res.Xml_InvalidContentModel );
1151
Throw(
curPos
, Res.Xml_InvalidContentModel );
1158
Throw(
curPos
, Res.Xml_InvalidContentModel );
1166
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
1171
Throw(
curPos
, Res.Xml_InvalidContentModel );
1220
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
1226
ThrowUnexpectedToken(
curPos
, "*" );
1239
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
1256
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
1320
ThrowUnexpectedToken(
curPos
- 5, ">" ); // 5 == strlen("NDATA")
1323
Throw(
curPos
- 5, Res.Xml_ExpectingWhiteSpace, "NDATA" );
1377
SendValidationEvent(
curPos
- notationName.Name.Length, XmlSeverityType.Error, Res.Sch_DupNotation, notationName.Name );
1469
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
1491
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
1500
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
1517
ThrowUnexpectedToken(
curPos
, "\"", "'" );
1524
Throw(
curPos
- systemId.Length - 1, Res.Xml_FragmentId, new string[] { systemId.Substring( systemId.IndexOf( '#' ) ), systemId } );
1539
ThrowInvalidChar(
curPos
- 1 - publicId.Length + i, publicId, i );
1555
ThrowUnexpectedToken(
curPos
, "\"", "'" );
1566
ThrowUnexpectedToken(
curPos
, "\"", "'" );
1578
switch ( chars[
curPos
] ) {
1580
if (
curPos
== charsUsed ) {
1584
ThrowInvalidChar( chars, charsUsed,
curPos
);
1590
readerAdapter.OnNewLine(
curPos
);
1594
if ( chars[
curPos
+1] == (char)0xA ) {
1601
else if (
curPos
+1 < charsUsed || readerAdapter.IsEof ) {
1602
chars[
curPos
] = (char)0xA; // EOL normalization of 0xD
1608
readerAdapter.OnNewLine(
curPos
);
1616
if ( charsUsed -
curPos
< 2 ) {
1619
if ( !xmlCharType.IsWhiteSpace( chars[
curPos
+1] ) ) {
1631
Throw(
curPos
, Res.Xml_ExpectingWhiteSpace, ParseUnexpectedToken(
curPos
) );
1633
tokenStartPos =
curPos
;
1685
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
1693
switch ( chars[
curPos
] ) {
1695
switch ( chars[
curPos
+1] ) {
1697
switch ( chars[
curPos
+2] ) {
1699
if ( chars[
curPos
+3] == 'L' ) {
1700
if ( charsUsed -
curPos
< 9 ) {
1703
if ( chars[
curPos
+4] != 'E' || chars[
curPos
+5] != 'M' ||
1704
chars[
curPos
+6] != 'E' || chars[
curPos
+7] != 'N' ||
1705
chars[
curPos
+8] != 'T' ) {
1706
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1713
else if ( chars[
curPos
+3] == 'N' ) {
1714
if ( charsUsed -
curPos
< 8 ) {
1717
if ( chars[
curPos
+4] != 'T' || chars[
curPos
+5] != 'I' ||
1718
chars[
curPos
+6] != 'T' || chars[
curPos
+7] != 'Y' ) {
1719
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1726
if ( charsUsed -
curPos
< 4 ) {
1729
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1734
if ( charsUsed -
curPos
< 9 ) {
1737
if ( chars[
curPos
+3] != 'T' || chars[
curPos
+4] != 'T' ||
1738
chars[
curPos
+5] != 'L' || chars[
curPos
+6] != 'I' ||
1739
chars[
curPos
+7] != 'S' || chars[
curPos
+8] != 'T' ) {
1740
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1748
if ( charsUsed -
curPos
< 10 ) {
1751
if ( chars[
curPos
+3] != 'O' || chars[
curPos
+4] != 'T' ||
1752
chars[
curPos
+5] != 'A' || chars[
curPos
+6] != 'T' ||
1753
chars[
curPos
+7] != 'I' || chars[
curPos
+8] != 'O' ||
1754
chars[
curPos
+9] != 'N' ) {
1755
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1767
if ( chars[
curPos
+3] == '-' ) {
1772
if ( charsUsed -
curPos
< 4 ) {
1775
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1779
if ( charsUsed -
curPos
< 3 ) {
1782
Throw(
curPos
+ 2, Res.Xml_ExpectDtdMarkup );
1790
if ( charsUsed -
curPos
< 2 ) {
1793
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1798
if ( charsUsed -
curPos
< 2 && !readerAdapter.IsEof ) {
1801
if ( chars[
curPos
+1] != ']' ) {
1806
if ( charsUsed -
curPos
< 3 && !readerAdapter.IsEof ) {
1809
if ( chars[
curPos
+1] == ']' && chars[
curPos
+2] == '>' ) {
1815
if ( charsUsed -
curPos
== 0 ) {
1818
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1847
switch ( chars[
curPos
] ) {
1850
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
1857
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
1871
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
1877
switch ( chars[
curPos
] ) {
1887
Throw(
curPos
, Res.Xml_ExpectSubOrClose );
1893
if ( chars[
curPos
] != '>' ) {
1894
ThrowUnexpectedToken(
curPos
, ">" );
1903
switch ( chars[
curPos
] ) {
1909
if ( charsUsed -
curPos
< 5 ) {
1912
if ( chars[
curPos
+1] == 'M' && chars[
curPos
+2] == 'P' &&
1913
chars[
curPos
+3] == 'T' && chars[
curPos
+4] == 'Y' ) {
1920
if ( charsUsed -
curPos
< 3 ) {
1923
if ( chars[
curPos
+1] == 'N' && chars[
curPos
+2] == 'Y' ) {
1930
Throw(
curPos
, Res.Xml_InvalidContentModel );
1935
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
1941
if ( chars[
curPos
] == '#' ) {
1942
while ( charsUsed -
curPos
< 7 ) {
1944
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
1947
if ( chars[
curPos
+1] == 'P' && chars[
curPos
+2] == 'C' &&
1948
chars[
curPos
+3] == 'D' && chars[
curPos
+4] == 'A' &&
1949
chars[
curPos
+5] == 'T' && chars[
curPos
+6] == 'A' ) {
1955
Throw(
curPos
+ 1, Res.Xml_ExpectPcData );
1964
switch ( chars[
curPos
] ) {
1983
switch ( chars[
curPos
] ) {
1997
Throw(
curPos
, Res.Xml_ExpectNoWhitespace );
2004
switch ( chars[
curPos
] ) {
2022
Throw(
curPos
, Res.Xml_ExpectOp );
2028
switch ( chars[
curPos
] ) {
2039
ThrowUnexpectedToken(
curPos
, ")", "|" );
2046
if ( chars[
curPos
] == '*' && !whitespaceSeen ) {
2054
switch ( chars[
curPos
] ) {
2061
Throw(
curPos
, Res.Xml_ExpectingWhiteSpace, ParseUnexpectedToken(
curPos
) );
2071
switch ( chars[
curPos
] ) {
2078
if ( charsUsed -
curPos
< 5 )
2080
if ( chars[
curPos
+1] != 'D' || chars[
curPos
+2] != 'A' ||
2081
chars[
curPos
+3] != 'T' || chars[
curPos
+4] != 'A' ) {
2082
Throw(
curPos
, Res.Xml_InvalidAttributeType1 );
2088
if ( charsUsed -
curPos
< 9 )
2091
if ( chars[
curPos
+1] != 'N' || chars[
curPos
+2] != 'T' ||
2092
chars[
curPos
+3] != 'I' || chars[
curPos
+4] != 'T' ) {
2093
Throw(
curPos
, Res.Xml_InvalidAttributeType );
2095
switch ( chars[
curPos
+5] ) {
2097
if ( chars[
curPos
+6] != 'E' || chars[
curPos
+7] != 'S' ) {
2098
Throw(
curPos
, Res.Xml_InvalidAttributeType );
2106
Throw(
curPos
, Res.Xml_InvalidAttributeType );
2111
if ( charsUsed -
curPos
< 6 )
2114
if ( chars[
curPos
+1] != 'D' ) {
2115
Throw(
curPos
, Res.Xml_InvalidAttributeType );
2118
if ( chars[
curPos
+2] != 'R' ) {
2123
if ( chars[
curPos
+3] != 'E' || chars[
curPos
+4] != 'F' ) {
2124
Throw(
curPos
, Res.Xml_InvalidAttributeType );
2127
if ( chars[
curPos
+5] != 'S' ) {
2136
if ( charsUsed -
curPos
< 8 && !readerAdapter.IsEof ) {
2139
switch ( chars[
curPos
+1] ) {
2141
if ( chars[
curPos
+2] != 'T' || chars[
curPos
+3] != 'A' ||
2142
chars[
curPos
+4] != 'T' || chars[
curPos
+5] != 'I' ||
2143
chars[
curPos
+6] != 'O' || chars[
curPos
+7] != 'N' ) {
2144
Throw(
curPos
, Res.Xml_InvalidAttributeType );
2150
if ( chars[
curPos
+2] != 'T' || chars[
curPos
+3] != 'O' ||
2151
chars[
curPos
+4] != 'K' || chars[
curPos
+5] != 'E' ||
2152
chars[
curPos
+6] != 'N' ) {
2153
Throw(
curPos
, Res.Xml_InvalidAttributeType );
2157
if ( chars[
curPos
+7] == 'S' ) {
2166
Throw(
curPos
, Res.Xml_InvalidAttributeType );
2171
Throw(
curPos
, Res.Xml_InvalidAttributeType );
2177
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
2183
if ( chars[
curPos
] == '(' ) {
2190
ThrowUnexpectedToken(
curPos
, "(" );
2196
switch ( chars[
curPos
] ) {
2207
ThrowUnexpectedToken(
curPos
, ")", "|" );
2213
switch ( chars[
curPos
] ) {
2224
ThrowUnexpectedToken(
curPos
, ")", "|" );
2232
switch ( chars[
curPos
] ) {
2239
if ( charsUsed -
curPos
< 6 )
2241
switch ( chars[
curPos
+1] ) {
2243
if ( charsUsed -
curPos
< 9 )
2245
if ( chars[
curPos
+2] != 'E' || chars[
curPos
+3] != 'Q' ||
2246
chars[
curPos
+4] != 'U' || chars[
curPos
+5] != 'I' ||
2247
chars[
curPos
+6] != 'R' || chars[
curPos
+7] != 'E' ||
2248
chars[
curPos
+8] != 'D' ) {
2249
Throw(
curPos
, Res.Xml_ExpectAttType );
2255
if ( charsUsed -
curPos
< 8 )
2257
if ( chars[
curPos
+2] != 'M' || chars[
curPos
+3] != 'P' ||
2258
chars[
curPos
+4] != 'L' || chars[
curPos
+5] != 'I' ||
2259
chars[
curPos
+6] != 'E' || chars[
curPos
+7] != 'D' ) {
2260
Throw(
curPos
, Res.Xml_ExpectAttType );
2266
if ( chars[
curPos
+2] != 'I' || chars[
curPos
+3] != 'X' ||
2267
chars[
curPos
+4] != 'E' || chars[
curPos
+5] != 'D' ) {
2268
Throw(
curPos
, Res.Xml_ExpectAttType );
2274
Throw(
curPos
, Res.Xml_ExpectAttType );
2279
Throw(
curPos
, Res.Xml_ExpectAttType );
2284
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
2290
switch ( chars[
curPos
] ) {
2297
ThrowUnexpectedToken(
curPos
, "\"", "'" );
2303
Debug.Assert( chars[
curPos
] == '"' || chars[
curPos
] == '\'' );
2305
char quoteChar = chars[
curPos
];
2312
tokenStartPos =
curPos
;
2328
while ( ( xmlCharType.charProperties[chars[
curPos
]] & XmlCharType.fAttrValue ) != 0 && chars[
curPos
] != '%' ) {
2334
if ( chars[
curPos
] == quoteChar && currentEntityId == startQuoteEntityId ) {
2336
stringBuilder.Append( chars, tokenStartPos,
curPos
- tokenStartPos );
2343
int tmp1 =
curPos
- tokenStartPos;
2346
tokenStartPos =
curPos
;
2349
switch ( chars[
curPos
] ) {
2360
tokenStartPos =
curPos
;
2362
readerAdapter.OnNewLine(
curPos
);
2365
if ( chars[
curPos
+1] == (char)0xA ) {
2373
tokenStartPos =
curPos
+ 2;
2380
else if (
curPos
+1 == charsUsed ) {
2387
tokenStartPos =
curPos
; // For entities: EOL normalization of 0xD and 0xD 0xA
2390
readerAdapter.OnNewLine(
curPos
);
2403
Throw(
curPos
, Res.Xml_BadAttributeChar, XmlException.BuildCharExceptionArgs( '<', '\0' ) );
2414
tokenStartPos =
curPos
;
2422
if (
curPos
+ 1 == charsUsed ) {
2426
if ( chars[
curPos
+ 1] == '#' ) {
2430
stringBuilder.Append( chars,
curPos
, endPos -
curPos
);
2444
stringBuilder.Append( chars,
curPos
, endPos -
curPos
);
2452
tokenStartPos =
curPos
;
2461
tokenStartPos =
curPos
;
2468
tokenStartPos =
curPos
;
2478
if (
curPos
== charsUsed ) {
2483
char ch = chars[
curPos
];
2485
if (
curPos
+ 1 == charsUsed ) {
2489
if ( XmlCharType.IsLowSurrogate(chars[
curPos
]) ) {
2494
ThrowInvalidChar( chars, charsUsed,
curPos
);
2500
Debug.Assert(
curPos
- tokenStartPos == 0 );
2505
Throw(
curPos
, Res.Xml_UnclosedQuote );
2508
tokenStartPos =
curPos
;
2520
if ( chars[
curPos
] != ';' ) {
2521
ThrowUnexpectedToken(
curPos
, ";" );
2530
switch ( chars[
curPos
] ) {
2533
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
2540
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
2546
Throw(
curPos
, Res.Xml_ExpectExternalOrPublicId );
2552
if ( chars[
curPos
] != '"' && chars[
curPos
] != '\'' ) {
2553
ThrowUnexpectedToken(
curPos
, "\"", "'" );
2563
if ( chars[
curPos
] == '%' ) {
2577
switch ( chars[
curPos
] ) {
2580
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
2587
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
2599
Throw(
curPos
, Res.Xml_ExpectExternalIdOrEntityValue );
2605
if ( chars[
curPos
] == 'N' ) {
2606
while ( charsUsed -
curPos
< 5 ) {
2611
if ( chars[
curPos
+1] == 'D' && chars[
curPos
+2] == 'A' &&
2612
chars[
curPos
+3] == 'T' && chars[
curPos
+4] == 'A' ) {
2625
if ( chars[
curPos
] != '"' && chars[
curPos
] != '\'' ) {
2626
ThrowUnexpectedToken(
curPos
, "\"", "'" );
2636
if ( chars[
curPos
] != '"' && chars[
curPos
] != '\'' ) {
2648
if ( chars[
curPos
] != 'I' ) {
2649
Throw(
curPos
, Res.Xml_ExpectIgnoreOrInclude );
2654
if ( charsUsed -
curPos
< 5 ) {
2657
switch ( chars[
curPos
] ) {
2659
if ( charsUsed -
curPos
< 6 ) {
2662
if ( chars[
curPos
+1] != 'C' || chars[
curPos
+2] != 'L' ||
2663
chars[
curPos
+3] != 'U' || chars[
curPos
+4] != 'D' ||
2664
chars[
curPos
+5] != 'E' || xmlCharType.IsNameSingleChar( chars[
curPos
+6] )
2676
if ( chars[
curPos
+1] != 'N' || chars[
curPos
+2] != 'O' ||
2677
chars[
curPos
+3] != 'R' || chars[
curPos
+4] != 'E' ||
2678
xmlCharType.IsNameSingleChar( chars[
curPos
+ 5] )
2690
Throw(
curPos
- 1, Res.Xml_ExpectIgnoreOrInclude );
2695
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
2701
if ( chars[
curPos
] != '[' ) {
2702
ThrowUnexpectedToken(
curPos
, "[" );
2721
while ( ( xmlCharType.charProperties[chars[
curPos
]] & XmlCharType.fText ) != 0 && chars[
curPos
] != ']' ) {
2727
switch ( chars[
curPos
] ) {
2737
readerAdapter.OnNewLine(
curPos
);
2740
if ( chars[
curPos
+1] == (char)0xA ) {
2743
else if (
curPos
+1 < charsUsed || readerAdapter.IsEof ) {
2749
readerAdapter.OnNewLine(
curPos
);
2752
if ( charsUsed -
curPos
< 3 ) {
2755
if ( chars[
curPos
+1] != '!' || chars[
curPos
+2] != '[' ) {
2763
if ( charsUsed -
curPos
< 3 ) {
2766
if ( chars[
curPos
+1] != ']' || chars[
curPos
+2] != '>' ) {
2782
if (
curPos
== charsUsed ) {
2787
char ch = chars[
curPos
];
2789
if (
curPos
+ 1 == charsUsed ) {
2793
if ( XmlCharType.IsLowSurrogate(chars[
curPos
])) {
2798
ThrowInvalidChar( chars, charsUsed,
curPos
);
2809
Throw(
curPos
, Res.Xml_UnclosedConditionalSection );
2811
tokenStartPos =
curPos
;
2824
tokenStartPos =
curPos
;
2834
if ( ( xmlCharType.charProperties[chars[
curPos
]] & XmlCharType.fNCStartNameSC ) != 0 || chars[
curPos
] == ':') { // if ( xmlCharType.IsStartNCNameSingleChar(chars[curPos]) || chars[curPos] == ':' ) {
2845
if (
curPos
+ 1 >= charsUsed ) {
2849
Throw(
curPos
, Res.Xml_UnexpectedEOF, "Name" );
2852
Throw(
curPos
, Res.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs( chars, charsUsed,
curPos
) );
2864
if ( ( xmlCharType.charProperties[chars[
curPos
]] & XmlCharType.fNCNameSC ) != 0 ) { // while ( xmlCharType.IsNCNameSingleChar(chars[curPos]) ) {
2880
if ( chars[
curPos
] == ':' ) {
2883
Throw(
curPos
, Res.Xml_BadNameChar, XmlException.BuildCharExceptionArgs( ':', '\0' ));
2885
colonOffset =
curPos
- tokenStartPos;
2895
else if (
curPos
== charsUsed
2903
if ( tokenStartPos ==
curPos
) {
2904
Throw(
curPos
, Res.Xml_UnexpectedEOF, "Name" );
2914
int offset =
curPos
- tokenStartPos;
2917
tokenStartPos =
curPos
;
2923
tokenStartPos =
curPos
;
2932
if ((xmlCharType.charProperties[chars[
curPos
]] & XmlCharType.fNCNameSC) != 0 || chars[
curPos
] == ':') { // if ( xmlCharType.IsNCNameChar(chars[curPos]) || chars[curPos] == ':' ) {
2948
if (
curPos
< charsUsed
2953
if (
curPos
- tokenStartPos == 0 ) {
2954
Throw(
curPos
, Res.Xml_BadNameChar, XmlException.BuildCharExceptionArgs( chars, charsUsed,
curPos
) );
2959
int len =
curPos
- tokenStartPos;
2963
tokenStartPos =
curPos
;
2967
Throw(
curPos
, Res.Xml_UnexpectedEOF, "NmToken" );
2969
tokenStartPos =
curPos
;
2975
Debug.Assert( chars[
curPos
] == 'P' );
2976
while ( charsUsed -
curPos
< 6 ) {
2981
if ( chars[
curPos
+1] != 'U' || chars[
curPos
+2] != 'B' ||
2982
chars[
curPos
+3] != 'L' || chars[
curPos
+4] != 'I' ||
2983
chars[
curPos
+5] != 'C' ) {
2991
Debug.Assert( chars[
curPos
] == 'S' );
2992
while ( charsUsed -
curPos
< 6 ) {
2997
if ( chars[
curPos
+1] != 'Y' || chars[
curPos
+2] != 'S' ||
2998
chars[
curPos
+3] != 'T' || chars[
curPos
+4] != 'E' ||
2999
chars[
curPos
+5] != 'M' ) {
3010
Debug.Assert(
curPos
- tokenStartPos > 0 );
3012
return new XmlQualifiedName( nameTable.Add( chars, tokenStartPos,
curPos
- tokenStartPos ) );
3016
return new XmlQualifiedName( nameTable.Add( chars, colonPos + 1,
curPos
- colonPos - 1 ),
3027
Debug.Assert(
curPos
- tokenStartPos > 0 );
3028
return new string( chars, tokenStartPos,
curPos
- tokenStartPos );
3037
return new string( chars, tokenStartPos,
curPos
- tokenStartPos - 1 );
3045
Debug.Assert(
curPos
== 0 || chars[
curPos
-1] == '"' || chars[
curPos
-1] == '\'' );
3047
string val = ( stringBuilder.Length == 0 ) ? new string( chars, tokenStartPos,
curPos
- tokenStartPos - 1 ) : stringBuilder.ToString();
3068
SaveParsingBuffer(
curPos
);
3080
readerAdapter.CurrentPosition =
curPos
;
3087
Debug.Assert( chars[
curPos
] == '&' || chars[
curPos
] == '%' );
3095
Debug.Assert( chars[
curPos
-1] == ';' );
3099
Throw(
curPos
- entityName.Name.Length - 1, Res.Xml_InvalidParEntityRef );
3107
Throw(
curPos
- entityName.Name.Length - 1, paramEntity ? Res.Xml_RecursiveParEntity : Res.Xml_RecursiveGenEntity, entityName.Name );
3172
Debug.Assert( chars[
curPos
-1] == ';' );
3186
SendValidationEvent(
curPos
- entityName.Name.Length - 1, XmlSeverityType.Error, Res.Xml_UndeclaredParEntity, entityName.Name );
3194
SendValidationEvent(
curPos
- entityName.Name.Length - 1, XmlSeverityType.Error, Res.Xml_UndeclaredEntity, entityName.Name );
3199
Throw(
curPos
- entityName.Name.Length - 1, Res.Xml_UndeclaredEntity, entityName.Name );
3206
Throw(
curPos
- entityName.Name.Length - 1, Res.Xml_UnparsedEntityRef, entityName.Name );
3210
Throw(
curPos
- entityName.Name.Length - 1, Res.Xml_ExternalEntityInAttValue, entityName.Name );
3222
SendValidationEvent( severity, new XmlSchemaException( code, arg, BaseUriStr, (int)LineNo, (int)LinePos + ( pos -
curPos
) ) );
3251
return
curPos
- readerAdapter.LineStartPosition;
3264
Throw(
curPos
, Res.Xml_InternalError );
3302
Throw(
curPos
, Res.Xml_UnexpectedTokens2, new string[3] { unexpectedToken, expectedToken1, expectedToken2 } );
3305
Throw(
curPos
, Res.Xml_UnexpectedTokenEx, new string[2] { unexpectedToken, expectedToken1 } );
System\Xml\Schema\DtdParserAsync.cs (350)
187
Throw(
curPos
- 3, Res.Xml_InvalidConditionalSection ); // 3==strlen("<![")
197
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
202
Throw(
curPos
- 3, Res.Xml_UnexpectedCDataEnd );
208
Throw(
curPos
, Res.Xml_UnclosedConditionalSection );
212
Debug.Assert(
curPos
> 0 && chars[
curPos
-1] == ']' );
213
SaveParsingBuffer(
curPos
- 1 );
219
ThrowUnexpectedToken(
curPos
, ">" );
228
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
233
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
236
Throw(
curPos
, Res.Xml_UnclosedConditionalSection );
251
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
255
Throw(
curPos
, Res.Sch_ParEntityRefNesting );
286
attrDef.LinePosition = (int)LinePos - (
curPos
- tokenStartPos);
392
SendValidationEvent(
curPos
- 8, XmlSeverityType.Error, Res.Sch_DupNotationAttribute, elementDecl.Name.ToString() ); // 8 == strlen("NOTATION")
398
SendValidationEvent(
curPos
- 8, XmlSeverityType.Error, Res.Sch_NotationAttributeOnEmptyElement, elementDecl.Name.ToString() );// 8 == strlen("NOTATION")
501
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_AttListPresence, string.Empty );
537
SendValidationEvent(
curPos
- name.Name.Length, XmlSeverityType.Error, Res.Sch_DupElementDecl, GetNameString() );
616
ThrowUnexpectedToken(
curPos
, ">" );
765
Throw(
curPos
, Res.Xml_InvalidContentModel );
775
Throw(
curPos
, Res.Xml_InvalidContentModel );
782
Throw(
curPos
, Res.Xml_InvalidContentModel );
790
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
795
Throw(
curPos
, Res.Xml_InvalidContentModel );
844
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
850
ThrowUnexpectedToken(
curPos
, "*" );
863
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
880
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
946
ThrowUnexpectedToken(
curPos
- 5, ">" ); // 5 == strlen("NDATA")
949
Throw(
curPos
- 5, Res.Xml_ExpectingWhiteSpace, "NDATA" );
1003
SendValidationEvent(
curPos
- notationName.Name.Length, XmlSeverityType.Error, Res.Sch_DupNotation, notationName.Name );
1080
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
1102
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
1111
SendValidationEvent(
curPos
, XmlSeverityType.Error, Res.Sch_ParEntityRefNesting, string.Empty );
1131
ThrowUnexpectedToken(
curPos
, "\"", "'" );
1138
Throw(
curPos
- systemId.Length - 1, Res.Xml_FragmentId, new string[] { systemId.Substring( systemId.IndexOf( '#' ) ), systemId } );
1153
ThrowInvalidChar(
curPos
- 1 - publicId.Length + i, publicId, i );
1169
ThrowUnexpectedToken(
curPos
, "\"", "'" );
1180
ThrowUnexpectedToken(
curPos
, "\"", "'" );
1195
switch ( chars[
curPos
] ) {
1197
if (
curPos
== charsUsed ) {
1201
ThrowInvalidChar( chars, charsUsed,
curPos
);
1207
readerAdapter.OnNewLine(
curPos
);
1211
if ( chars[
curPos
+1] == (char)0xA ) {
1218
else if (
curPos
+1 < charsUsed || readerAdapter.IsEof ) {
1219
chars[
curPos
] = (char)0xA; // EOL normalization of 0xD
1225
readerAdapter.OnNewLine(
curPos
);
1233
if ( charsUsed -
curPos
< 2 ) {
1236
if ( !xmlCharType.IsWhiteSpace( chars[
curPos
+1] ) ) {
1248
Throw(
curPos
, Res.Xml_ExpectingWhiteSpace, ParseUnexpectedToken(
curPos
) );
1250
tokenStartPos =
curPos
;
1302
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
1310
switch ( chars[
curPos
] ) {
1312
switch ( chars[
curPos
+1] ) {
1314
switch ( chars[
curPos
+2] ) {
1316
if ( chars[
curPos
+3] == 'L' ) {
1317
if ( charsUsed -
curPos
< 9 ) {
1320
if ( chars[
curPos
+4] != 'E' || chars[
curPos
+5] != 'M' ||
1321
chars[
curPos
+6] != 'E' || chars[
curPos
+7] != 'N' ||
1322
chars[
curPos
+8] != 'T' ) {
1323
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1330
else if ( chars[
curPos
+3] == 'N' ) {
1331
if ( charsUsed -
curPos
< 8 ) {
1334
if ( chars[
curPos
+4] != 'T' || chars[
curPos
+5] != 'I' ||
1335
chars[
curPos
+6] != 'T' || chars[
curPos
+7] != 'Y' ) {
1336
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1343
if ( charsUsed -
curPos
< 4 ) {
1346
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1351
if ( charsUsed -
curPos
< 9 ) {
1354
if ( chars[
curPos
+3] != 'T' || chars[
curPos
+4] != 'T' ||
1355
chars[
curPos
+5] != 'L' || chars[
curPos
+6] != 'I' ||
1356
chars[
curPos
+7] != 'S' || chars[
curPos
+8] != 'T' ) {
1357
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1365
if ( charsUsed -
curPos
< 10 ) {
1368
if ( chars[
curPos
+3] != 'O' || chars[
curPos
+4] != 'T' ||
1369
chars[
curPos
+5] != 'A' || chars[
curPos
+6] != 'T' ||
1370
chars[
curPos
+7] != 'I' || chars[
curPos
+8] != 'O' ||
1371
chars[
curPos
+9] != 'N' ) {
1372
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1384
if ( chars[
curPos
+3] == '-' ) {
1389
if ( charsUsed -
curPos
< 4 ) {
1392
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1396
if ( charsUsed -
curPos
< 3 ) {
1399
Throw(
curPos
+ 2, Res.Xml_ExpectDtdMarkup );
1407
if ( charsUsed -
curPos
< 2 ) {
1410
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1415
if ( charsUsed -
curPos
< 2 && !readerAdapter.IsEof ) {
1418
if ( chars[
curPos
+1] != ']' ) {
1423
if ( charsUsed -
curPos
< 3 && !readerAdapter.IsEof ) {
1426
if ( chars[
curPos
+1] == ']' && chars[
curPos
+2] == '>' ) {
1432
if ( charsUsed -
curPos
== 0 ) {
1435
Throw(
curPos
, Res.Xml_ExpectDtdMarkup );
1464
switch ( chars[
curPos
] ) {
1467
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
1474
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
1488
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
1495
switch ( chars[
curPos
] ) {
1501
if ( charsUsed -
curPos
< 5 ) {
1504
if ( chars[
curPos
+1] == 'M' && chars[
curPos
+2] == 'P' &&
1505
chars[
curPos
+3] == 'T' && chars[
curPos
+4] == 'Y' ) {
1512
if ( charsUsed -
curPos
< 3 ) {
1515
if ( chars[
curPos
+1] == 'N' && chars[
curPos
+2] == 'Y' ) {
1522
Throw(
curPos
, Res.Xml_InvalidContentModel );
1527
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
1533
if ( chars[
curPos
] == '#' ) {
1534
while ( charsUsed -
curPos
< 7 ) {
1536
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
1539
if ( chars[
curPos
+1] == 'P' && chars[
curPos
+2] == 'C' &&
1540
chars[
curPos
+3] == 'D' && chars[
curPos
+4] == 'A' &&
1541
chars[
curPos
+5] == 'T' && chars[
curPos
+6] == 'A' ) {
1547
Throw(
curPos
+ 1, Res.Xml_ExpectPcData );
1556
switch ( chars[
curPos
] ) {
1572
switch ( chars[
curPos
] ) {
1579
Throw(
curPos
, Res.Xml_ExpectingWhiteSpace, ParseUnexpectedToken(
curPos
) );
1589
switch ( chars[
curPos
] ) {
1596
if ( charsUsed -
curPos
< 5 )
1598
if ( chars[
curPos
+1] != 'D' || chars[
curPos
+2] != 'A' ||
1599
chars[
curPos
+3] != 'T' || chars[
curPos
+4] != 'A' ) {
1600
Throw(
curPos
, Res.Xml_InvalidAttributeType1 );
1606
if ( charsUsed -
curPos
< 9 )
1609
if ( chars[
curPos
+1] != 'N' || chars[
curPos
+2] != 'T' ||
1610
chars[
curPos
+3] != 'I' || chars[
curPos
+4] != 'T' ) {
1611
Throw(
curPos
, Res.Xml_InvalidAttributeType );
1613
switch ( chars[
curPos
+5] ) {
1615
if ( chars[
curPos
+6] != 'E' || chars[
curPos
+7] != 'S' ) {
1616
Throw(
curPos
, Res.Xml_InvalidAttributeType );
1624
Throw(
curPos
, Res.Xml_InvalidAttributeType );
1629
if ( charsUsed -
curPos
< 6 )
1632
if ( chars[
curPos
+1] != 'D' ) {
1633
Throw(
curPos
, Res.Xml_InvalidAttributeType );
1636
if ( chars[
curPos
+2] != 'R' ) {
1641
if ( chars[
curPos
+3] != 'E' || chars[
curPos
+4] != 'F' ) {
1642
Throw(
curPos
, Res.Xml_InvalidAttributeType );
1645
if ( chars[
curPos
+5] != 'S' ) {
1654
if ( charsUsed -
curPos
< 8 && !readerAdapter.IsEof ) {
1657
switch ( chars[
curPos
+1] ) {
1659
if ( chars[
curPos
+2] != 'T' || chars[
curPos
+3] != 'A' ||
1660
chars[
curPos
+4] != 'T' || chars[
curPos
+5] != 'I' ||
1661
chars[
curPos
+6] != 'O' || chars[
curPos
+7] != 'N' ) {
1662
Throw(
curPos
, Res.Xml_InvalidAttributeType );
1668
if ( chars[
curPos
+2] != 'T' || chars[
curPos
+3] != 'O' ||
1669
chars[
curPos
+4] != 'K' || chars[
curPos
+5] != 'E' ||
1670
chars[
curPos
+6] != 'N' ) {
1671
Throw(
curPos
, Res.Xml_InvalidAttributeType );
1675
if ( chars[
curPos
+7] == 'S' ) {
1684
Throw(
curPos
, Res.Xml_InvalidAttributeType );
1689
Throw(
curPos
, Res.Xml_InvalidAttributeType );
1695
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
1702
switch ( chars[
curPos
] ) {
1709
if ( charsUsed -
curPos
< 6 )
1711
switch ( chars[
curPos
+1] ) {
1713
if ( charsUsed -
curPos
< 9 )
1715
if ( chars[
curPos
+2] != 'E' || chars[
curPos
+3] != 'Q' ||
1716
chars[
curPos
+4] != 'U' || chars[
curPos
+5] != 'I' ||
1717
chars[
curPos
+6] != 'R' || chars[
curPos
+7] != 'E' ||
1718
chars[
curPos
+8] != 'D' ) {
1719
Throw(
curPos
, Res.Xml_ExpectAttType );
1725
if ( charsUsed -
curPos
< 8 )
1727
if ( chars[
curPos
+2] != 'M' || chars[
curPos
+3] != 'P' ||
1728
chars[
curPos
+4] != 'L' || chars[
curPos
+5] != 'I' ||
1729
chars[
curPos
+6] != 'E' || chars[
curPos
+7] != 'D' ) {
1730
Throw(
curPos
, Res.Xml_ExpectAttType );
1736
if ( chars[
curPos
+2] != 'I' || chars[
curPos
+3] != 'X' ||
1737
chars[
curPos
+4] != 'E' || chars[
curPos
+5] != 'D' ) {
1738
Throw(
curPos
, Res.Xml_ExpectAttType );
1744
Throw(
curPos
, Res.Xml_ExpectAttType );
1749
Throw(
curPos
, Res.Xml_ExpectAttType );
1754
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
1760
Debug.Assert( chars[
curPos
] == '"' || chars[
curPos
] == '\'' );
1762
char quoteChar = chars[
curPos
];
1769
tokenStartPos =
curPos
;
1785
while ((xmlCharType.charProperties[chars[
curPos
]] & XmlCharType.fAttrValue) != 0 && chars[
curPos
] != '%') {
1791
if ( chars[
curPos
] == quoteChar && currentEntityId == startQuoteEntityId ) {
1793
stringBuilder.Append( chars, tokenStartPos,
curPos
- tokenStartPos );
1800
int tmp1 =
curPos
- tokenStartPos;
1803
tokenStartPos =
curPos
;
1806
switch ( chars[
curPos
] ) {
1817
tokenStartPos =
curPos
;
1819
readerAdapter.OnNewLine(
curPos
);
1822
if ( chars[
curPos
+1] == (char)0xA ) {
1830
tokenStartPos =
curPos
+ 2;
1837
else if (
curPos
+1 == charsUsed ) {
1844
tokenStartPos =
curPos
; // For entities: EOL normalization of 0xD and 0xD 0xA
1847
readerAdapter.OnNewLine(
curPos
);
1860
Throw(
curPos
, Res.Xml_BadAttributeChar, XmlException.BuildCharExceptionArgs( '<', '\0' ) );
1871
tokenStartPos =
curPos
;
1879
if (
curPos
+ 1 == charsUsed ) {
1883
if ( chars[
curPos
+ 1] == '#' ) {
1887
stringBuilder.Append( chars,
curPos
, endPos -
curPos
);
1901
stringBuilder.Append( chars,
curPos
, endPos -
curPos
);
1909
tokenStartPos =
curPos
;
1918
tokenStartPos =
curPos
;
1925
tokenStartPos =
curPos
;
1935
if (
curPos
== charsUsed ) {
1940
char ch = chars[
curPos
];
1942
if (
curPos
+ 1 == charsUsed ) {
1946
if ( XmlCharType.IsLowSurrogate(chars[
curPos
]) ) {
1951
ThrowInvalidChar( chars, charsUsed,
curPos
);
1957
Debug.Assert(
curPos
- tokenStartPos == 0 );
1962
Throw(
curPos
, Res.Xml_UnclosedQuote );
1965
tokenStartPos =
curPos
;
1970
switch ( chars[
curPos
] ) {
1973
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
1980
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
1986
Throw(
curPos
, Res.Xml_ExpectExternalOrPublicId );
1992
if ( chars[
curPos
] != '"' && chars[
curPos
] != '\'' ) {
1993
ThrowUnexpectedToken(
curPos
, "\"", "'" );
2003
if ( chars[
curPos
] == '%' ) {
2017
switch ( chars[
curPos
] ) {
2020
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
2027
Throw(
curPos
, Res.Xml_ExpectExternalOrClose );
2039
Throw(
curPos
, Res.Xml_ExpectExternalIdOrEntityValue );
2045
if ( chars[
curPos
] == 'N' ) {
2046
while ( charsUsed -
curPos
< 5 ) {
2051
if ( chars[
curPos
+1] == 'D' && chars[
curPos
+2] == 'A' &&
2052
chars[
curPos
+3] == 'T' && chars[
curPos
+4] == 'A' ) {
2065
if ( chars[
curPos
] != '"' && chars[
curPos
] != '\'' ) {
2066
ThrowUnexpectedToken(
curPos
, "\"", "'" );
2076
if ( chars[
curPos
] != '"' && chars[
curPos
] != '\'' ) {
2088
if ( chars[
curPos
] != 'I' ) {
2089
Throw(
curPos
, Res.Xml_ExpectIgnoreOrInclude );
2094
if ( charsUsed -
curPos
< 5 ) {
2097
switch ( chars[
curPos
] ) {
2099
if ( charsUsed -
curPos
< 6 ) {
2102
if ( chars[
curPos
+1] != 'C' || chars[
curPos
+2] != 'L' ||
2103
chars[
curPos
+3] != 'U' || chars[
curPos
+4] != 'D' ||
2104
chars[
curPos
+5] != 'E' || xmlCharType.IsNameSingleChar( chars[
curPos
+6] )
2116
if ( chars[
curPos
+1] != 'N' || chars[
curPos
+2] != 'O' ||
2117
chars[
curPos
+3] != 'R' || chars[
curPos
+4] != 'E' ||
2118
xmlCharType.IsNameSingleChar( chars[
curPos
+ 5] )
2130
Throw(
curPos
- 1, Res.Xml_ExpectIgnoreOrInclude );
2135
Throw(
curPos
, Res.Xml_IncompleteDtdContent );
2152
while ((xmlCharType.charProperties[chars[
curPos
]] & XmlCharType.fText) != 0 && chars[
curPos
] != ']') {
2158
switch ( chars[
curPos
] ) {
2168
readerAdapter.OnNewLine(
curPos
);
2171
if ( chars[
curPos
+1] == (char)0xA ) {
2174
else if (
curPos
+1 < charsUsed || readerAdapter.IsEof ) {
2180
readerAdapter.OnNewLine(
curPos
);
2183
if ( charsUsed -
curPos
< 3 ) {
2186
if ( chars[
curPos
+1] != '!' || chars[
curPos
+2] != '[' ) {
2194
if ( charsUsed -
curPos
< 3 ) {
2197
if ( chars[
curPos
+1] != ']' || chars[
curPos
+2] != '>' ) {
2213
if (
curPos
== charsUsed ) {
2218
char ch = chars[
curPos
];
2220
if (
curPos
+ 1 == charsUsed ) {
2224
if ( XmlCharType.IsLowSurrogate(chars[
curPos
])) {
2229
ThrowInvalidChar( chars, charsUsed,
curPos
);
2240
Throw(
curPos
, Res.Xml_UnclosedConditionalSection );
2242
tokenStartPos =
curPos
;
2255
tokenStartPos =
curPos
;
2266
if ((xmlCharType.charProperties[chars[
curPos
]] & XmlCharType.fNCStartNameSC) != 0 || chars[
curPos
] == ':') { // if ( xmlCharType.IsStartNCNameSingleChar(chars[curPos]) || chars[curPos] == ':' ) {
2276
if (
curPos
+ 1 >= charsUsed) {
2280
Throw(
curPos
, Res.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, charsUsed,
curPos
));
2289
Throw(
curPos
, Res.Xml_UnexpectedEOF, "Name");
2298
if ((xmlCharType.charProperties[chars[
curPos
]] & XmlCharType.fNCNameSC) != 0) { // while ( xmlCharType.IsNCNameSingleChar(chars[curPos]) ) {
2314
if ( chars[
curPos
] == ':' ) {
2317
Throw(
curPos
, Res.Xml_BadNameChar, XmlException.BuildCharExceptionArgs( ':', '\0' ));
2319
colonOffset =
curPos
- tokenStartPos;
2329
else if (
curPos
== charsUsed
2337
if ( tokenStartPos ==
curPos
) {
2338
Throw(
curPos
, Res.Xml_UnexpectedEOF, "Name" );
2348
int offset =
curPos
- tokenStartPos;
2351
tokenStartPos =
curPos
;
2357
tokenStartPos =
curPos
;
2366
if ((xmlCharType.charProperties[chars[
curPos
]] & XmlCharType.fNCNameSC) != 0 || chars[
curPos
] == ':') { // if ( xmlCharType.IsNCNameChar(chars[curPos]) || chars[curPos] == ':' ) {
2381
if (
curPos
< charsUsed
2386
if (
curPos
- tokenStartPos == 0 ) {
2387
Throw(
curPos
, Res.Xml_BadNameChar, XmlException.BuildCharExceptionArgs( chars, charsUsed,
curPos
) );
2392
int len =
curPos
- tokenStartPos;
2396
tokenStartPos =
curPos
;
2400
Throw(
curPos
, Res.Xml_UnexpectedEOF, "NmToken" );
2402
tokenStartPos =
curPos
;
2408
Debug.Assert( chars[
curPos
] == 'P' );
2409
while ( charsUsed -
curPos
< 6 ) {
2414
if ( chars[
curPos
+1] != 'U' || chars[
curPos
+2] != 'B' ||
2415
chars[
curPos
+3] != 'L' || chars[
curPos
+4] != 'I' ||
2416
chars[
curPos
+5] != 'C' ) {
2424
Debug.Assert( chars[
curPos
] == 'S' );
2425
while ( charsUsed -
curPos
< 6 ) {
2430
if ( chars[
curPos
+1] != 'Y' || chars[
curPos
+2] != 'S' ||
2431
chars[
curPos
+3] != 'T' || chars[
curPos
+4] != 'E' ||
2432
chars[
curPos
+5] != 'M' ) {
2453
Debug.Assert( chars[
curPos
] == '&' || chars[
curPos
] == '%' );
2461
Debug.Assert( chars[
curPos
-1] == ';' );
2465
Throw(
curPos
- entityName.Name.Length - 1, Res.Xml_InvalidParEntityRef );
2473
Throw(
curPos
- entityName.Name.Length - 1, paramEntity ? Res.Xml_RecursiveParEntity : Res.Xml_RecursiveGenEntity, entityName.Name );