Packages

Tesla middleware for encoding requests and decoding responses as XML.

Current section

Files

Jump to
tesla_middleware_xml lib adapters saxy.ex
Raw

lib/adapters/saxy.ex

defmodule Tesla.Middleware.XML.Adapters.Saxy do
@default_handler Saxy.SimpleForm.Handler
@default_handler_opts []
def encode(data, _opts) do
Saxy.encode!(data)
end
def decode(data, opts) do
handler = Keyword.get(opts, :convention, @default_handler)
opts = Keyword.get(opts, :convention, @default_handler_opts)
Saxy.parse_string(data, handler, opts)
end
end