VERSION = 0.3.0
NAME = http_getter
-REQUIRES = helm-getter helm-logger helm-registry
+REQUIRES = helm-getter helm-logger helm-registry netstring
COMMONOPTS = -package "$(REQUIRES)" -pp camlp4o -thread
OCAMLFIND = ocamlfind
OCAMLC = $(OCAMLFIND) ocamlc -g $(COMMONOPTS)
| "backward" -> `Backward
| c -> raise (Bad_request ("Invalid RDF class: " ^ c))
+let xml_escape = Netencoding.Html.encode ~in_enc:`Enc_utf8 ()
+
let html_tag ?exn () =
let xml_decl = "<?xml version=\"1.0\"?>\n" in
match exn with
- | Some (exn, value) ->
+ | Some (exn, arg) ->
+ let (exn, arg) = (xml_escape exn, xml_escape arg) in
sprintf
"%s<html xmlns=\"%s\"\nxmlns:helm=\"%s\"\nhelm:exception=\"%s\"\nhelm:exception_arg=\"%s\">\n"
- xml_decl xhtml_ns helm_ns exn value
+ xml_decl xhtml_ns helm_ns exn arg
| None ->
sprintf "%s<html xmlns=\"%s\"\nxmlns:helm=\"%s\">\n"
xml_decl xhtml_ns helm_ns