private void InitializeFreeFloatingDtd(string baseUri, string docTypeName, string publicId, string systemId, string internalSubset, IDtdParserAdapter adapter)
{
Initialize(adapter);
if (docTypeName == null || docTypeName.Length == 0)
{
throw XmlConvert.CreateInvalidNameArgumentException(docTypeName, nameof(docTypeName));
}
// check doctype name
XmlConvert.VerifyName(docTypeName);
int colonPos = docTypeName.IndexOf(':');
if (colonPos == -1)
{
_schemaInfo.DocTypeName = new XmlQualifiedName(_nameTable.Add(docTypeName));
}
else
{
_schemaInfo.DocTypeName = new XmlQualifiedName(_nameTable.Add(docTypeName.Substring(0, colonPos)),
_nameTable.Add(docTypeName.Substring(colonPos + 1)));
}
int i;
// check system id
if (systemId != null && systemId.Length > 0)
{
if ((i = _xmlCharType.IsOnlyCharData(systemId)) >= 0)
{
ThrowInvalidChar(_curPos, systemId, i);
}
_systemId = systemId;
}
// check public id
if (publicId != null && publicId.Length > 0)
{
if ((i = _xmlCharType.IsPublicId(publicId)) >= 0)
{
ThrowInvalidChar(_curPos, publicId, i);
}
_publicId = publicId;
}
// init free-floating internal subset
if (internalSubset != null && internalSubset.Length > 0)
{
_readerAdapter.PushInternalDtd(baseUri, internalSubset);
_hasFreeFloatingInternalSubset = true;
}
Uri baseUriOb = _readerAdapter.BaseUri;
if (baseUriOb != null)
{
_documentBaseUri = baseUriOb.ToString();
}
_freeFloatingDtd = true;
}