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

◆ PushExternalEntityOrSubsetAsync()

async Task System.Xml.XmlTextReaderImpl.PushExternalEntityOrSubsetAsync ( string publicId,
string systemId,
Uri baseUri,
string entityName )
inlineprivate

Definition at line 12684 of file XmlTextReaderImpl.cs.

12685 {
12686 Uri uri;
12687 if (!string.IsNullOrEmpty(publicId))
12688 {
12689 try
12690 {
12691 uri = _xmlResolver.ResolveUri(baseUri, publicId);
12692 if (await OpenAndPushAsync(uri).ConfigureAwait(continueOnCapturedContext: false))
12693 {
12694 return;
12695 }
12696 }
12697 catch (Exception)
12698 {
12699 }
12700 }
12701 uri = _xmlResolver.ResolveUri(baseUri, systemId);
12702 try
12703 {
12704 if (await OpenAndPushAsync(uri).ConfigureAwait(continueOnCapturedContext: false))
12705 {
12706 return;
12707 }
12708 }
12709 catch (Exception ex2)
12710 {
12711 if (_v1Compat)
12712 {
12713 throw;
12714 }
12715 string message = ex2.Message;
12716 Throw(new XmlException((entityName == null) ? System.SR.Xml_ErrorOpeningExternalDtd : System.SR.Xml_ErrorOpeningExternalEntity, new string[2]
12717 {
12718 uri.ToString(),
12719 message
12720 }, ex2, 0, 0));
12721 }
12722 if (entityName == null)
12723 {
12725 {
12726 (publicId != null) ? publicId : string.Empty,
12727 systemId
12728 }, null);
12729 }
12730 else
12731 {
12732 Throw((_dtdProcessing == DtdProcessing.Ignore) ? System.SR.Xml_CannotResolveEntityDtdIgnored : System.SR.Xml_CannotResolveEntity, entityName);
12733 }
12734 }
static string Xml_ErrorOpeningExternalDtd
Definition SR.cs:168
static string Xml_CannotResolveExternalSubset
Definition SR.cs:146
static string Xml_CannotResolveEntityDtdIgnored
Definition SR.cs:144
Definition SR.cs:7
virtual Uri ResolveUri(Uri? baseUri, string? relativeUri)
async Task< bool > OpenAndPushAsync(Uri uri)
void Throw(int pos, string res, string arg)

References System.Xml.XmlTextReaderImpl._dtdProcessing, System.Xml.XmlTextReaderImpl._v1Compat, System.Xml.XmlTextReaderImpl._xmlResolver, System.Xml.Dictionary, System.Xml.XmlTextReaderImpl.OpenAndPushAsync(), System.Xml.XmlResolver.ResolveUri(), System.Xml.XmlTextReaderImpl.Throw(), System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(), System.Uri.ToString(), System.SR.Xml_CannotResolveEntity, System.SR.Xml_CannotResolveEntityDtdIgnored, System.SR.Xml_CannotResolveExternalSubset, System.SR.Xml_ErrorOpeningExternalDtd, System.SR.Xml_ErrorOpeningExternalEntity, and System.Xml.XmlException.

Referenced by System.Xml.XmlTextReaderImpl.DtdParserProxy_PushExternalSubsetAsync(), and System.Xml.XmlTextReaderImpl.PushExternalEntityAsync().