getElementObject function
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;
}