diff --git a/hy_base/xml.hy b/hy_base/xml.hy index c603868..34d8f80 100644 --- a/hy_base/xml.hy +++ b/hy_base/xml.hy @@ -29,13 +29,13 @@ (defn xmlchild [parent children] "Handling of children (ie non root) XML Nodes with/o text and subchildren (recursive)" - (for [c children] - (if (string? c) - (setv (. parent text) c) + (for [child children] + (if (string? child) + (setv (. parent text) child) (do - (setv attrs (dfor [k v] (.items (get c "attrs")) [(str k) (str v)])) - (setv new_parent (.SubElement ET parent (get c "tag") attrs)) - (setv subchildren (get c "children")) + (setv attrs (dfor [k v] (.items (get child "attrs")) [(str k) (str v)])) + (setv new_parent (.SubElement ET parent (get child "tag") attrs)) + (setv subchildren (get child "children")) (if subchildren (xmlchild new_parent subchildren)))))) (defn xmln [tag &optional attrs children text]