3 * Stefano Zacchiroli <zack@cs.unibo.it>
4 * for the HELM Team http://helm.cs.unibo.it/
6 * This file is part of HELM, an Hypertextual, Electronic
7 * Library of Mathematics, developed at the Computer Science
8 * Department, University of Bologna, Italy.
10 * HELM is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * HELM is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with HELM; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25 * For details, see the HELM World-Wide-Web page,
26 * http://helm.cs.unibo.it/
31 exception Uwobo_failure of string;;
33 let supported_properties = [
34 "cdata-section-elements";
41 "omit-xml-declaration";
46 let is_supported_property name = List.mem name supported_properties
53 <title>UWOBO's help message</title>
57 Usage: <kbd>http://hostname:uwoboport/</kbd><em>command</em>
63 <b><kbd>help</kbd></b><br />
64 display this help message
67 <b><kbd>add?bind=key,uri[&bind=key,stylesheet[&...]]</kbd></b><br />
68 load a new stylesheet, specified by <em>uri</em>, and bind it to key
72 <b><kbd>remove?[?keys=key1,key2,...]</kbd></b><br />
73 unload stylesheets specified by <em>key1, key2, ...</em> or all
74 stylesheets if no key was given
77 <b><kbd>reload?[?keys=key1,key2,...]</kbd></b><br />
78 reload stylesheets specified by <em>key1, key2, ...</em> or all
79 stylesheets if no key was given
82 <b><kbd>list</kbd></b><br />
83 return a list of loaded stylesheets
86 <b><kbd>apply?xmluri=uri&keys=key1,key2,...[¶m.name=value[¶m.name=value[&...]]][¶m.key.name=value[¶m.key.name=value[&...]]][&name[=value][&prop.name[=value][&...]]]</kbd></b><br />
87 apply a chain of stylesheets, specified by <em>key1, key2, ...</em>, to an
88 input document, specified by <em>uri</em>.<br />
89 Additional parameters can be set for each stylesheet application: global
90 parameters (i.e. parameters passed to all stylesheets) are set using
91 <em>param.name=value</em> syntax, per stylesheet parameters are set using
92 <em>param.key.name=value</em> where <em>key</em> is the key of a loaded
94 Properties of the final chain output can be set too: valueless properties
95 can be set using <em>prop.name</em> syntax, others can be set using
96 <em>prop.name=value</em> syntax.<br />
97 Current supported properties are: %s.
102 (String.concat ", " supported_properties);;
104 let pp_error = sprintf "<html><body><h1>Error: %s</h1></body></html>";;
105 let return_error msg outchan =
106 Http_daemon.respond ~body:(pp_error msg) outchan;;
107 let bad_request body outchan =
108 Http_daemon.respond_error ~code:400 ~body outchan