]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql_interpreter/pattern.ml
- redesigned error and warning handling for libxslt
[helm.git] / helm / ocaml / mathql_interpreter / pattern.ml
index 86ef522b92e791fddeebd4ac24f5649035024679..9809552a034c64d55373c3dfcd771157409b5b3c 100644 (file)
@@ -38,10 +38,17 @@ let rec pattern_ex l =
      [] -> []
    | s::tl -> let result = 
              let c = pgc () in
-             let qq = "select uri from registry where uri ~ '" ^ s ^ "' order by registry.uri asc" in
+             let quoted_s =
+              Str.global_substitute (Str.regexp "'")
+               (function _ -> "\\'") s in
+             let qq = "select uri from registry where uri ~ '" ^ quoted_s ^ "' order by registry.uri asc" in
              let res = c#exec (qq) in
-             List.map (function uri -> (uri,[])) (pgresult_to_string_list res)
-             in
+             List.map (function uri -> (List.hd uri,[])) res#get_list
+             (*for i = 0 to res#ntuples do 
+            List.map (function uri -> (uri,[])) (res#get_tuple_list i)
+             done*)
+
+            in
             cat result (pattern_ex tl)
 ;;