xmerl_eventp(3erl)
π xmerl_eventp π
okay so bestie, welcome to xmerl_eventp β the Erlang Module Definition for the simple event-based front-ends to xmerl_scan π
β¨ NAME β¨
xmerl_eventp β Simple event-based front-ends to xmerl_scan for processing of XML documents in streams and for parsing in SAX style. π¦
πΈ DESCRIPTION πΈ
So basically, these are the simple event-based front-ends to xmerl_scan for processing of XML documents in streams and for parsing in SAX style. Each one contains more elaborate settings of xmerl_scan that makes usage of the customization functions. It's giving "convenience wrapper, but make it iconic" β no cap. π
π DATA TYPES π
option_list()
Options allow to customize the behaviour of the scanner. See also tutorial on customization functions. π§
Possible options are:
{acc_fun, Fun}β Call back function to accumulate contents of entity.{continuation_fun, Fun}|{continuation_fun, Fun, ContinuationState}β Call back function to decide what to do if the scanner runs intoEOFbefore the document is complete. π (the "we ran out of document bestie" handler){event_fun, Fun}|{event_fun, Fun, EventState}β Call back function to handle scanner events.{fetch_fun, Fun}|{fetch_fun, Fun, FetchState}β Call back function to fetch an external resource.{hook_fun, Fun}|{hook_fun, Fun, HookState}β Call back function to process the document entities once identified.{close_fun, Fun}β Called when document has been completely parsed. π the little end-of-parse send-off{rules, ReadFun, WriteFun, RulesState}|{rules, Rules}β Handles storing of scanner information when parsing.{user_state, UserState}β Global state variable accessible from all customization functions.{fetch_path, PathList}βPathListis a list of directories to search when fetching files. If the file in question is not in thefetch_path, the URI will be used as a file name.{space, Flag}β'preserve'(default) to preserve spaces,'normalize'to accumulate consecutive whitespace and replace it with one space.{line, Line}β To specify starting line for scanning in document which contains fragments of XML.{namespace_conformant, Flag}β Controls whether to behave as a namespace conformant XML parser,'false'(default) to not otherwise'true'.{validation, Flag}β Controls whether to process as a validating XML parser:'off'(default) no validation, or validation'dtd'by DTD or'schema'by XML Schema.'false'and'true'options are obsolete (i.e. they may be removed in a future release), if used'false'equals'off'and'true'equals'dtd'.
π¨ heads up bestie:'false'and'true'are the deprecated girlies here β they may be removed in a future release, so don't get attached.
{schemaLocation, [{Namespace,Link}|...]}β Tells explicitly which XML Schema documents to use to validate the XML document. Used together with the{validation,schema}option.{quiet, Flag}β Set to'true'ifxmerlshould behave quietly and not output any information to standard output (default'false'). π€«{doctype_DTD, DTD}β Allows to specify DTD name when it isn't available in the XML document. This option has effect only together with{validation,'dtd'option.{xmlbase, Dir}β XML Base directory. If usingstring/1default is current directory. If usingfile/1default is directory of given file.{encoding, Enc}β Set default character set used (defaultUTF-8). This character set is used only if not explicitly given by the XML declaration.{document, Flag}β Set to'true'ifxmerlshould return a complete XML document as anxmlDocumentrecord (default'false').{comments, Flag}β Set to'false'ifxmerlshould skip comments otherwise they will be returned asxmlCommentrecords (default'true').{default_attrs, Flag}β Set to'true'ifxmerlshould add to elements missing attributes with a defined default value (default'false').
xmlElement() = #xmlElement{}
that's the whole type, bestie. literally it. π
π₯ EXPORTS π₯
file_sax(Fname::string(), CallBackModule::atom(), UserState, Options::option_list()) -> NewUserState
Parse file containing an XML document, SAX style. Wrapper for a call to the XML parser xmerl_scan with a hook_fun for using xmerl export functionality directly after an entity is parsed. β¨
stream(Fname::string(), Options::option_list()) -> xmlElement()
Parse file containing an XML document as a stream, DOM style. Wrapper for a call to the XML parser xmerl_scan with a continuation_fun for handling streams of XML data.
π real talk: note that thecontinuation_fun,acc_fun,fetch_fun,rulesandclose_funoptions cannot be user defined using this parser.
stream_sax(Fname, CallBack::CallBackModule, UserState, Options) -> xmlElement()
Types:
Fname = string()
CallBackModule = atom()
Options = option_list()
Parse file containing an XML document as a stream, SAX style. Wrapper for a call to the XML parser xmerl_scan with a continuation_fun for handling streams of XML data.
π another one: note that thecontinuation_fun,acc_fun,fetch_fun,rules,hook_fun,close_funanduser_stateoptions cannot be user defined using this parser. (yes, this list is longer than thestream/2one β read it twice, iykyk)
string_sax(String::list(), CallBackModule::atom(), UserState, Options::option_list()) -> xmlElement()
Parse file containing an XML document, SAX style. Wrapper for a call to the XML parser xmerl_scan with a hook_fun for using xmerl export functionality directly after an entity is parsed. π«Ά
π AUTHORS π
<>
okay that's the whole page, bestie β slay, you're now an xmerl_eventp girlie πβ¨
π this iconic little manpage comes to you courtesy of xmerl 1.3.31.1 β periodt. π
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms