Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ HandleEntityReference()

EntityType System.Xml.XmlTextReaderImpl.HandleEntityReference ( bool isInAttributeValue,
EntityExpandType expandType,
out int charRefEndPos )
inlineprivate

Definition at line 5594 of file XmlTextReaderImpl.cs.

5595 {
5596 if (_ps.charPos + 1 == _ps.charsUsed && ReadData() == 0)
5597 {
5599 }
5600 if (_ps.chars[_ps.charPos + 1] == '#')
5601 {
5603 return entityType;
5604 }
5606 if (charRefEndPos >= 0)
5607 {
5608 return EntityType.CharacterNamed;
5609 }
5610 if (expandType == EntityExpandType.OnlyCharacter || (_entityHandling != EntityHandling.ExpandEntities && (!isInAttributeValue || !_validatingReaderCompatFlag)))
5611 {
5612 return EntityType.Unexpanded;
5613 }
5614 _ps.charPos++;
5615 int linePos = _ps.LinePos;
5616 int num;
5617 try
5618 {
5619 num = ParseName();
5620 }
5621 catch (XmlException)
5622 {
5624 return EntityType.Skipped;
5625 }
5626 if (_ps.chars[num] != ';')
5627 {
5628 ThrowUnexpectedToken(num, ";");
5629 }
5630 int linePos2 = _ps.LinePos;
5631 string name = _nameTable.Add(_ps.chars, _ps.charPos, num - _ps.charPos);
5632 _ps.charPos = num + 1;
5633 charRefEndPos = -1;
5637 return result;
5638 }
static string Xml_UnexpectedEOF1
Definition SR.cs:38
static string Xml_ErrorParsingEntityName
Definition SR.cs:136
Definition SR.cs:7
string Add(char[] array, int offset, int length)
int ParseNumericCharRef(bool expand, StringBuilder internalSubsetBuilder, out EntityType entityType)
void Throw(int pos, string res, string arg)
EntityType HandleGeneralEntityReference(string name, bool isInAttributeValue, bool pushFakeEntityIfNullResolver, int entityStartLinePos)
void ThrowUnexpectedToken(int pos, string expectedToken)
int ParseNamedCharRef(bool expand, StringBuilder internalSubsetBuilder)

References System.Xml.XmlTextReaderImpl._entityHandling, System.Xml.XmlTextReaderImpl._nameTable, System.Xml.XmlTextReaderImpl._ps, System.Xml.XmlTextReaderImpl._reportedBaseUri, System.Xml.XmlTextReaderImpl._reportedEncoding, System.Xml.XmlTextReaderImpl._validatingReaderCompatFlag, System.Xml.XmlNameTable.Add(), System.Xml.XmlTextReaderImpl.ParsingState.baseUriStr, System.Xml.XmlTextReaderImpl.ParsingState.charPos, System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.ParsingState.charsUsed, System.Xml.Dictionary, System.Xml.XmlTextReaderImpl.ParsingState.encoding, System.Xml.XmlTextReaderImpl.HandleGeneralEntityReference(), System.Xml.XmlTextReaderImpl.ParsingState.LineNo, System.Xml.XmlTextReaderImpl.ParsingState.LinePos, System.Xml.XmlTextReaderImpl.ParseName(), System.Xml.XmlTextReaderImpl.ParseNamedCharRef(), System.Xml.XmlTextReaderImpl.ParseNumericCharRef(), System.Xml.XmlTextReaderImpl.ReadData(), System.Xml.XmlTextReaderImpl.Throw(), System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(), System.SR.Xml_ErrorParsingEntityName, and System.SR.Xml_UnexpectedEOF1.

Referenced by System.Xml.XmlTextReaderImpl.ParseAttributeValueChunk(), System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(), System.Xml.XmlTextReaderImpl.ParseDocumentContent(), and System.Xml.XmlTextReaderImpl.ParseText().