Braintree.XML.Decoder (Braintree v0.15.0)
XML dumping tailored to encoding params sent by Braintree.
Summary
Types
@type xml() :: binary()
Functions
Converts an XML document, or fragment, into a map. Type annotation attributes are respected, but all other attributes are ignored.
Examples
iex> Braintree.XML.Decoder.load("<a><b type='integer'>1</b><c>2</c></a>")
%{"a" => %{"b" => 1, "c" => "2"}}
iex> Braintree.XML.Decoder.load("<a><b type='string'>José</b></a>")
%{"a" => %{"b" => "José"}}
iex> Braintree.XML.Decoder.load("<a><b type='string'>First & Last</b></a>")
%{"a" => %{"b" => "First & Last"}}
iex> Braintree.XML.Decoder.load("<a><b type='string'>"air quotes"</b></a>")
%{"a" => %{"b" => ~s("air quotes")}}