Elixml
Elixml is going to be an xml lib for Elixir that is easy to and enable you to
- parse xml files (kinda works)
- query xml
- super basic implementation of searching
- xpath (not started)
- namespace support (not implemented)
- export to file/text (basic impl works)
-
compose documents
- possible with using maps
- dsl would be nice (not implemented)
Installation
If available in Hex, the package can be installed
by adding elixml to your list of dependencies in mix.exs:
def deps do
[
{:elixml, github: "mlankenau/elixml"}
]
endUsage
Parse an XML file
mydoc =
File.read!("my_file.xml")
|> Elixml.parse
# will return the root element like
# %{name: "my_root_element", children: [...], attributes: [...]}Find elements
Elixml.find(mydoc, "some_element")
# will return the list of elements found
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/elixml.