loadExternalEntities method

Future<XmlEntity?> loadExternalEntities()

Attempts to load the external entity if there is one and if ndata is null. If ndata is provided, the file is assumed to be of another data type that can't be parsed by this library.

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

Implementation

Future<XmlEntity?> loadExternalEntities() async {
  if ((!isSystem && !isPublic) || ndata != null) return null;
  final externalEntities =
      await XmlNode.fromUri(value, returnNodesOfType: [XmlEntity]);
  if (externalEntities == null) return null;
  return copyWith(externalEntities: externalEntities);
}