Protocol for converting Elixir data structures to XML.
Drop-in replacement for Saxy.Builder.
Manual Implementation
defimpl RustyXML.Builder, for: MyStruct do
import RustyXML.XML
def build(%MyStruct{name: name, id: id}) do
element("person", [{"id", to_string(id)}], [
element("name", [], [name])
])
end
end
Summary
Functions
Convert a term to an XML element structure suitable for RustyXML.encode!/1.
Types
@type t() :: term()
All the types that implement this protocol.
Functions
@spec build(term()) :: RustyXML.XML.element() | String.t() | [RustyXML.XML.element() | String.t()]
Convert a term to an XML element structure suitable for RustyXML.encode!/1.