X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Fuwobo%2Fuwobo.ml;h=345ccda59c53ccb2f769a34a50a283d6852ea2c2;hb=741b3e9014f940fbbd34bee7b606ff7e72170452;hp=891f08d9808fbc02039c90fc07cfc4609372e91b;hpb=a61e244b4cb630f95bed9b1f542df3b5800594b0;p=helm.git diff --git a/helm/uwobo/uwobo.ml b/helm/uwobo/uwobo.ml index 891f08d98..345ccda59 100644 --- a/helm/uwobo/uwobo.ml +++ b/helm/uwobo/uwobo.ml @@ -142,7 +142,30 @@ let parse_apply_params = ((fun _ -> []), []) (* no parameters, no properties *) ;; - (** Parse libxslt's message modes for error and debugging messages. Default is +let serialize_param_list = + let is_global_param = Pcre.pmatch ~pat:"^param(\\.[^.]+){1}$" in + let is_local_param = Pcre.pmatch ~pat:"^param(\\.[^.]+){2}$" in + function params -> + let param_value_list = + List.filter + (fun (param, _) -> (is_global_param param) || (is_local_param param)) + params + in + (String.concat + "," + (List.map + (fun (param, value) -> (Pcre.replace ~pat:"^param\\." param) ^ "=" ^ value) + param_value_list)) + +let deserialize_param_list = + List.map + (fun pv -> + match Pcre.split ~pat:"=" pv with + [key] -> (key, None) + | [key; value] -> (key, Some value) + | _ -> assert false) + +(** Parse libxslt's message modes for error and debugging messages. Default is to ignore mesages of both kind *) let parse_libxslt_msgs_mode (req: Http_types.request) = ((try @@ -365,7 +388,8 @@ let callback let profile_list = Uwobo_profiles.list () in respond_html ("