jhn_s3c_xml (jhn_s3c v1.0.0)

View Source

The xml encoding/decoding for S3C.

Summary

Types

attr/0

-type attr() :: {atom() | binary(), undefined | binary() | atom()}.

cdata/0

-type cdata() :: #cdata{data :: binary()}.

xml/0

-type xml() ::
          #xml{tag :: atom() | binary(), attrs :: [attr()], children :: [xml() | cdata() | binary()]}.

Functions

decode(Binary)

-spec decode(binary()) -> xml() | {error, _}.

encode(XML)

-spec encode(xml()) -> iodata().

encode(XML, Return)

-spec encode(xml(), iolist | binary) -> iodata().

select(Selection, Xml)

-spec select(_,
             #xml{tag :: atom() | binary(), attrs :: [attr()], children :: [xml() | cdata() | binary()]}) ->
                map() | [map()] | binary() | [binary()] | {error, _}.