Xmlixir (xmlixir v0.1.0)
Copy MarkdownA small XML parser operating on UTF-8 binaries internally.
Parser input is stored as UTF-8 internally. UTF-8, BOM-marked UTF-16LE/ UTF-16BE, and declared ISO-8859-1 input are accepted. Other encodings must be converted before parsing.
Summary
Functions
Parses XML and always returns an Xmlixir.Document wrapper.
Scans one XML element and returns {element, unconsumed_binary}.
Scans one XML element and always returns an Xmlixir.Document wrapper.
Scans one XML element and wraps successful results in {:ok, result}.
Streams parser events from binary or chunked XML input.
Streams matching element nodes from a binary XML document.
Serializes an Xmlixir node or document wrapper to XML iodata.
Types
@type t() :: %Xmlixir{ attribute_nodes: term(), attributes: map(), children: [xml_node() | binary()], content: [xml_node() | binary()], dtd_id_attributes: term(), elementdef: term(), expanded_name: term(), language: term(), name: binary(), namespace: term(), nsinfo: term(), parents: term(), pos: term(), xmlbase: term() }
@type xml_node() :: t()
Functions
@spec parse_document(binary(), keyword()) :: {:ok, Xmlixir.Document.t()} | {:error, term()}
Parses XML and always returns an Xmlixir.Document wrapper.
Scans one XML element and returns {element, unconsumed_binary}.
@spec scan_document(binary(), keyword()) :: {Xmlixir.Document.t(), binary()} | {:error, term()}
Scans one XML element and always returns an Xmlixir.Document wrapper.
@spec scan_result(binary(), keyword()) :: {:ok, {t() | Xmlixir.Document.t(), binary()}} | {:error, term()}
Scans one XML element and wraps successful results in {:ok, result}.
Streams parser events from binary or chunked XML input.
Streams matching element nodes from a binary XML document.
@spec to_iodata(t() | Xmlixir.Document.t() | [term()]) :: iodata()
Serializes an Xmlixir node or document wrapper to XML iodata.