View Source exml_stream (exml v3.2.0)

XML stream parser

Link to this section Summary

Types

infinite_stream - no distinct "stream start" or "stream end", only #xmlel{} will be returned max_child_size - specifies maximum byte size of any child of the root element. The byte size is counted from the start tag until the opening character of its end tag. Disabled if set to 0 (default).

Link to this section Types

-type element() :: exml_nif:stream_element().
-type parser() :: #parser{}.
infinite_stream - no distinct "stream start" or "stream end", only #xmlel{} will be returned max_child_size - specifies maximum byte size of any child of the root element. The byte size is counted from the start tag until the opening character of its end tag. Disabled if set to 0 (default).
-type parser_opt() :: {infinite_stream, boolean()} | {max_child_size, non_neg_integer()}.
-type start() :: #xmlstreamstart{}.
-type stop() :: #xmlstreamend{}.

Link to this section Functions

-spec free_parser(parser()) -> ok.
-spec new_parser() -> {ok, parser()} | {error, any()}.
-spec new_parser([parser_opt()]) -> {ok, parser()} | {error, any()}.
-spec parse(parser(), binary()) -> {ok, parser(), [exml_stream:element()]} | {error, Reason :: any()}.
-spec reset_parser(parser()) -> {ok, parser()}.