Source: site.view [edit]
Function name: cmdParseObject
Arguments: src,topElement
Description: Given an XML string, returns a list of all topElements parsed one level.
Page type: webl
Render function:  
Module: skillsrank

Page source:

   var P = NewPage(src, "text/html");
   var res = [];

   var E = Elem(P, topElement);
   every e in E do
      var o = [. .];
      every c in Children(e) do
         var n = (Name(c) ? "");
         var v = (Str_Trim(Text(c)) ? "");
         if (n != "" and v != "") then
            if (Str_EndsWith(n, "s")) then
               var res2 = [];
               every c3 in Children(c) do
                  var o2 = [. .];
                  every c2 in Children(c3) do
                     var n2 = (Name(c2) ? "");
                     var v2 = (Str_Trim(Text(c2)) ? "");
                     if (n2 != "" and v2 != "") then
                        o2[n2] := v2
                     end
                  end;
                  if (Size(ToList(o2)) > 0) then
                     res2 = res2 + [ o2 ]
                  end
               end;
               if res2 != [] then
                  o[n] := res2
               end
            else
               o[n] := v
            end
         end
      end;
      if o != [. .] then
         res = res + [ o ]
      end
   end;
   res;