Clause
← All documentation

xmerl

Clause's xmerl covers what MongooseIM's dependencies call: erlcloud scans AWS responses with xmerl_scan:string/1 and reads them with xmerl_xpath:string/2, builds requests with xmerl:export_simple/2,3, and jiffy and rabbit_common convert text with xmerl_ucs. The library is Erlang, in library/xmerl/, with the xmerl.app resource and OTP's header xmerl.hrl (-include_lib("xmerl/include/xmerl.hrl")). Its records and macros are OTP 29's, observed from a module including it: the record definitions from its debug information, the macros through epp.

xmerl_scan

string/1,2 scan an element (or, with {document, true}, an #xmlDocument{}) from a string, as OTP 29 scans it without a DTD, and return it with the rest of the input after the trailing comments, processing instructions and whitespace (the rest's bytes as given). A binary is function_clause, as in OTP.

file/1,2 and the state functions are declined.

xmerl_xpath

string/2,3 evaluate an XPath 1.0 expression on a scanned element, document, text, attribute, comment or processing instruction, as OTP 29's xmerl evaluates it (which differs from XPath 1.0 in places). The expression is parsed into OTP's parse trees (clause_xmerl_xpath); a syntax error is OTP's {badmatch, {error, {1, xmerl_xpath_parse, ["syntax error before: ", [Token]]}}}. string/3 takes the options namespace, bindings and functions (unused, as by OTP for name tests); another option is function_clause. xmerl_xs:select/2 is string/2.

string/5, axis/3,4, eval_path/3, write_node/1 and xmerl_xs's transformation functions are declined.

xmerl export

xmerl:export/2,3, export_content/2, export_element/2 (records) and export_simple/2,3, export_simple_content/2, export_simple_element/2 (simple forms) export XML through a callback module and the modules it inherits from ('#xml-inheritance#'/0, callbacks/1), as OTP's:

export_element/3 and the xmerl_html, xmerl_sgml, xmerl_text and xmerl_otpsgml callbacks are not provided.

xmerl_ucs

from_utf8/1 (lists and binaries; surrogates and four-byte code points above 16#10FFFF accepted, other bad sequences exit({ucs, {bad_utf8_character_code}})), to_utf8/1 (if_clause for surrogates, 16#FFFE and 16#FFFF), is_unicode/1 and from_utf16be/1 ({error, not_utf16be} reported with OTP's text for a lone surrogate or odd byte) as OTP's. Its other charset functions are declined.