<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="Up" href="Ocsigen_extensions.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of class methods" rel=Appendix href="index_methods.html"> <link title="Index of classes" rel=Appendix href="index_classes.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="Ocsigen_cache" rel="Chapter" href="Ocsigen_cache.html"> <link title="Ocsigen_lib_base" rel="Chapter" href="Ocsigen_lib_base.html"> <link title="Ocsigen_lib" rel="Chapter" href="Ocsigen_lib.html"> <link title="Ocsigen_config" rel="Chapter" href="Ocsigen_config.html"> <link title="Ocsigen_getcommandline" rel="Chapter" href="Ocsigen_getcommandline.html"> <link title="Ocsigen_messages" rel="Chapter" href="Ocsigen_messages.html"> <link title="Ocsigen_stream" rel="Chapter" href="Ocsigen_stream.html"> <link title="Ocsigen_loader" rel="Chapter" href="Ocsigen_loader.html"> <link title="Polytables" rel="Chapter" href="Polytables.html"> <link title="Http_headers" rel="Chapter" href="Http_headers.html"> <link title="Ocsigen_http_frame" rel="Chapter" href="Ocsigen_http_frame.html"> <link title="Ocsigen_headers" rel="Chapter" href="Ocsigen_headers.html"> <link title="Framepp" rel="Chapter" href="Framepp.html"> <link title="Ocsigen_http_com" rel="Chapter" href="Ocsigen_http_com.html"> <link title="Ocsigen_charset_mime" rel="Chapter" href="Ocsigen_charset_mime.html"> <link title="Ocsigen_senders" rel="Chapter" href="Ocsigen_senders.html"> <link title="Ocsigen_cookies" rel="Chapter" href="Ocsigen_cookies.html"> <link title="Ocsigen_extensions" rel="Chapter" href="Ocsigen_extensions.html"> <link title="Ocsigen_parseconfig" rel="Chapter" href="Ocsigen_parseconfig.html"> <link title="Ocsigen_http_client" rel="Chapter" href="Ocsigen_http_client.html"> <link title="Ocsigen_local_files" rel="Chapter" href="Ocsigen_local_files.html"> <link title="Ocsigen_server" rel="Chapter" href="Ocsigen_server.html"> <link title="Ocsigen_comet" rel="Chapter" href="Ocsigen_comet.html"> <link title="Accesscontrol" rel="Chapter" href="Accesscontrol.html"> <link title="Authbasic" rel="Chapter" href="Authbasic.html"> <link title="Ocsipersist" rel="Chapter" href="Ocsipersist.html"><title>Ocsigen_extensions.Configuration</title> </head> <body> <div class="navbar"> <a class="up" href="Ocsigen_extensions.html" title="Ocsigen_extensions">Up</a> </div> <h1>Module <a href="type_Ocsigen_extensions.Configuration.html">Ocsigen_extensions.Configuration</a></h1> <pre><span class="keyword">module</span> Configuration: <code class="code">sig</code> <a href="Ocsigen_extensions.Configuration.html">..</a> <code class="code">end</code></pre><div class="info module top"> This modules contains types and constructor for the description of XML configurations and the accordingly parsing.<br> </div> <hr width="100%"> <pre><span id="TYPEelement"><span class="keyword">type</span> <code class="type"></code>element</span> </pre> <div class="info "> Specification of a XML element.<br> </div> <pre><span id="TYPEattribute"><span class="keyword">type</span> <code class="type"></code>attribute</span> </pre> <div class="info "> Specification of a XML attribute.<br> </div> <pre><span id="VALelement"><span class="keyword">val</span> element</span> : <code class="type">name:string -><br> ?obligatory:bool -><br> ?init:(unit -> unit) -><br> ?elements:<a href="Ocsigen_extensions.Configuration.html#TYPEelement">element</a> list -><br> ?attributes:<a href="Ocsigen_extensions.Configuration.html#TYPEattribute">attribute</a> list -><br> ?pcdata:(string -> unit) -><br> ?other_elements:(string -><br> (string * string) list -> Simplexmlparser.xml list -> unit) -><br> ?other_attributes:(string -> string -> unit) -><br> unit -> <a href="Ocsigen_extensions.Configuration.html#TYPEelement">element</a></code></pre><div class="info "> Create the specification of a XML element.<br> </div> <div class="param_info"><code class="code">name</code> : Name of the XML tag</div> <div class="param_info"><code class="code">obligatory</code> : Whether the element is obligatory (<code class="code">false</code> by default)</div> <div class="param_info"><code class="code">init</code> : A function to be executed before processing the child elements and attributes</div> <div class="param_info"><code class="code">elements</code> : Specifications of the child elements</div> <div class="param_info"><code class="code">pcdata</code> : Function to be applied on the pcdata (<code class="code">ignore_blank_pcdata</code> by default)</div> <div class="param_info"><code class="code">other_elements</code> : Optional function to be applied on the content of unspecified tags</div> <div class="param_info"><code class="code">other_attributes</code> : Optional function to be applied on the unspecfied attributes</div> <pre><span id="VALattribute"><span class="keyword">val</span> attribute</span> : <code class="type">name:string -><br> ?obligatory:bool -><br> (string -> unit) -> <a href="Ocsigen_extensions.Configuration.html#TYPEattribute">attribute</a></code></pre><div class="info "> <code class="code">attribute ~name f</code> create a specification of a XML attribute.<br> </div> <div class="param_info"><code class="code">name</code> : The name of the XML attribute</div> <div class="param_info"><code class="code">obligatory</code> : Whether the attribute is obligatory (<code class="code">false</code> by default)</div> <pre><span id="VALprocess_element"><span class="keyword">val</span> process_element</span> : <code class="type">in_tag:string -><br> elements:<a href="Ocsigen_extensions.Configuration.html#TYPEelement">element</a> list -><br> ?pcdata:(string -> unit) -><br> ?other_elements:(string -><br> (string * string) list -> Simplexmlparser.xml list -> unit) -><br> Simplexmlparser.xml -> unit</code></pre><div class="info "> Process an XML element by the specifications.<br> <b>Raises</b> <code>Error_in_user_config_file</code> If an element (resp. attribute) occurs which is not specified by the <code class="code">element</code> (resp. <code class="code">attribute</code>) parameter and no function <code class="code">other_elements</code> (resp. other_attributes) is provided<br> </div> <div class="param_info"><code class="code">in_tag</code> : Name of the enclosing XML tag (just for generating error messages)</div> <div class="param_info"><code class="code">elements</code> : Specifications of the child elements</div> <div class="param_info"><code class="code">pcdata</code> : Function to be applied on the PCDATA (<code class="code">ignore_blank_pcdata</code> by default)</div> <div class="param_info"><code class="code">other_elements</code> : Optional function to be applied on unexpected child elements</div> <pre><span id="VALprocess_elements"><span class="keyword">val</span> process_elements</span> : <code class="type">in_tag:string -><br> elements:<a href="Ocsigen_extensions.Configuration.html#TYPEelement">element</a> list -><br> ?pcdata:(string -> unit) -><br> ?other_elements:(string -><br> (string * string) list -> Simplexmlparser.xml list -> unit) -><br> ?init:(unit -> unit) -> Simplexmlparser.xml list -> unit</code></pre><div class="info "> Application of <code class="code">process_element</code> on a list of XML elements.<br> </div> <pre><span id="VALignore_blank_pcdata"><span class="keyword">val</span> ignore_blank_pcdata</span> : <code class="type">in_tag:string -> string -> unit</code></pre><div class="info "> The specification for ignoring blank PCDATA ('\n', '\r', ' ', '\t') and failing otherwise (a reasonable default).<br> </div> </body></html>