Braintree.XML.Decoder (Braintree v0.13.0)
XML dumping tailored to encoding params sent by Braintree.
Link to this section Summary
Link to this section Types
Link to this type
xml()
@type xml() :: binary()
Link to this section Functions
Link to this function
load(xml)
Converts an XML document, or fragment, into a map. Type annotation attributes are respected, but all other attributes are ignored.
examples
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")}}