Unix.unlink cicfilename ;
annobj
| Some bodyuri ->
- let cicbodyfilename = G.getxml (U.cicuri_of_uri bodyuri) in
+ let cicbodyfilename =
+ try
+ ignore (Getter.resolve bodyuri) ;
+ (* The body exists ==> it is not an axiom *)
+ Some (Getter.getxml bodyuri)
+ with
+ Getter.Unresolved ->
+ (* The body does not exist ==> we consider it an axiom *)
+ None
+ in
let annobj =
- CicParser.annobj_of_xml cicfilename (Some cicbodyfilename)
+ CicParser.annobj_of_xml cicfilename cicbodyfilename
in
Unix.unlink cicfilename ;
- Unix.unlink cicbodyfilename ;
+ (match cicbodyfilename with None -> () | Some f -> Unix.unlink f) ;
annobj
;;
Unix.unlink cicfilename ;
obj
| Some bodyuri ->
- let cicbodyfilename = G.getxml (U.cicuri_of_uri bodyuri) in
- let obj = CicParser.obj_of_xml cicfilename (Some cicbodyfilename) in
+ let cicbodyfilename =
+ try
+ ignore (Getter.resolve bodyuri) ;
+ (* The body exists ==> it is not an axiom *)
+ Some (Getter.getxml bodyuri)
+ with
+ Getter.Unresolved ->
+ (* The body does not exist ==> we consider it an axiom *)
+ None
+ in
+ let obj = CicParser.obj_of_xml cicfilename cicbodyfilename in
Unix.unlink cicfilename ;
- Unix.unlink cicbodyfilename ;
+ (match cicbodyfilename with None -> () | Some f -> Unix.unlink f) ;
obj
;;