Skip to content

Commit

Permalink
Add saxy.exs
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach committed Jun 7, 2022
1 parent 981c9ce commit 4791564
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions saxy.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Mix.install([
{:saxy, "~> 1.4"}
])

xml =
Saxy.XML.element("people", [], [
Saxy.XML.element("person", [name: "Alice"], []),
Saxy.XML.element("person", [name: "Bob"], [])
])
|> Saxy.encode!()
|> IO.inspect(label: :encoded)

{:ok, decoded} = Saxy.SimpleForm.parse_string(xml)
IO.inspect(decoded, label: :decoded)

0 comments on commit 4791564

Please sign in to comment.