(lists-to-xml list?) -> string? |
convert lists to xml, the list should obey below rules.
1. First node of list should be a string? or symbol? It represent node name.
2. All the pairs represent node’s attributes.
'("H1" ("attr1" . "1") ("attr2" . "2")) -> <H1 "attr1"="1" "attr2"="2"/> |
3. If have children, string/symbol represent its value, or, the lists represents its children.
Node’s children should either string? or symbol? or lists?, only one of these three types.
'("H1" "haha") -> <H1>haha</H1> |
|
'("H1" ("H2" "haha")) -> |
|
<H1> |
<H2> |
haha |
</H2> |
</H1> |
(lists-to-compact_xml list?) -> string? |
remove all the format characters.
'("H1" ("H2" "haha")) -> <H1><H2>haha</H2></H1> |