From b5eca1fff4476831847825aa46ce149924d1c8c0 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Fri, 11 Jul 2003 10:01:05 +0000 Subject: [PATCH] Bug fixed: the value of parameters must be valid XPath string literals ==> they can not contain both ' and " (at least in Veillard interpretation, of course ;-) The fix applied consist in accepting parameters with only ' or only " inside by quoting them using the opposite quote. As a consequence, variable values with just 's inside are now handled correctly. --- helm/uwobo/uwobo_engine.ml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/helm/uwobo/uwobo_engine.ml b/helm/uwobo/uwobo_engine.ml index f8be17806..03a3b424d 100644 --- a/helm/uwobo/uwobo_engine.ml +++ b/helm/uwobo/uwobo_engine.ml @@ -208,7 +208,23 @@ let apply logger#log `Debug (sprintf "Applying stylesheet %s ..." key); try let params = - List.map (fun (key,value) -> (key, "'" ^ value ^ "'")) (params key) + List.map + (fun (key,value) -> + let quoted_value = + if String.contains value '\'' then + if String.contains value '"' then + raise + (Failure + ("A parameter value can not contain both single and " ^ + "double quotes, since it must be a valid XPath string " ^ + "literal")) + else + "\"" ^ value ^ "\"" + else + "'" ^ value ^ "'" + in + (key,quoted_value) + ) (params key) in logger#log `Debug (sprintf "Gdome_xslt.applyStylesheet params=%s" -- 2.39.2