Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wrap: func [ n /end ] [ rejoin [ "<" either end ["/"][""] n ">" ] ]
- block-to-xml: func [data] [
- accumulate [ n x ] a copy "" data [
- rejoin [ a wrap n either block? x [ block-to-xml x ] [ x ] wrap/end n ] ] ]
- ; usage
- >> block-to-xml [ 'inv [ title "10-0001" date "10-10-2010" client [ name "R ltd" city "NY" ] ] ]
- == {<inv><title>10-0001</title><date>10-10-2010</date><client><name>R ltd</name><city>NY</city></client></inv>}
Add Comment
Please, Sign In to add comment