@create $generic_utils named XML Utilities:XML Utilities ;;$xml_utils.("aliases") = {"XML Utilities"} ;;$xml_utils.("description") = "This is a placeholder parent for all the $..._utils packages, to more easily find them and manipulate them. At present this object defines no useful verbs or properties. (Filfre.)" ;;$xml_utils.("object_size") = {1044, 1013718845} @verb $xml_utils:"XML_to_list" this none this @program $xml_utils:XML_to_list txt = args[1]; start = 1; retval = {}; elelist = $string_utils:index_all(txt, ">"); for x in (elelist) line = txt[start..x]; endln = length(line); if ((line[1] == "<") && (line[endln] == ">")) line = line[2..endln - 1]; lnval = {}; for y in ($string_utils:words(line)) {?att = "", ?val = ""} = $string_utils:to_list(y, "="); if (((length(val) > 0) && (val[1] == "'")) && (val[$] == "'")) val = val[2..length(val) - 1]; endif lnval = {@lnval, {att, val}}; endfor retval = {@retval, lnval}; else if (br = index(line, "<")) bre = length(line) - 1; ln2 = line[br + 1..bre]; line = line[1..br - 1]; retval = {@retval, {{line, ""}}, {{ln2, ""}}}; else retval = {@retval, line}; endif endif start = x + 1; endfor return retval; .