elixir_xml_to_map v1.0.1 XmlToMap

Simple convenience module for getting a map out of an XML string.

Link to this section Summary

Functions

naive_map(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. For example no validation over what should be a collection. If and only if nodes are repeated at the same level will they beome a list. If a node has attributes we'll prepend a "-" in front of them and merge them into the map and take the node value and nest that inside "#content" key.

Link to this section Functions

Link to this function

get_generic_data_structure(xml)

naive_map(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. For example no validation over what should be a collection. If and only if nodes are repeated at the same level will they beome a list. If a node has attributes we'll prepend a "-" in front of them and merge them into the map and take the node value and nest that inside "#content" key.