Skip to content

XML

xml_build(data)

Build an XML string out of a data structure.

Examples:

iex> xml_build(["element", %{"attr" => "val"}, "content"]) "content"

xml_parse(data)

Parse an XML string into a data structure.

Examples:

iex> xml_parse("content") ["element", %{"attr" => "val"}, "content"]

xml_xpath_all(data, query)

Select a list of values or XML elements

Selects a list of values or XML elements from the given XML using an XPath expression. Always returns a list. In the case that no elements were selected, an empty list is returned.

xml_xpath_one(data, query)

Select a single value or XML element

Selects a single value or XML from the given XML data structure using an XPath expression. If the result of the expression is not exactly one single element, nil will be returned.