View Source exml_stream (exml v4.1.0)
XML stream parser
Summary
Types
One of exml:element/0
, start/0
, or stop/0
.
#parser{}
record. Keeps track of unparsed buffers.
Parser options
#xmlstreamstart{}
record.
#xmlstreamend{}
record.
Functions
Free a parser
See also: new_parser/1.
Creates a new parser. See parser_opt/0
for configuration.
Makes a parser parse input.
Resets the parser's buffers
Types
-type element() :: exml:element() | start() | stop().
One of exml:element/0
, start/0
, or stop/0
.
#parser{}
record. Keeps track of unparsed buffers.
-type parser_opt() :: {infinite_stream, boolean()} | {max_element_size, non_neg_integer()}.
Parser options
-type start() :: #xmlstreamstart{name :: binary(), attrs :: exml:attrs()}.
#xmlstreamstart{}
record.
-type stop() :: #xmlstreamend{name :: binary()}.
#xmlstreamend{}
record.
Functions
-spec free_parser(parser()) -> ok.
Free a parser
Kept for backwards-compatibility, it is a no-op.
See also: new_parser/1.
-spec new_parser([parser_opt()]) -> {ok, parser()} | {error, any()}.
Creates a new parser. See parser_opt/0
for configuration.
Makes a parser parse input.
If successful, returns parsed elements and a new parser with updated buffers.
Resets the parser's buffers