loadExternalDtd method

Future<XmlDoctype?> loadExternalDtd()

Attempts to load the external DTD file from externalDtdUri and parse the DTD elements contained within. A new XmlDoctype will be returned with the parsed DTD elements in the externalDtd value.

If the URI couldn't be reached or no DTD elements could be identified, Returns null.

Implementation

Future<XmlDoctype?> loadExternalDtd() async {
  if (externalDtdUri == null) return null;
  final externalEntities = await XmlNode.fromUri(externalDtdUri!);
  if (externalEntities == null) return null;
  return copyWith(externalDtd: externalEntities);
}