XmlJson.BadgerFish (XmlJson v0.1.1) View Source

The BadgerFish implementation of XML <=> JSON

http://www.sklar.com/badgerfish/

Link to this section Summary

Functions

Deserializes the given XML string.

Serializes the given Map.

Link to this section Functions

Deserializes the given XML string.

Returns an :ok tuple with the XML deserialized to a Map

Examples

iex> XmlJson.BadgerFish.deserialize("<alice>bob</alice>")
{:ok, %{"alice" => %{"$" => "bob"}}}

Serializes the given Map.

Returns an :ok tuple with the Map serialized to XML

Examples

iex> XmlJson.BadgerFish.serialize(%{"alice" => %{"$" => "bob"}})
{:ok, "<alice>bob</alice>"}