afterbuy v1.0.1 Afterbuy.XML.Decoder
Module to recursively traverse the output of erlsom.simple_form and produce a map. erlsom uses character lists so this library converts them to Elixir binary string.
Link to this section Summary
Functions
decode(xml) utility is inspired by Rails Hash.from_xml() but is "naive" in that it is convenient (requires no setup) but carries the same drawbacks. Use with caution. XML and Maps are non-isomorphic. Attributes on some nodes don't carry over if the node has just one text value (like a leaf). Naive map has no validation over what should be a collection. If and only if nodes are repeated at the same level will they beome a list.
Link to this section Functions
decode!(xml)
decode(xml) utility is inspired by Rails Hash.from_xml() but is "naive" in that it is convenient (requires no setup) but carries the same drawbacks. Use with caution. XML and Maps are non-isomorphic. Attributes on some nodes don't carry over if the node has just one text value (like a leaf). Naive map has no validation over what should be a collection. If and only if nodes are repeated at the same level will they beome a list.