getElementObject function

List<Element>? getElementObject(
  1. Data data
)

Extracts Element from Data object

Implementation

List<Element>? getElementObject(Data data) {
  Object? obj = data.obj;
  if (obj is Document) {
    return [obj.documentElement!];
  } else if (obj is Element) {
    return [obj];
  } else if (obj is List<Element>) {
    return obj;
  } else if (obj is String) {
    return [parse(obj).documentElement!];
  }
  return null;
}