parse_xml
result = parse_xml(str)
Input: str · Output: result
What it is
xmlify's inverse. str (string) is XML text in xmlify's own element-naming convention.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = parse_xml(str) | str stringnot documented yet | result — | Returns the reconstructed Value. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
t = parse_csv("name,age\nAlice,30\nBob,25\n")
print(xmlify(t))
# <table>
# <columns>
# <column kind="str">name</column>
# <column kind="num">age</column>
# </columns>
# <row>
# <name>Alice</name>
# <age>30</age>
# </row>
# <row>
# <name>Bob</name>
# <age>25</age>
# </row>
# </table>
back = parse_xml(xmlify(t))
print(back.name[0]) # Alice
j = csv2json("product,price\nWidget,9.99\n")
print(j) # [{"product":"Widget","price":9.99}]
output
<table>
<columns>
<column kind="str">name</column>
<column kind="num">age</column>
</columns>
<row>
<name>Alice</name>
<age>30</age>
</row>
<row>
<name>Bob</name>
<age>25</age>
</row>
</table>
... 2 more linesfrom file-io