1 write to _ps
dotnet-svcutil-lib (1)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (1)
8261
_ps
= _parsingStatesStack[_parsingStatesStackTop--];
1014 references to _ps
dotnet-svcutil-lib (1014)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (1014)
364
_ps
.lineNo = 1;
365
_ps
.lineStartPos = -1;
428
_ps
.lineNo = _lineNumberOffset + 1;
429
_ps
.lineStartPos = -_linePositionOffset - 1;
430
_curNode.SetLineInfo(
_ps
.LineNo - 1,
_ps
.LinePos - 1);
484
_reportedBaseUri =
_ps
.baseUriStr;
485
_reportedEncoding =
_ps
.encoding;
504
_reportedEncoding =
_ps
.encoding;
528
_reportedBaseUri =
_ps
.baseUriStr;
529
_reportedEncoding =
_ps
.encoding;
552
_reportedEncoding =
_ps
.encoding;
595
_ps
.baseUri = GetTempResolver().ResolveUri(null, url);
596
_ps
.baseUriStr =
_ps
.baseUri.ToString();
597
_reportedBaseUri =
_ps
.baseUriStr;
682
_reportedEncoding =
_ps
.encoding;
756
_reportedEncoding =
_ps
.encoding;
805
_reportedEncoding =
_ps
.encoding;
824
_reportedBaseUri =
_ps
.baseUriStr;
825
_reportedEncoding =
_ps
.encoding;
1245
Debug.Assert(!
_ps
.appendMode);
1254
_reportedEncoding =
_ps
.encoding;
1257
_reportedEncoding =
_ps
.encoding;
1294
_reportedEncoding =
_ps
.encoding;
1295
_reportedBaseUri =
_ps
.baseUriStr;
1301
_curNode.SetLineInfo(
_ps
.lineNo,
_ps
.LinePos);
1302
_reportedEncoding =
_ps
.encoding;
1303
_reportedBaseUri =
_ps
.baseUriStr;
1474
_attributeValueBaseEntityId =
_ps
.entityId;
1479
if (
_ps
.entityId == _attributeValueBaseEntityId)
1515
if (
_ps
.charsUsed -
_ps
.charPos == 0)
1536
if (
_ps
.charsUsed -
_ps
.charPos == 0 && !
_ps
.entity.IsExternal)
1554
_ps
.entityResolvedManually = true;
1938
BlockCopyChars(
_ps
.chars, startPos, buffer, (index + readCount), copyCount);
1961
_curNode.SetValue(
_ps
.chars, startPos, endPos - startPos);
2083
if (
_ps
.entity == null ||
_ps
.entity.IsExternal)
2085
_ps
.eolNormalized = !value;
2174
_ps
.baseUri = null;
2240
_stringBuilder.Append(
_ps
.chars, _incReadLeftStartPos, _incReadLeftEndPos - _incReadLeftStartPos);
2250
_ps
.appendMode = false;
2253
_stringBuilder.Append(
_ps
.chars,
_ps
.charPos,
_ps
.charsUsed -
_ps
.charPos);
2254
_ps
.charPos =
_ps
.charsUsed;
2439
if (
_ps
.baseUriStr.Length > 0 &&
_ps
.baseUri == null && _xmlResolver != null)
2441
_ps
.baseUri = _xmlResolver.ResolveUri(null,
_ps
.baseUriStr);
2443
return
_ps
.baseUri;
2451
return
_ps
.isEof;
2459
return
_ps
.chars;
2467
return
_ps
.charsUsed;
2475
return
_ps
.charPos;
2479
Debug.Assert(value >= 0 && value <=
_ps
.charsUsed);
2480
_ps
.charPos = value;
2496
return
_ps
.eolNormalized;
2521
return
_ps
.LineNo;
2529
return
_ps
.lineStartPos;
2590
if (e.ResString == ResXml.Xml_UnexpectedEOF &&
_ps
.entity != null)
2592
SendValidationEvent(XmlSeverityType.Error, ResXml.Sch_ParEntityRefNesting, null,
_ps
.LineNo,
_ps
.LinePos);
2631
entityId =
_ps
.entityId;
2643
oldEntity =
_ps
.entity;
2645
newEntityId =
_ps
.entityId;
2662
if (
_ps
.baseUri == null && !string.IsNullOrEmpty(
_ps
.baseUriStr))
2664
_ps
.baseUri = _xmlResolver.ResolveUri(null,
_ps
.baseUriStr);
2666
PushExternalEntityOrSubset(publicId, systemId,
_ps
.baseUri, null);
2668
_ps
.entity = null;
2669
_ps
.entityId = 0;
2671
Debug.Assert(
_ps
.appendMode);
2672
int initialPos =
_ps
.charPos;
2679
_ps
.charPos = initialPos;
2695
_ps
.entity = null;
2696
_ps
.entityId = 0;
2697
_ps
.eolNormalized = false;
2726
_ps
.charPos = pos;
2732
_ps
.charPos = pos;
2738
_ps
.charPos = pos;
2749
Throw(new XmlException(res, string.Empty, lineNo, linePos,
_ps
.baseUriStr));
2754
Throw(new XmlException(res, arg,
_ps
.LineNo,
_ps
.LinePos,
_ps
.baseUriStr));
2759
Throw(new XmlException(res, arg, lineNo, linePos,
_ps
.baseUriStr));
2764
Throw(new XmlException(res, args,
_ps
.LineNo,
_ps
.LinePos,
_ps
.baseUriStr));
2774
Throw(new XmlException(res, args, innerException,
_ps
.LineNo,
_ps
.LinePos,
_ps
.baseUriStr));
2790
Throw(new XmlException(e.Message, (Exception)null, lineNo, linePos,
_ps
.baseUriStr));
2795
Throw(new XmlException(res, string.Empty,
_ps
.baseUriStr));
2800
Throw(new XmlException(res, arg,
_ps
.baseUriStr));
2805
Throw(new XmlException(res, args, innerException, 0, 0,
_ps
.baseUriStr));
2821
SendValidationEvent(severity, new XmlSchemaException(code, arg,
_ps
.baseUriStr, lineNo, linePos));
2856
while (
_ps
.entityId != _attributeValueBaseEntityId)
2898
Debug.Assert(
_ps
.charPos == 0 &&
_ps
.charsUsed == 0 &&
_ps
.textReader == null);
2902
_ps
.stream = stream;
2903
_ps
.baseUri = baseUri;
2904
_ps
.baseUriStr = baseUriStr;
2910
_ps
.bytes = bytes;
2911
_ps
.bytesUsed = byteCount;
2912
bufferSize =
_ps
.bytes.Length;
2927
if (
_ps
.bytes == null ||
_ps
.bytes.Length < bufferSize)
2929
_ps
.bytes = new byte[bufferSize];
2934
if (
_ps
.chars == null ||
_ps
.chars.Length < bufferSize + 1)
2936
_ps
.chars = new char[bufferSize + 1];
2940
_ps
.bytePos = 0;
2941
while (
_ps
.bytesUsed < 4 &&
_ps
.bytes.Length -
_ps
.bytesUsed > 0)
2943
int read = stream.Read(
_ps
.bytes,
_ps
.bytesUsed,
_ps
.bytes.Length -
_ps
.bytesUsed);
2946
_ps
.isStreamEof = true;
2949
_ps
.bytesUsed += read;
2960
byte[] preamble =
_ps
.encoding.GetPreamble();
2963
for (i = 0; i < preambleLen && i <
_ps
.bytesUsed; i++)
2965
if (
_ps
.bytes[i] != preamble[i])
2972
_ps
.bytePos = preambleLen;
2975
_documentStartBytePos =
_ps
.bytePos;
2977
_ps
.eolNormalized = !_normalize;
2980
_ps
.appendMode = true;
2991
Debug.Assert(
_ps
.charPos == 0 &&
_ps
.charsUsed == 0 &&
_ps
.stream == null);
2994
_ps
.textReader = input;
2995
_ps
.baseUriStr = baseUriStr;
2996
_ps
.baseUri = baseUri;
2998
if (
_ps
.chars == null)
3001
_ps
.chars = new char[XmlReader.DefaultBufferSize + 1];
3012
_ps
.encoding = Encoding.Unicode;
3013
_ps
.eolNormalized = !_normalize;
3016
_ps
.appendMode = true;
3022
Debug.Assert(
_ps
.stream == null &&
_ps
.textReader == null);
3023
Debug.Assert(
_ps
.charPos == 0 &&
_ps
.charsUsed == 0);
3027
_ps
.baseUriStr = baseUriStr;
3028
_ps
.baseUri = null;
3031
_ps
.chars = new char[len + 1];
3032
str.CopyTo(0,
_ps
.chars, 0, str.Length);
3033
_ps
.charsUsed = len;
3034
_ps
.chars[len] = (char)0;
3036
_ps
.encoding = originalEncoding;
3038
_ps
.eolNormalized = !_normalize;
3039
_ps
.isEof = true;
3058
_ps
.baseUriStr = parserContext.BaseURI;
3059
_ps
.baseUri = null;
3066
_ps
.baseUriStr = string.Empty;
3067
_ps
.baseUri = null;
3070
_reportedBaseUri =
_ps
.baseUriStr;
3075
_ps
.appendMode = false;
3090
_ps
.appendMode = false;
3138
if (
_ps
.baseUri != null)
3144
_ps
.baseUri = tmpResolver.ResolveUri(null, _url);
3145
_ps
.baseUriStr =
_ps
.baseUri.ToString();
3148
if (
_ps
.stream == null)
3150
ThrowWithoutLineInfo(ResXml.Xml_CannotResolveUrl,
_ps
.baseUriStr);
3153
InitStreamInput(
_ps
.baseUri,
_ps
.baseUriStr,
_ps
.stream, null);
3154
_reportedEncoding =
_ps
.encoding;
3160
_ps
.stream = (Stream)GetTempResolver().GetEntity(
_ps
.baseUri, null, typeof(Stream));
3166
Debug.Assert(
_ps
.bytes != null);
3167
Debug.Assert(
_ps
.bytePos == 0);
3169
if (
_ps
.bytesUsed < 2)
3173
int first2Bytes =
_ps
.bytes[0] << 8 |
_ps
.bytes[1];
3174
int next2Bytes = (
_ps
.bytesUsed >= 4) ? (
_ps
.bytes[2] << 8 |
_ps
.bytes[3]) : 0;
3251
Debug.Assert(
_ps
.charPos == 0);
3252
_ps
.encoding = Encoding.UTF8;
3253
_ps
.decoder = new SafeAsciiDecoder();
3257
_ps
.encoding = encoding;
3259
switch (
_ps
.encoding.WebName)
3262
_ps
.decoder = new UTF16Decoder(false);
3265
_ps
.decoder = new UTF16Decoder(true);
3268
_ps
.decoder = encoding.GetDecoder();
3277
if ((newEncoding.WebName !=
_ps
.encoding.WebName ||
_ps
.decoder is SafeAsciiDecoder) && !_afterResetState)
3279
Debug.Assert(
_ps
.stream != null);
3281
_ps
.appendMode = false;
3292
if (
_ps
.stream == null)
3294
return
_ps
.encoding;
3302
if (
_ps
.encoding.WebName != "utf-16BE" &&
3303
_ps
.encoding.WebName != "utf-16" &&
3315
return
_ps
.encoding;
3341
if (_afterResetState &&
_ps
.encoding.WebName != newEncoding.WebName)
3351
Debug.Assert(
_ps
.stream != null &&
_ps
.decoder != null &&
_ps
.bytes != null);
3352
Debug.Assert(
_ps
.appendMode, "UnDecodeChars cannot be called after ps.appendMode has been changed to false");
3354
Debug.Assert(
_ps
.charsUsed >=
_ps
.charPos, "The current position must be in the valid character range.");
3362
Debug.Assert(_charactersInDocument >=
_ps
.charsUsed -
_ps
.charPos,
3364
_charactersInDocument -=
_ps
.charsUsed -
_ps
.charPos;
3370
Debug.Assert(_charactersFromEntities >=
_ps
.charsUsed -
_ps
.charPos,
3372
_charactersFromEntities -=
_ps
.charsUsed -
_ps
.charPos;
3376
_ps
.bytePos = _documentStartBytePos; // byte position after preamble
3377
if (
_ps
.charPos > 0)
3379
_ps
.bytePos +=
_ps
.encoding.GetByteCount(
_ps
.chars, 0,
_ps
.charPos);
3381
_ps
.charsUsed =
_ps
.charPos;
3382
_ps
.isEof = false;
3398
if (
_ps
.isEof)
3404
if (
_ps
.appendMode)
3407
if (
_ps
.charsUsed ==
_ps
.chars.Length - 1)
3415
char[] newChars = new char[
_ps
.chars.Length * 2];
3416
BlockCopyChars(
_ps
.chars, 0, newChars, 0,
_ps
.chars.Length);
3417
_ps
.chars = newChars;
3420
if (
_ps
.stream != null)
3423
if (
_ps
.bytesUsed -
_ps
.bytePos < MaxByteSequenceLen)
3425
if (
_ps
.bytes.Length -
_ps
.bytesUsed < MaxByteSequenceLen)
3427
byte[] newBytes = new byte[
_ps
.bytes.Length * 2];
3428
BlockCopy(
_ps
.bytes, 0, newBytes, 0,
_ps
.bytesUsed);
3429
_ps
.bytes = newBytes;
3434
charsRead =
_ps
.chars.Length -
_ps
.charsUsed - 1;
3442
int charsLen =
_ps
.chars.Length;
3443
if (charsLen -
_ps
.charsUsed <= charsLen / 2)
3452
int copyCharsCount =
_ps
.charsUsed -
_ps
.charPos;
3455
_ps
.lineStartPos =
_ps
.lineStartPos -
_ps
.charPos;
3458
BlockCopyChars(
_ps
.chars,
_ps
.charPos,
_ps
.chars, 0, copyCharsCount);
3460
_ps
.charPos = 0;
3461
_ps
.charsUsed = copyCharsCount;
3465
char[] newChars = new char[
_ps
.chars.Length * 2];
3466
BlockCopyChars(
_ps
.chars, 0, newChars, 0,
_ps
.chars.Length);
3467
_ps
.chars = newChars;
3471
if (
_ps
.stream != null)
3474
int bytesLeft =
_ps
.bytesUsed -
_ps
.bytePos;
3479
_ps
.bytesUsed = 0;
3483
BlockCopy(
_ps
.bytes,
_ps
.bytePos,
_ps
.bytes, 0, bytesLeft);
3484
_ps
.bytesUsed = bytesLeft;
3486
_ps
.bytePos = 0;
3489
charsRead =
_ps
.chars.Length -
_ps
.charsUsed - 1;
3492
if (
_ps
.stream != null)
3494
if (!
_ps
.isStreamEof)
3497
if (
_ps
.bytePos ==
_ps
.bytesUsed &&
_ps
.bytes.Length -
_ps
.bytesUsed > 0)
3499
int read =
_ps
.stream.Read(
_ps
.bytes,
_ps
.bytesUsed,
_ps
.bytes.Length -
_ps
.bytesUsed);
3502
_ps
.isStreamEof = true;
3504
_ps
.bytesUsed += read;
3508
int originalBytePos =
_ps
.bytePos;
3512
if (charsRead == 0 &&
_ps
.bytePos != originalBytePos)
3518
else if (
_ps
.textReader != null)
3521
charsRead =
_ps
.textReader.Read(
_ps
.chars,
_ps
.charsUsed,
_ps
.chars.Length -
_ps
.charsUsed - 1);
3522
_ps
.charsUsed += charsRead;
3533
Debug.Assert(
_ps
.charsUsed <
_ps
.chars.Length);
3534
_ps
.isEof = true;
3536
_ps
.chars[
_ps
.charsUsed] = (char)0;
3543
Debug.Assert(
_ps
.stream != null &&
_ps
.decoder != null &&
_ps
.bytes != null);
3544
Debug.Assert(maxCharsCount <=
_ps
.chars.Length -
_ps
.charsUsed - 1);
3547
int bytesCount =
_ps
.bytesUsed -
_ps
.bytePos;
3558
_ps
.decoder.Convert(
_ps
.bytes,
_ps
.bytePos, bytesCount,
_ps
.chars,
_ps
.charsUsed, maxCharsCount, false, out bytesCount, out charsCount, out completed);
3566
_ps
.bytePos += bytesCount;
3567
_ps
.charsUsed += charsCount;
3583
_ps
.decoder.Convert(
_ps
.bytes,
_ps
.bytePos + bytesDecoded, 1,
_ps
.chars,
_ps
.charsUsed + charsDecoded, 1, false, out bDec, out chDec, out completed);
3595
Throw(
_ps
.charsUsed, ResXml.Xml_InvalidCharInThisEncoding);
3613
_ps
.Close(closeInput);
3628
BlockCopyChars(
_ps
.chars, sourcePos,
_ps
.chars, destPos, count);
3634
while (
_ps
.charsUsed -
_ps
.charPos < 6)
3642
if (!XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos, 5, XmlDeclarationBegining) ||
3643
_xmlCharType.IsNameSingleChar(
_ps
.chars[
_ps
.charPos + 5])
3654
_curNode.SetLineInfo(
_ps
.LineNo,
_ps
.LinePos + 2);
3657
_ps
.charPos += 5;
3673
if (
_ps
.chars[
_ps
.charPos] == '?')
3677
if (
_ps
.chars[
_ps
.charPos + 1] == '>')
3684
_ps
.charPos += 2;
3704
string encodingName =
_ps
.encoding.WebName;
3706
encodingName != "utf-16BE" && !(
_ps
.encoding is Ucs4Encoding))
3708
Throw(ResXml.Xml_EncodingSwitchAfterResetState, (
_ps
.encoding.GetByteCount("A") == 1) ? "UTF-8" : "UTF-16");
3711
if (
_ps
.decoder is SafeAsciiDecoder)
3720
_ps
.appendMode = false;
3723
else if (
_ps
.charPos + 1 ==
_ps
.charsUsed)
3742
switch (
_ps
.chars[
_ps
.charPos])
3745
if (XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos, nameEndPos -
_ps
.charPos, "version") && xmlDeclState == 0)
3755
if (XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos, nameEndPos -
_ps
.charPos, "encoding") &&
3767
if (XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos, nameEndPos -
_ps
.charPos, "standalone") &&
3784
attr.SetLineInfo(
_ps
.LineNo,
_ps
.LinePos);
3786
sb.Append(
_ps
.chars,
_ps
.charPos, nameEndPos -
_ps
.charPos);
3787
_ps
.charPos = nameEndPos;
3790
if (
_ps
.chars[
_ps
.charPos] != '=')
3793
if (
_ps
.chars[
_ps
.charPos] != '=')
3799
_ps
.charPos++;
3801
char quoteChar =
_ps
.chars[
_ps
.charPos];
3805
quoteChar =
_ps
.chars[
_ps
.charPos];
3812
_ps
.charPos++;
3816
attr.SetLineInfo2(
_ps
.LineNo,
_ps
.LinePos);
3820
int pos =
_ps
.charPos;
3823
chars =
_ps
.chars;
3832
if (
_ps
.chars[pos] == quoteChar)
3846
if (XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos, pos -
_ps
.charPos, "1.0"))
3851
attr.SetValue(
_ps
.chars,
_ps
.charPos, pos -
_ps
.charPos);
3857
string badVersion = new string(
_ps
.chars,
_ps
.charPos, pos -
_ps
.charPos);
3862
string encName = new string(
_ps
.chars,
_ps
.charPos, pos -
_ps
.charPos);
3871
if (XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos, pos -
_ps
.charPos, "yes"))
3875
else if (XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos, pos -
_ps
.charPos, "no"))
3882
Throw(ResXml.Xml_InvalidXmlDecl,
_ps
.LineNo,
_ps
.LinePos - 1);
3886
attr.SetValue(
_ps
.chars,
_ps
.charPos, pos -
_ps
.charPos);
3894
sb.Append(chars,
_ps
.charPos, pos -
_ps
.charPos);
3896
_ps
.charPos = pos + 1;
3899
else if (pos ==
_ps
.charsUsed)
3916
if (
_ps
.isEof || ReadData() == 0)
3931
string encodingName =
_ps
.encoding.WebName;
3933
encodingName != "utf-16BE" && !(
_ps
.encoding is Ucs4Encoding))
3935
Throw(ResXml.Xml_EncodingSwitchAfterResetState, (
_ps
.encoding.GetByteCount("A") == 1) ? "UTF-8" : "UTF-16");
3938
if (
_ps
.decoder is SafeAsciiDecoder)
3942
_ps
.appendMode = false;
3962
int pos =
_ps
.charPos;
3963
char[] chars =
_ps
.chars;
3969
if (
_ps
.charsUsed - pos < 4) // minimum "<a/>"
3976
_ps
.charPos = pos + 1;
3984
if (
_ps
.charsUsed - pos < 2) // minimum characters expected "--"
3991
_ps
.charPos = pos + 2;
4009
if (
_ps
.charsUsed - pos < 6)
4015
_ps
.charPos = pos + 6;
4030
Throw(
_ps
.charPos, ResXml.Xml_InvalidRootData);
4039
_ps
.charPos = pos;
4075
_ps
.charPos = pos;
4112
chars =
_ps
.chars;
4113
pos =
_ps
.charPos;
4119
else if (pos ==
_ps
.charsUsed || ((_v1Compat || mangoQuirks) && chars[pos] == 0x0))
4147
Debug.Assert(pos ==
_ps
.charsUsed && !
_ps
.isEof);
4153
pos =
_ps
.charPos;
4186
pos =
_ps
.charPos;
4187
chars =
_ps
.chars;
4196
int pos =
_ps
.charPos;
4197
char[] chars =
_ps
.chars;
4207
_ps
.charPos = pos + 2;
4215
if (
_ps
.charsUsed - pos < 2)
4222
_ps
.charPos = pos + 2;
4238
if (
_ps
.charsUsed - pos < 6)
4244
_ps
.charPos = pos + 6;
4267
_ps
.charPos = pos + 2;
4272
if (pos + 1 ==
_ps
.charsUsed)
4279
_ps
.charPos = pos + 1;
4293
if (pos ==
_ps
.charsUsed)
4312
if (
_ps
.charsUsed -
_ps
.charPos != 0)
4338
Throw(
_ps
.charsUsed, ResXml.Xml_UnexpectedEOF1);
4361
Throw(
_ps
.charsUsed, ResXml.Xml_UnexpectedEOFInElementContent, _stringBuilder.ToString());
4368
int pos =
_ps
.charPos;
4369
char[] chars =
_ps
.chars;
4372
_curNode.SetLineInfo(
_ps
.LineNo,
_ps
.LinePos);
4439
else if (pos + 1 <
_ps
.charsUsed)
4446
chars =
_ps
.chars;
4456
_nameTable.Add(chars,
_ps
.charPos, pos -
_ps
.charPos));
4460
int startPos =
_ps
.charPos;
4473
_nameTable.Add(chars,
_ps
.charPos, prefixLen),
4488
_ps
.charPos = pos;
4498
_ps
.charPos = pos + 1;
4504
if (pos + 1 ==
_ps
.charsUsed)
4506
_ps
.charPos = pos;
4511
pos =
_ps
.charPos;
4512
chars =
_ps
.chars;
4519
_ps
.charPos = pos + 2;
4529
Throw(pos, ResXml.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(chars,
_ps
.charsUsed, pos));
4628
while (
_ps
.charsUsed -
_ps
.charPos < prefLen + locLen + 1)
4637
char[] chars =
_ps
.chars;
4640
if (!XmlConvert.StrEqual(chars,
_ps
.charPos, locLen, startTagNode.localName))
4648
int colonPos =
_ps
.charPos + prefLen;
4649
if (!XmlConvert.StrEqual(chars,
_ps
.charPos, prefLen, startTagNode.prefix) ||
4658
LineInfo endTagLineInfo = new LineInfo(
_ps
.lineNo,
_ps
.LinePos);
4663
pos =
_ps
.charPos + nameLen;
4664
chars =
_ps
.chars;
4666
if (pos ==
_ps
.charsUsed)
4701
else if (pos ==
_ps
.charsUsed && !
_ps
.isEof)
4715
else if (pos ==
_ps
.charsUsed)
4741
_ps
.charPos = pos + 1;
4760
args[3] = new string(
_ps
.chars,
_ps
.charPos, endPos -
_ps
.charPos);
4773
int pos =
_ps
.charPos;
4774
char[] chars =
_ps
.chars;
4801
else if (pos + 1 !=
_ps
.charsUsed)
4808
_ps
.charPos = pos;
4838
_ps
.charPos = pos + 1;
4846
if (pos + 1 ==
_ps
.charsUsed)
4852
_ps
.charPos = pos + 2;
4863
else if (pos ==
_ps
.charsUsed)
4869
Throw(pos, ResXml.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars,
_ps
.charsUsed, pos));
4873
if (pos ==
_ps
.charPos)
4877
_ps
.charPos = pos;
4880
int attrNameLinePos =
_ps
.LinePos;
4883
int attrNameLineNo =
_ps
.LineNo;
4953
chars =
_ps
.chars;
4956
else if (pos + 1 >=
_ps
.charsUsed)
4959
chars =
_ps
.chars;
4963
attr.SetLineInfo(
_ps
.LineNo, attrNameLinePos);
4966
Debug.Assert(attrNameLineNo ==
_ps
.LineNo);
4972
_ps
.charPos = pos;
4974
pos =
_ps
.charPos;
4985
_ps
.charPos = pos;
4987
pos =
_ps
.charPos;
4995
_ps
.charPos = pos;
4998
attr.SetLineInfo2(
_ps
.LineNo,
_ps
.LinePos);
5014
string val = new string(chars,
_ps
.charPos, pos -
_ps
.charPos);
5018
attr.SetValue(chars,
_ps
.charPos, pos -
_ps
.charPos);
5020
_ps
.charPos = pos;
5025
pos =
_ps
.charPos;
5026
chars =
_ps
.chars;
5054
_ps
.lineNo -= lineNoDelta;
5057
pos =
_ps
.charPos;
5058
chars =
_ps
.chars;
5221
char[] chars =
_ps
.chars;
5222
int attributeBaseEntityId =
_ps
.entityId;
5224
LineInfo valueChunkLineInfo = new LineInfo(
_ps
.lineNo,
_ps
.LinePos);
5240
if (pos -
_ps
.charPos > 0)
5242
_stringBuilder.Append(chars,
_ps
.charPos, pos -
_ps
.charPos);
5243
_ps
.charPos = pos;
5246
if (chars[pos] == quoteChar && attributeBaseEntityId ==
_ps
.entityId)
5261
_ps
.charPos++;
5270
_stringBuilder.Append(
_ps
.eolNormalized ? "\u0020\u0020" : "\u0020"); // CDATA normalization of 0xD 0xA
5271
_ps
.charPos = pos;
5274
else if (pos + 1 <
_ps
.charsUsed ||
_ps
.isEof)
5280
_ps
.charPos = pos;
5295
_ps
.charPos++;
5309
if (pos -
_ps
.charPos > 0)
5311
_stringBuilder.Append(chars,
_ps
.charPos, pos -
_ps
.charPos);
5313
_ps
.charPos = pos;
5315
int enclosingEntityId =
_ps
.entityId;
5316
LineInfo entityLineInfo = new LineInfo(
_ps
.lineNo,
_ps
.LinePos + 1);
5324
if (_parsingMode == ParsingMode.Full &&
_ps
.entityId == attributeBaseEntityId)
5338
_ps
.charPos++;
5355
valueChunkLineInfo.Set(
_ps
.LineNo,
_ps
.LinePos);
5361
_ps
.charPos++;
5364
pos =
_ps
.charPos;
5385
entityChunk.SetNamedNode(XmlNodeType.EntityReference,
_ps
.entity.Name);
5393
pos =
_ps
.charPos;
5396
pos =
_ps
.charPos;
5399
chars =
_ps
.chars;
5403
if (pos ==
_ps
.charsUsed)
5413
if (pos + 1 ==
_ps
.charsUsed)
5424
ThrowInvalidChar(chars,
_ps
.charsUsed, pos);
5434
if (
_ps
.charsUsed -
_ps
.charPos > 0)
5436
if (
_ps
.chars[
_ps
.charPos] != (char)0xD)
5441
Debug.Assert(
_ps
.isEof);
5449
if (attributeBaseEntityId !=
_ps
.entityId)
5463
if (attributeBaseEntityId ==
_ps
.entityId)
5466
valueChunkLineInfo.Set(
_ps
.LineNo,
_ps
.LinePos);
5471
pos =
_ps
.charPos;
5472
chars =
_ps
.chars;
5489
_ps
.charPos = pos + 1;
5527
_curNode.SetLineInfo(
_ps
.LineNo,
_ps
.LinePos);
5543
_curNode.SetValueNode(nodeType,
_ps
.chars, startPos, endPos - startPos);
5556
_stringBuilder.Append(
_ps
.chars, startPos, endPos - startPos);
5562
_stringBuilder.Append(
_ps
.chars, startPos, endPos - startPos);
5587
_curNode.SetValueNode(XmlNodeType.Text,
_ps
.chars, startPos, endPos - startPos);
5596
_stringBuilder.Append(
_ps
.chars, startPos, endPos - startPos);
5603
_stringBuilder.Append(
_ps
.chars, startPos, endPos - startPos);
5660
char[] chars =
_ps
.chars;
5661
int pos =
_ps
.charPos;
5692
if (!
_ps
.eolNormalized && _parsingMode == ParsingMode.Full)
5694
if (pos -
_ps
.charPos > 0)
5710
_ps
.charPos++;
5715
else if (pos + 1 <
_ps
.charsUsed ||
_ps
.isEof)
5717
if (!
_ps
.eolNormalized)
5755
if (pos >
_ps
.charPos)
5776
if (!_xmlCharType.IsWhiteSpace(
_ps
.chars[pos - 1]))
5782
pos =
_ps
.charPos;
5785
chars =
_ps
.chars;
5789
if (
_ps
.charsUsed - pos < 3 && !
_ps
.isEof)
5802
if (pos ==
_ps
.charsUsed)
5812
if (pos + 1 ==
_ps
.charsUsed)
5824
int offset = pos -
_ps
.charPos;
5827
chars =
_ps
.chars;
5828
pos =
_ps
.charPos + offset;
5833
ThrowInvalidChar(
_ps
.chars,
_ps
.charsUsed,
_ps
.charPos + offset);
5840
if (pos >
_ps
.charPos)
5847
if (
_ps
.charsUsed -
_ps
.charPos > 0)
5849
if (
_ps
.chars[
_ps
.charPos] != (char)0xD &&
_ps
.chars[
_ps
.charPos] != ']')
5853
Debug.Assert(
_ps
.isEof);
5872
pos =
_ps
.charPos;
5873
chars =
_ps
.chars;
5885
startPos =
_ps
.charPos;
5887
_ps
.charPos = pos;
5906
_stringBuilder.Append(
_ps
.chars, startPos, endPos - startPos);
5908
_stringBuilder.Append(
_ps
.chars, startPos, endPos - startPos);
6033
if (
_ps
.chars[
_ps
.charPos] == '<' ||
_ps
.charsUsed -
_ps
.charPos == 0 || ZeroEndingStream(
_ps
.charPos))
6040
_curNode.SetLineInfo(
_ps
.LineNo,
_ps
.LinePos);
6042
if (
_ps
.chars[
_ps
.charPos] == '<' ||
_ps
.charsUsed -
_ps
.charPos == 0 || ZeroEndingStream(
_ps
.charPos))
6054
if (_xmlCharType.IsCharData(
_ps
.chars[
_ps
.charPos]))
6060
ThrowInvalidChar(
_ps
.chars,
_ps
.charsUsed,
_ps
.charPos);
6067
Debug.Assert(
_ps
.chars[
_ps
.charPos] == '&');
6068
_ps
.charPos++;
6070
_curNode.SetLineInfo(
_ps
.LineNo,
_ps
.LinePos);
6076
Debug.Assert(
_ps
.chars[
_ps
.charPos] == '&');
6078
if (
_ps
.charPos + 1 ==
_ps
.charsUsed)
6087
if (
_ps
.chars[
_ps
.charPos + 1] == '#')
6115
_ps
.charPos++;
6116
int savedLinePos =
_ps
.LinePos;
6123
Throw(ResXml.Xml_ErrorParsingEntityName,
_ps
.LineNo, savedLinePos);
6128
if (
_ps
.chars[endPos] != ';')
6133
int entityLinePos =
_ps
.LinePos;
6134
string entityName = _nameTable.Add(
_ps
.chars,
_ps
.charPos, endPos -
_ps
.charPos);
6135
_ps
.charPos = endPos + 1;
6139
_reportedBaseUri =
_ps
.baseUriStr;
6140
_reportedEncoding =
_ps
.encoding;
6166
Throw(ResXml.Xml_UndeclaredEntity, name,
_ps
.LineNo, entityStartLinePos);
6178
Throw(ResXml.Xml_UnparsedEntityRef, name,
_ps
.LineNo, entityStartLinePos);
6183
Throw(ResXml.Xml_ExternalEntityInStandAloneDocument, entity.Name,
_ps
.LineNo, entityStartLinePos);
6190
Throw(ResXml.Xml_ExternalEntityInAttValue, name,
_ps
.LineNo, entityStartLinePos);
6204
_curNode.entityId =
_ps
.entityId;
6212
_curNode.entityId =
_ps
.entityId;
6225
_curNode.entityId =
_ps
.entityId;
6247
if (
_ps
.entityResolvedManually)
6253
if (
_ps
.entityId != _nodes[_index].entityId)
6259
_lastEntity =
_ps
.entity; // save last entity for the EndEntity node
6268
if (
_ps
.entityId != _nodes[_index].entityId)
6276
_reportedEncoding =
_ps
.encoding;
6277
_reportedBaseUri =
_ps
.baseUriStr;
6286
_reportedEncoding =
_ps
.encoding;
6287
_reportedBaseUri =
_ps
.baseUriStr;
6292
_curNode.lineInfo.Set(
_ps
.lineNo,
_ps
.LinePos - 1);
6320
_curNode.SetLineInfo(
_ps
.LineNo,
_ps
.LinePos);
6327
string target = _nameTable.Add(
_ps
.chars,
_ps
.charPos, nameEndPos -
_ps
.charPos);
6333
_ps
.charPos = nameEndPos;
6348
char ch =
_ps
.chars[
_ps
.charPos];
6349
Debug.Assert(
_ps
.charPos <
_ps
.charsUsed);
6352
if (
_ps
.charsUsed -
_ps
.charPos < 2)
6356
if (ch != '?' ||
_ps
.chars[
_ps
.charPos + 1] != '>')
6358
Throw(ResXml.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(
_ps
.chars,
_ps
.charsUsed,
_ps
.charPos));
6374
_curNode.SetValue(
_ps
.chars, startPos, endPos - startPos);
6379
piInDtdStringBuilder.Append(
_ps
.chars, startPos, endPos - startPos);
6402
sb.Append(
_ps
.chars, startPos, endPos - startPos);
6404
sb.Append(
_ps
.chars, startPos, endPos - startPos);
6418
if (
_ps
.charsUsed -
_ps
.charPos < 2)
6422
Throw(
_ps
.charsUsed, ResXml.Xml_UnexpectedEOF, "PI");
6426
int pos =
_ps
.charPos;
6427
char[] chars =
_ps
.chars;
6451
Debug.Assert(!
_ps
.eolNormalized);
6459
outStartPos =
_ps
.charPos;
6460
_ps
.charPos = pos + 2;
6463
else if (pos + 1 ==
_ps
.charsUsed)
6480
if (!
_ps
.eolNormalized && _parsingMode == ParsingMode.Full)
6483
if (pos -
_ps
.charPos > 0)
6499
_ps
.charPos++;
6504
else if (pos + 1 <
_ps
.charsUsed ||
_ps
.isEof)
6506
if (!
_ps
.eolNormalized)
6526
if (pos ==
_ps
.charsUsed)
6536
if (pos + 1 ==
_ps
.charsUsed)
6547
ThrowInvalidChar(chars,
_ps
.charsUsed, pos);
6563
outStartPos =
_ps
.charPos;
6564
_ps
.charPos = pos;
6597
_curNode.SetLineInfo(
_ps
.LineNo,
_ps
.LinePos);
6601
_curNode.SetValueNode(type,
_ps
.chars, startPos, endPos - startPos);
6607
_stringBuilder.Append(
_ps
.chars, startPos, endPos - startPos);
6609
_stringBuilder.Append(
_ps
.chars, startPos, endPos - startPos);
6623
if (
_ps
.charsUsed -
_ps
.charPos < 3)
6632
int pos =
_ps
.charPos;
6633
char[] chars =
_ps
.chars;
6659
Debug.Assert(!
_ps
.eolNormalized);
6667
outStartPos =
_ps
.charPos;
6668
_ps
.charPos = pos + 3;
6671
else if (pos + 2 ==
_ps
.charsUsed)
6680
else if (pos + 1 ==
_ps
.charsUsed)
6700
if (!
_ps
.eolNormalized && _parsingMode == ParsingMode.Full)
6702
if (pos -
_ps
.charPos > 0)
6718
_ps
.charPos++;
6723
else if (pos + 1 <
_ps
.charsUsed ||
_ps
.isEof)
6725
if (!
_ps
.eolNormalized)
6745
if (pos ==
_ps
.charsUsed)
6753
if (pos + 1 ==
_ps
.charsUsed)
6764
ThrowInvalidChar(chars,
_ps
.charsUsed, pos);
6779
outStartPos =
_ps
.charPos;
6781
_ps
.charPos = pos;
6795
while (
_ps
.charsUsed -
_ps
.charPos < 8)
6802
if (!XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos, 7, "DOCTYPE"))
6806
if (!_xmlCharType.IsWhiteSpace(
_ps
.chars[
_ps
.charPos + 7]))
6808
ThrowExpectingWhitespace(
_ps
.charPos + 7);
6813
Throw(
_ps
.charPos - 2, ResXml.Xml_MultipleDTDsProvided); // position just before <!DOCTYPE
6817
Throw(
_ps
.charPos - 2, ResXml.Xml_DtdAfterRootElement);
6820
_ps
.charPos += 8;
6827
_curNode.SetLineInfo(
_ps
.LineNo,
_ps
.LinePos);
6866
_ps
.charPos = pos;
6872
if (
_ps
.chars[
_ps
.charPos] == 'P')
6875
while (
_ps
.charsUsed -
_ps
.charPos < 6)
6883
if (!XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos, 6, "PUBLIC"))
6887
_ps
.charPos += 6;
6892
ThrowExpectingWhitespace(
_ps
.charPos);
6901
ThrowExpectingWhitespace(
_ps
.charPos);
6909
else if (
_ps
.chars[
_ps
.charPos] == 'S')
6912
while (
_ps
.charsUsed -
_ps
.charPos < 6)
6920
if (!XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos, 6, "SYSTEM"))
6924
_ps
.charPos += 6;
6929
ThrowExpectingWhitespace(
_ps
.charPos);
6937
else if (
_ps
.chars[
_ps
.charPos] != '[' &&
_ps
.chars[
_ps
.charPos] != '>')
6943
if (
_ps
.chars[
_ps
.charPos] == '[')
6945
_ps
.charPos++;
6950
if (
_ps
.chars[
_ps
.charPos] != '>')
6955
else if (
_ps
.chars[
_ps
.charPos] == '>')
6963
_ps
.charPos++;
6969
char quoteChar =
_ps
.chars[
_ps
.charPos];
6975
_ps
.charPos++;
6986
char[] chars =
_ps
.chars;
6987
int pos =
_ps
.charPos;
7004
_ps
.charPos = pos + 1;
7009
_ps
.charPos = pos;
7022
else if (pos + 1 <
_ps
.charsUsed ||
_ps
.isEof)
7048
if (pos + 3 >=
_ps
.charsUsed && !
_ps
.isEof)
7063
else if (pos + 1 >=
_ps
.charsUsed && !
_ps
.isEof)
7073
if (pos + 2 >=
_ps
.charsUsed && !
_ps
.isEof)
7091
if (pos + 1 >=
_ps
.charsUsed && !
_ps
.isEof)
7132
if (pos ==
_ps
.charsUsed)
7142
if (pos + 1 ==
_ps
.charsUsed)
7153
ThrowInvalidChar(chars,
_ps
.charsUsed, pos);
7162
if (
_ps
.charsUsed -
_ps
.charPos > 0)
7164
if (
_ps
.chars[
_ps
.charPos] != (char)0xD)
7169
Debug.Assert(
_ps
.isEof);
7176
chars =
_ps
.chars;
7177
pos =
_ps
.charPos;
7183
int pos =
_ps
.charPos;
7185
char[] chars =
_ps
.chars;
7200
int tmp1 = pos -
_ps
.charPos;
7201
if (sb != null && !
_ps
.eolNormalized)
7205
sb.Append(chars,
_ps
.charPos, tmp1);
7208
_ps
.charPos = pos + 1;
7212
else if (pos + 1 <
_ps
.charsUsed ||
_ps
.isEof)
7214
if (!
_ps
.eolNormalized)
7231
if (pos ==
_ps
.charsUsed)
7237
int tmp2 = pos -
_ps
.charPos;
7242
sb.Append(
_ps
.chars,
_ps
.charPos, tmp2);
7244
_ps
.charPos = pos;
7253
int tmp3 = pos -
_ps
.charPos;
7258
sb.Append(
_ps
.chars,
_ps
.charPos, tmp3);
7260
_ps
.charPos = pos;
7266
if (
_ps
.charsUsed -
_ps
.charPos == 0)
7270
if (
_ps
.chars[
_ps
.charPos] != (char)0xD)
7275
Debug.Assert(
_ps
.isEof);
7277
pos =
_ps
.charPos;
7278
chars =
_ps
.chars;
7284
Debug.Assert(
_ps
.chars[startPos] == '&');
7285
if (
_ps
.chars[startPos + 1] == '#')
7308
switch (newPos = ParseNumericCharRefInline(
_ps
.charPos, expand, internalSubsetBuilder, out charCount, out entityType))
7316
Debug.Assert(
_ps
.chars[
_ps
.charPos] == '&');
7321
_ps
.charPos = newPos - charCount;
7336
Debug.Assert(
_ps
.chars[startPos] == '&' &&
_ps
.chars[startPos + 1] == '#');
7344
chars =
_ps
.chars;
7371
else if (pos <
_ps
.charsUsed)
7391
_ps
.charPos = pos;
7398
if (pos ==
_ps
.charsUsed)
7416
Throw((
_ps
.chars[startPos + 2] == 'x') ? startPos + 3 : startPos + 2, ResXml.Xml_InvalidCharacter, XmlException.BuildCharExceptionArgs(ch, '\0'));
7423
internalSubsetBuilder.Append(
_ps
.chars,
_ps
.charPos, pos -
_ps
.charPos + 1);
7445
Throw((
_ps
.chars[startPos + 2] == 'x') ? startPos + 3 : startPos + 2, ResXml.Xml_InvalidCharacter, XmlException.BuildCharExceptionArgs(high, low));
7454
internalSubsetBuilder.Append(
_ps
.chars,
_ps
.charPos, pos -
_ps
.charPos + 1);
7475
switch (newPos = ParseNamedCharRefInline(
_ps
.charPos, expand, internalSubsetBuilder))
7485
Debug.Assert(
_ps
.chars[
_ps
.charPos] == '&');
7490
_ps
.charPos = newPos - 1;
7505
Debug.Assert(startPos <
_ps
.charsUsed);
7506
Debug.Assert(
_ps
.chars[startPos] == '&');
7507
Debug.Assert(
_ps
.chars[startPos + 1] != '#');
7510
char[] chars =
_ps
.chars;
7521
if (
_ps
.charsUsed - pos >= 3)
7538
if (
_ps
.charsUsed - pos >= 4)
7553
else if (pos <
_ps
.charsUsed)
7560
if (
_ps
.charsUsed - pos >= 5)
7577
if (
_ps
.charsUsed - pos >= 3)
7593
if (
_ps
.charsUsed - pos >= 3)
7620
internalSubsetBuilder.Append(
_ps
.chars,
_ps
.charPos, pos -
_ps
.charPos);
7622
_ps
.chars[pos - 1] = ch;
7641
int pos =
_ps
.charPos + startOffset;
7644
char[] chars =
_ps
.chars;
7660
if (pos + 1 >=
_ps
.charsUsed)
7670
Throw(pos, ResXml.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars,
_ps
.charsUsed, pos));
7706
colonOffset = pos -
_ps
.charPos;
7712
colonOffset = pos -
_ps
.charPos;
7718
else if (pos ==
_ps
.charsUsed
7726
chars =
_ps
.chars;
7733
colonPos = (colonOffset == -1) ? -1 :
_ps
.charPos + colonOffset;
7739
int offset = pos -
_ps
.charPos;
7741
pos =
_ps
.charPos + offset;
7759
if (
_ps
.chars[endPos] != ';')
7764
string entityName = _nameTable.Add(
_ps
.chars,
_ps
.charPos, endPos -
_ps
.charPos);
7765
_ps
.charPos = endPos + 1;
7817
string localName = _nameTable.Add(
_ps
.chars,
_ps
.charPos, endNamePos -
_ps
.charPos);
7823
int startPos =
_ps
.charPos;
7825
if (prefixLen == _lastPrefix.Length && XmlConvert.StrEqual(
_ps
.chars, startPos, prefixLen, _lastPrefix))
7827
return AddAttribute(_nameTable.Add(
_ps
.chars, colonPos + 1, endNamePos - colonPos - 1),
7833
string prefix = _nameTable.Add(
_ps
.chars, startPos, prefixLen);
7835
return AddAttribute(_nameTable.Add(
_ps
.chars, colonPos + 1, endNamePos - colonPos - 1),
7893
_ps
.lineNo++;
7894
_ps
.lineStartPos = pos - 1;
7899
Debug.Assert(
_ps
.isEof);
7902
_curNode.SetLineInfo(
_ps
.LineNo,
_ps
.LinePos);
8144
Debug.Assert(
_ps
.appendMode);
8145
int initialPos =
_ps
.charPos;
8152
_ps
.charPos = initialPos;
8158
Encoding enc =
_ps
.encoding;
8175
Encoding enc =
_ps
.encoding;
8183
_ps
.lineNo = entity.LineNumber;
8184
_ps
.lineStartPos = -entity.LinePosition - 1;
8186
_ps
.eolNormalized = true;
8193
if (
_ps
.stream != null)
8195
_ps
.stream.Close();
8199
_curNode.entityId =
_ps
.entityId;
8215
_ps
.entity = entity;
8216
_ps
.entityId = _nextEntityId++;
8232
if (
_ps
.entity != null)
8234
_currentEntities.Remove(
_ps
.entity);
8252
_parsingStatesStack[_parsingStatesStackTop] =
_ps
;
8254
_ps
.Clear();
8260
_ps
.Close(true);
8272
_incReadLeftStartPos =
_ps
.charPos;
8273
_incReadLeftEndPos =
_ps
.charPos;
8274
_incReadLineInfo.Set(
_ps
.LineNo,
_ps
.LinePos);
8321
count = _incReadDecoder.Decode(
_ps
.chars, _incReadLeftStartPos, charsLeft);
8360
Debug.Assert(XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos - 2, 2, "?>"));
8361
_ps
.charPos -= 2;
8368
Debug.Assert(XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos - 3, 3, "-->"));
8369
_ps
.charPos -= 3;
8376
Debug.Assert(XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos - 3, 3, "]]>"));
8377
_ps
.charPos -= 3;
8396
startPos =
_ps
.charPos;
8407
char[] chars =
_ps
.chars;
8408
startPos =
_ps
.charPos;
8413
_incReadLineInfo.Set(
_ps
.LineNo,
_ps
.LinePos);
8457
else if (pos + 1 <
_ps
.charsUsed)
8474
if (
_ps
.charsUsed - pos < 2)
8487
if (
_ps
.charsUsed - pos < 4)
8497
if (
_ps
.charsUsed - pos < 9)
8515
Debug.Assert(
_ps
.charPos - pos == 0);
8516
Debug.Assert(
_ps
.charPos - startPos == 0);
8521
if (XmlConvert.StrEqual(chars,
_ps
.charPos + 2, endPos -
_ps
.charPos - 2, _curNode.GetNameWPrefix(_nameTable)) &&
8522
(
_ps
.chars[endPos] == '>' || _xmlCharType.IsWhiteSpace(
_ps
.chars[endPos])))
8530
_ps
.charPos = endPos;
8531
if (_xmlCharType.IsWhiteSpace(
_ps
.chars[endPos]))
8535
if (
_ps
.chars[
_ps
.charPos] != '>')
8539
_ps
.charPos++;
8547
startPos =
_ps
.charPos;
8548
chars =
_ps
.chars;
8555
Debug.Assert(
_ps
.charPos - pos == 0);
8556
Debug.Assert(
_ps
.charPos - startPos == 0);
8561
if (XmlConvert.StrEqual(
_ps
.chars,
_ps
.charPos + 1, endPos -
_ps
.charPos - 1, _curNode.localName) &&
8562
(
_ps
.chars[endPos] == '>' ||
_ps
.chars[endPos] == '/' || _xmlCharType.IsWhiteSpace(
_ps
.chars[endPos])))
8570
startPos =
_ps
.charPos;
8571
chars =
_ps
.chars;
8580
if (
_ps
.charsUsed - pos < 2)
8619
if (pos ==
_ps
.charsUsed)
8636
_ps
.charPos = pos;
8646
count = _incReadDecoder.Decode(
_ps
.chars, startPos, charsParsed);
8683
ParseAttributeValueSlow(
_ps
.charPos, ' ', _curNode); // The quote char is intentionally empty (space) because we need to parse ' and " into the attribute value
8707
char[] chars =
_ps
.chars;
8708
int pos =
_ps
.charPos;
8711
_curNode.SetLineInfo(
_ps
.LineNo,
_ps
.LinePos);
8734
Debug.Assert(
_ps
.eolNormalized, "Entity replacement text for attribute values should be EOL-normalized!");
8757
if (pos -
_ps
.charPos > 0)
8759
_stringBuilder.Append(chars,
_ps
.charPos, pos -
_ps
.charPos);
8761
_ps
.charPos = pos;
8769
chars =
_ps
.chars;
8770
if (_normalize && _xmlCharType.IsWhiteSpace(chars[
_ps
.charPos]) && pos -
_ps
.charPos == 1)
8772
chars[
_ps
.charPos] = (char)0x20; // CDATA normalization of character references in entities
8779
_ps
.charPos++;
8791
chars =
_ps
.chars;
8795
if (pos ==
_ps
.charsUsed)
8805
if (pos + 1 ==
_ps
.charsUsed)
8816
ThrowInvalidChar(chars,
_ps
.charsUsed, pos);
8822
if (pos -
_ps
.charPos > 0)
8824
_stringBuilder.Append(chars,
_ps
.charPos, pos -
_ps
.charPos);
8825
_ps
.charPos = pos;
8848
pos =
_ps
.charPos;
8849
chars =
_ps
.chars;
8853
if (pos -
_ps
.charPos > 0)
8855
_stringBuilder.Append(chars,
_ps
.charPos, pos -
_ps
.charPos);
8856
_ps
.charPos = pos;
8887
_ps
.charPos = pos;
8910
_ps
.charPos = pos;
8916
if (
_ps
.charPos ==
_ps
.charsUsed)
8920
if (_xmlCharType.IsNCNameSingleChar(
_ps
.chars[
_ps
.charPos]))
8922
int pos =
_ps
.charPos + 1;
8923
while (_xmlCharType.IsNCNameSingleChar(
_ps
.chars[pos]))
8927
return new string(
_ps
.chars,
_ps
.charPos, pos -
_ps
.charPos);
8931
Debug.Assert(
_ps
.charPos <
_ps
.charsUsed);
8932
return new string(
_ps
.chars,
_ps
.charPos, 1);
8990
if (_v1Compat && pos ==
_ps
.charsUsed - 1 &&
_ps
.chars[pos] == (char)0 && ReadData() == 0 &&
_ps
.isStreamEof)
8992
_ps
.charsUsed--;
9498
_curNode.AdjustLineInfo(_readValueOffset,
_ps
.eolNormalized, ref _incReadLineInfo);
9522
_incReadLineInfo.Set(
_ps
.LineNo,
_ps
.LinePos);
9527
charsRead = _incReadDecoder.Decode(
_ps
.chars, startPos, endPos - startPos);
9541
_curNode.SetValue(
_ps
.chars, startPos, endPos - startPos);
9543
AdjustLineInfo(
_ps
.chars, startPos - charsRead, startPos,
_ps
.eolNormalized, ref _incReadLineInfo);