<!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="previous" href="Pxp_reader.resolve_to_any_obj_channel.html"> <link rel="next" href="Pxp_reader.resolve_as_file.html"> <link rel="Up" href="Pxp_reader.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 class types" rel=Appendix href="index_class_types.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="Pxp_types" rel="Chapter" href="Pxp_types.html"> <link title="Pxp_document" rel="Chapter" href="Pxp_document.html"> <link title="Pxp_dtd" rel="Chapter" href="Pxp_dtd.html"> <link title="Pxp_tree_parser" rel="Chapter" href="Pxp_tree_parser.html"> <link title="Pxp_core_types" rel="Chapter" href="Pxp_core_types.html"> <link title="Pxp_ev_parser" rel="Chapter" href="Pxp_ev_parser.html"> <link title="Pxp_event" rel="Chapter" href="Pxp_event.html"> <link title="Pxp_dtd_parser" rel="Chapter" href="Pxp_dtd_parser.html"> <link title="Pxp_codewriter" rel="Chapter" href="Pxp_codewriter.html"> <link title="Pxp_marshal" rel="Chapter" href="Pxp_marshal.html"> <link title="Pxp_yacc" rel="Chapter" href="Pxp_yacc.html"> <link title="Pxp_reader" rel="Chapter" href="Pxp_reader.html"> <link title="Intro_trees" rel="Chapter" href="Intro_trees.html"> <link title="Intro_extensions" rel="Chapter" href="Intro_extensions.html"> <link title="Intro_namespaces" rel="Chapter" href="Intro_namespaces.html"> <link title="Intro_events" rel="Chapter" href="Intro_events.html"> <link title="Intro_resolution" rel="Chapter" href="Intro_resolution.html"> <link title="Intro_getting_started" rel="Chapter" href="Intro_getting_started.html"> <link title="Intro_advanced" rel="Chapter" href="Intro_advanced.html"> <link title="Intro_preprocessor" rel="Chapter" href="Intro_preprocessor.html"> <link title="Example_readme" rel="Chapter" href="Example_readme.html"><title>PXP Reference : Pxp_reader.resolve_to_url_obj_channel</title> </head> <body> <div class="navbar"><a href="Pxp_reader.resolve_to_any_obj_channel.html">Previous</a> <a href="Pxp_reader.html">Up</a> <a href="Pxp_reader.resolve_as_file.html">Next</a> </div> <center><h1>Class <a href="type_Pxp_reader.resolve_to_url_obj_channel.html">Pxp_reader.resolve_to_url_obj_channel</a></h1></center> <br> <pre><span class="keyword">class</span> <a name="TYPEresolve_to_url_obj_channel"></a>resolve_to_url_obj_channel : <code class="type">?close:Netchannels.in_obj_channel -> unit -> url_of_id:(<a href="Pxp_types.html#TYPEresolver_id">Pxp_types.resolver_id</a> -> Neturl.url) -> base_url_of_id:(<a href="Pxp_types.html#TYPEresolver_id">Pxp_types.resolver_id</a> -> Neturl.url) -> channel_of_url:(<a href="Pxp_types.html#TYPEresolver_id">Pxp_types.resolver_id</a> -> Neturl.url -> <a href="Pxp_reader.html#TYPEaccepted_id">accepted_id</a>) -> unit -> </code><code class="type"><a href="Pxp_reader.resolver.html">resolver</a></code></pre>When this resolver gets an ID to read from, it calls the function <code class="code">url_of_id</code> to get the corresponding URL (such IDs are normally system IDs, but it is also possible to other kinds of IDs to URLs). This URL may be a relative URL; however, a URL scheme must be used which contains a path. The resolver converts the URL to an absolute URL if necessary. <p> To do so, the resolver calls <code class="code">base_url_of_id</code> to get the URL the relative URL must be interpreted relative to. Usually, this function returns the <code class="code">rid_system_base</code> as URL. This URL must be absolute. <p> The third function, <code class="code">channel_of_url</code>, is fed with the absolute URL as input. This function opens the resource to read from, and returns the <code class="code">accepted_id</code> like <code class="code">resolve_to_any_obj_channel</code> does. The resolver ID passed to <code class="code">channel_of_url</code> contains the string representation of the absolute URL as system ID. <p> Both functions, <code class="code">url_of_id</code> and <code class="code">channel_of_url</code>, can raise <code class="code"><span class="constructor">Not_competent</span></code> to indicate that the object is not able to read from the specified resource. However, there is a difference: A <code class="code"><span class="constructor">Not_competent</span></code> from <code class="code">url_of_id</code> is left as is, but a <code class="code"><span class="constructor">Not_competent</span></code> from <code class="code">channel_of_url</code> is converted to <code class="code"><span class="constructor">Not_resolvable</span></code>. So only <code class="code">url_of_id</code> decides which URLs are accepted by the resolver and which not, and in the latter case, other resolver can be tried. If <code class="code">channel_of_url</code> raises <code class="code"><span class="constructor">Not_competent</span></code>, however, the whole resolution procedure will stop, and no other resolver will be tried. <p> When the resolver is closed, the function passed by the <code class="code">close</code> argument is called. By default, the channel is closed (i.e. the default is: <code class="code">close:(<span class="keyword">fun</span> ch <span class="keywordsign">-></span> ch <span class="keywordsign">#</span> close_in())</code>).<br> <hr width="100%"> </body></html>