defmodule Example.Attribute do
use XmlSchema, tag: "a"
xml do
xml_tag :k, :string
xml_tag :j, {:param, :string}
xml_tag :manyj, {:array, {:param, :string}}
end
def doc do
"""
one
tree
shrub
flower
"""
end
def expect do
%Example.Attribute{
_attributes: %{"first" => "lemon", "second" => "lime"},
k: "one",
j: {"tree", %{"fourth" => "orange"}},
manyj: [
{"shrub", %{"five" => "cherry"}},
{"flower", %{"six" => "berry"}}
]
}
end
def expect_xml do
"""
one
tree
shrub
flower
"""
|> String.trim_trailing()
end
end