ElixirXML.Query (ElixirXML v0.0.1)
View SourceA module for querying XML-like structures in Elixir. Provides functions to find nodes using XPath-like syntax, extract text content, and retrieve attributes.
Summary
Functions
Retrieves an attribute from an XML node.
Finds nodes matching the given XPath-like expression.
Extracts all text content from an element and its children.
Functions
Retrieves an attribute from an XML node.
Examples
iex> ElixirXML.Query.attribute(%{attributes: %{class: "header"}}, "class")
"header"
Finds nodes matching the given XPath-like expression.
Examples
iex> ElixirXML.Query.find(xml_data, "//book/title")
["Elixir in Action"]
Extracts all text content from an element and its children.
Examples
iex> ElixirXML.Query.text(%{children: ["Hello", %{children: [" World"]}]})
"Hello World"