Serialise XML documents from parsed structures.
This module is used to serialise an XML document (in the same form which
xmlrat_parse
would produce) back to binaries.
options() = #{normalise_whitespace => boolean(), indent => boolean(), indentation_unit => binary(), comments => boolean(), doctypes => boolean(), single_quotes => boolean(), self_closing_tags => boolean(), trim_attributes => boolean()}
normalise_whitespace
: if true, run
xmlrat_parse:clean_whitespace/1
on the document before
serialising itindent
: if true, pretty-print / re-indent the document
before serialisingindentation_unit
: the unit of whitespace used for
indentation when indent
is true
. Defaults
to <<" ">>
(2 spaces).comments
: if false, elide comments from the outputdoctypes
: if false, elide DTDs from the outputsingle_quotes
: if false, disable the use of single-quotes
around attribute values (by default single quotes are used for values
which include double-quote characters)self_closing_tags
: if false, disable the use of
self-closing tags (<foobar/>
): instead always
generate a separate open and close tagtrim_atttributes
: if true, trim whitespace from the start
and end of all attribute valuesstring/1 | Serialises a document to a binary string. |
string/2 | Serialises a document to a binary string, with options. |
string(Root0::xmlrat:document()) -> binary()
Serialises a document to a binary string.
string(Root0::xmlrat:document(), Opts::options()) -> binary()
Serialises a document to a binary string, with options.
Generated by EDoc