ElixirXML (ElixirXML v0.0.1)

View Source

Main module for parsing, formatting, and querying XML data in Elixir.

Summary

Functions

Retrieves the value of a specified attribute from a node.

Finds elements by name using an XPath-like query.

Formats an XML node as a string.

Formats an XML node as a complete XML document string.

Parses an XML string into a structured map.

Extracts the textual content from a node.

Functions

attribute(data, name)

@spec attribute(map(), binary()) :: binary() | nil

Retrieves the value of a specified attribute from a node.

find(data, filter)

@spec find(map(), binary()) :: list()

Finds elements by name using an XPath-like query.

format(data)

@spec format(map()) :: binary()

Formats an XML node as a string.

format_document(data)

@spec format_document(map()) :: binary()

Formats an XML node as a complete XML document string.

parse(text)

@spec parse(binary()) :: map()

Parses an XML string into a structured map.

text(data)

@spec text(map()) :: binary()

Extracts the textual content from a node.