[REF]Hy Base XML better naming for child
This commit is contained in:
parent
82155b3cc2
commit
c45d527fff
@ -29,13 +29,13 @@
|
|||||||
(defn xmlchild [parent children]
|
(defn xmlchild [parent children]
|
||||||
"Handling of children (ie non root) XML Nodes with/o text and subchildren
|
"Handling of children (ie non root) XML Nodes with/o text and subchildren
|
||||||
(recursive)"
|
(recursive)"
|
||||||
(for [c children]
|
(for [child children]
|
||||||
(if (string? c)
|
(if (string? child)
|
||||||
(setv (. parent text) c)
|
(setv (. parent text) child)
|
||||||
(do
|
(do
|
||||||
(setv attrs (dfor [k v] (.items (get c "attrs")) [(str k) (str v)]))
|
(setv attrs (dfor [k v] (.items (get child "attrs")) [(str k) (str v)]))
|
||||||
(setv new_parent (.SubElement ET parent (get c "tag") attrs))
|
(setv new_parent (.SubElement ET parent (get child "tag") attrs))
|
||||||
(setv subchildren (get c "children"))
|
(setv subchildren (get child "children"))
|
||||||
(if subchildren (xmlchild new_parent subchildren))))))
|
(if subchildren (xmlchild new_parent subchildren))))))
|
||||||
|
|
||||||
(defn xmln [tag &optional attrs children text]
|
(defn xmln [tag &optional attrs children text]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user