.TH xmerl_eventp 3erl "xmerl 1.3.31.1" "" "Erlang Module Definition" .SH NAME xmerl_eventp \- Simple event-based front-ends to xmerl_scan for processing of XML documents in streams and for parsing in SAX style. .SH DESCRIPTION .LP Simple event-based front-ends to xmerl_scan for processing of XML documents in streams and for parsing in SAX style\&. Each contain more elaborate settings of xmerl_scan that makes usage of the customization functions\&. .SH "DATA TYPES" .RS 2 .TP 2 .B option_list(): .RS 2 .LP Options allow to customize the behaviour of the scanner\&. See also tutorial on customization functions\&. .RE .RS 2 .LP Possible options are: .RE .RS 2 .TP 2 .B \fI{acc_fun, Fun}\fR\&: Call back function to accumulate contents of entity\&. .TP 2 .B \fI{continuation_fun, Fun} | {continuation_fun, Fun, ContinuationState}\fR\&: Call back function to decide what to do if the scanner runs into EOF before the document is complete\&. .TP 2 .B \fI{event_fun, Fun} | {event_fun, Fun, EventState}\fR\&: Call back function to handle scanner events\&. .TP 2 .B \fI{fetch_fun, Fun} | {fetch_fun, Fun, FetchState}\fR\&: Call back function to fetch an external resource\&. .TP 2 .B \fI{hook_fun, Fun} | {hook_fun, Fun, HookState}\fR\&: Call back function to process the document entities once identified\&. .TP 2 .B \fI{close_fun, Fun}\fR\&: Called when document has been completely parsed\&. .TP 2 .B \fI{rules, ReadFun, WriteFun, RulesState} | {rules, Rules}\fR\&: Handles storing of scanner information when parsing\&. .TP 2 .B \fI{user_state, UserState}\fR\&: Global state variable accessible from all customization functions .TP 2 .B \fI{fetch_path, PathList}\fR\&: PathList is a list of directories to search when fetching files\&. If the file in question is not in the fetch_path, the URI will be used as a file name\&. .TP 2 .B \fI{space, Flag}\fR\&: \&'preserve\&' (default) to preserve spaces, \&'normalize\&' to accumulate consecutive whitespace and replace it with one space\&. .TP 2 .B \fI{line, Line}\fR\&: To specify starting line for scanning in document which contains fragments of XML\&. .TP 2 .B \fI{namespace_conformant, Flag}\fR\&: Controls whether to behave as a namespace conformant XML parser, \&'false\&' (default) to not otherwise \&'true\&'\&. .TP 2 .B \fI{validation, Flag}\fR\&: 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\&'\&. .TP 2 .B \fI{schemaLocation, [{Namespace,Link}|\&.\&.\&.]}\fR\&: Tells explicitly which XML Schema documents to use to validate the XML document\&. Used together with the \fI{validation,schema}\fR\& option\&. .TP 2 .B \fI{quiet, Flag}\fR\&: Set to \&'true\&' if xmerl should behave quietly and not output any information to standard output (default \&'false\&')\&. .TP 2 .B \fI{doctype_DTD, DTD}\fR\&: Allows to specify DTD name when it isn\&'t available in the XML document\&. This option has effect only together with \fI{validation,\&'dtd\&'\fR\& option\&. .TP 2 .B \fI{xmlbase, Dir}\fR\&: XML Base directory\&. If using string/1 default is current directory\&. If using file/1 default is directory of given file\&. .TP 2 .B \fI{encoding, Enc}\fR\&: Set default character set used (default UTF-8)\&. This character set is used only if not explicitly given by the XML declaration\&. .TP 2 .B \fI{document, Flag}\fR\&: Set to \&'true\&' if xmerl should return a complete XML document as an xmlDocument record (default \&'false\&')\&. .TP 2 .B \fI{comments, Flag}\fR\&: Set to \&'false\&' if xmerl should skip comments otherwise they will be returned as xmlComment records (default \&'true\&')\&. .TP 2 .B \fI{default_attrs, Flag}\fR\&: Set to \&'true\&' if xmerl should add to elements missing attributes with a defined default value (default \&'false\&')\&. .RE .TP 2 .B xmlElement() = #xmlElement{}: .RE .SH EXPORTS .LP .B file_sax(Fname::string(), CallBackModule::atom(), UserState, Options::option_list()) -> NewUserState .br .RS .LP Parse file containing an XML document, SAX style\&. Wrapper for a call to the XML parser \fIxmerl_scan\fR\& with a \fIhook_fun\fR\& for using xmerl export functionality directly after an entity is parsed\&. .RE .LP .B stream(Fname::string(), Options::option_list()) -> xmlElement() .br .RS .LP Parse file containing an XML document as a stream, DOM style\&. Wrapper for a call to the XML parser \fIxmerl_scan\fR\& with a \fIcontinuation_fun\fR\& for handling streams of XML data\&. Note that the \fIcontinuation_fun\fR\&, \fIacc_fun\fR\&, \fIfetch_fun\fR\&, \fIrules\fR\& and \fIclose_fun\fR\& options cannot be user defined using this parser\&. .RE .LP .B stream_sax(Fname, CallBack::CallBackModule, UserState, Options) -> xmlElement() .br .RS .LP Types: .RS 3 Fname = string() .br CallBackModule = atom() .br Options = option_list() .br .RE .RE .RS .LP Parse file containing an XML document as a stream, SAX style\&. Wrapper for a call to the XML parser \fIxmerl_scan\fR\& with a \fIcontinuation_fun\fR\& for handling streams of XML data\&. Note that the \fIcontinuation_fun\fR\&, \fIacc_fun\fR\&, \fIfetch_fun\fR\&, \fIrules\fR\&, \fIhook_fun\fR\&, \fIclose_fun\fR\& and \fIuser_state\fR\& options cannot be user defined using this parser\&. .RE .LP .B string_sax(String::list(), CallBackModule::atom(), UserState, Options::option_list()) -> xmlElement() .br .RS .LP Parse file containing an XML document, SAX style\&. Wrapper for a call to the XML parser \fIxmerl_scan\fR\& with a \fIhook_fun\fR\& for using xmerl export functionality directly after an entity is parsed\&. .RE .SH AUTHORS .LP .I <>