WechatPay v0.9.0 WechatPay.Utils.XMLParser View Source
Module to convert a XML string to map
Link to this section Summary
Functions
Convert the response XML string to map
Link to this section Functions
Specs
parse(String.t(), String.t()) :: {:ok, map()} | {:error, WechatPay.Error.t()}
Convert the response XML string to map
Example
iex> WechatPay.Utils.XMLParser.parse("<xml><foo><![CDATA[bar]]></foo></xml>", "xml")
...> {:ok, %{foo: "bar"}}
iex> WechatPay.Utils.XMLParser.parse("<root><foo><![CDATA[bar]]></foo></root>", "root")
...> {:ok, %{foo: "bar"}}