]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic/cicParser.ml
Initial revision
[helm.git] / helm / ocaml / cic / cicParser.ml
index f0d3e800fe11f84a44944119866c8374c393e142..7cabeb6ae16413f6ac108b15b54f109b0ad8c755 100644 (file)
@@ -46,7 +46,7 @@ class warner =
   end
 ;;
 
-exception EmptyUri;;
+exception EmptyUri of string;;
 
 (* given an uri u it returns the list of tokens of the base uri of u *)
 (* e.g.: token_of_uri "cic:/a/b/c/d.xml" returns ["a" ; "b" ; "c"]   *)
@@ -54,7 +54,8 @@ let tokens_of_uri uri =
  let uri' = UriManager.string_of_uri uri in
  let rec chop_list =
   function
-     [] -> raise EmptyUri
+     [] -> raise (EmptyUri uri')
+   | [fn] -> []
    | he::[fn] -> [he]
    | he::tl -> he::(chop_list tl)
  in
@@ -76,7 +77,9 @@ let annobj_of_xml filename uri =
       Y.parse_document_entity config
 (*PXP       (Y.ExtID (Pxp_types.System filename,
          new Pxp_reader.resolve_as_file ~url_of_id ()))
-*)     (PxpUriResolver.from_file filename)
+*)
+(*       (PxpUriResolver.from_file filename) *)
+       (Y.from_file ~alt:[PxpUrlResolver.url_resolver] filename)
        CicParser3.domspec
     in
      CicParser2.get_term d#root