]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/interface/pxpUriResolver.ml
...
[helm.git] / helm / interface / pxpUriResolver.ml
index 1be7355c759f05539a14d563be88bb57ad37ae77..7ca78aa933e360175e58fe4b3ab51e32197abf13 100644 (file)
 (*                                                                            *)
 (******************************************************************************)
 
-let resolve =
- function
-    "http://localhost:8081/getdtd?uri=cic.dtd" ->
-     Configuration.dtd_dir ^ "/cic.dtd"
-  | "http://localhost:8081/getdtd?uri=maththeory.dtd" ->
-     Configuration.dtd_dir ^ "/maththeory.dtd"
-  | "http://localhost:8081/getdtd?uri=annotations.dtd" ->
-     Configuration.dtd_dir ^ "/annotations.dtd"
-  | s  -> s
+let resolve s =
+ let starts_with s s' =
+  if String.length s < String.length s' then
+   false
+  else
+   (String.sub s 0 (String.length s')) = s'
+ in
+  if starts_with s "http:" then
+   ClientHTTP.get_and_save_to_tmp s
+  else
+   s
 ;;
 
 let url_syntax =