exception ImpossiblePossible;;
exception NotImplemented;;
-let dtdname = "http://localhost:8081/getdtd?uri=cic.dtd";;
-
let param_attribute_of_params params =
String.concat " " (List.map UriManager.string_of_uri params)
;;
aux
;;
-let print_object uri ~ids_to_inner_sorts =
- let rec aux =
- let module C = Cic in
- let module X = Xml in
- let module U = UriManager in
+let print_object uri ~ids_to_inner_sorts ~ask_dtd_to_the_getter =
+ let module C = Cic in
+ let module X = Xml in
+ let module U = UriManager in
+ let dtdname =
+ if ask_dtd_to_the_getter then
+ Configuration.getter_url ^ "getdtd?uri=cic.dtd"
+ else
+ "http://www.cs.unibo.it/helm/dtd/cic.dtd"
+ in
function
C.ACurrentProof (id,idbody,n,conjectures,bo,ty,params) ->
let params' = param_attribute_of_params params in
in
let xmlbo =
[< X.xml_cdata "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" ;
- X.xml_cdata ("<!DOCTYPE CurrentProof SYSTEM \""^dtdname ^"\">\n");
+ X.xml_cdata ("<!DOCTYPE CurrentProof SYSTEM \""^ dtdname ^ "\">\n");
xml_for_current_proof_body
>] in
let xmlty =
[< X.xml_cdata "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" ;
- X.xml_cdata
- ("<!DOCTYPE ConstantType SYSTEM \"" ^ dtdname ^ "\">\n");
+ X.xml_cdata ("<!DOCTYPE ConstantType SYSTEM \""^ dtdname ^ "\">\n");
xml_for_current_proof_type
>]
in
in
let xmlty =
[< X.xml_cdata "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" ;
- X.xml_cdata ("<!DOCTYPE ConstantType SYSTEM \""^dtdname ^"\">\n");
+ X.xml_cdata ("<!DOCTYPE ConstantType SYSTEM \""^ dtdname ^ "\">\n");
X.xml_nempty "ConstantType"
["name",n ; "params",params' ; "id", id]
[< print_term ids_to_inner_sorts ty >]
| C.AInductiveDefinition (id,tys,params,nparams) ->
let params' = param_attribute_of_params params in
[< X.xml_cdata "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" ;
- X.xml_cdata ("<!DOCTYPE InductiveDefinition SYSTEM \"" ^
- dtdname ^ "\">\n") ;
+ X.xml_cdata
+ ("<!DOCTYPE InductiveDefinition SYSTEM \"" ^ dtdname ^ "\">\n") ;
X.xml_nempty "InductiveDefinition"
["noParams",string_of_int nparams ;
"id",id ;
)
>]
>], None
- in
- aux
;;
let print_inner_types curi ~ids_to_inner_sorts ~ids_to_inner_types =
=
(*CSC: ????????????????? *)
let xml, bodyxml =
- Cic2Xml.print_object uri ~ids_to_inner_sorts annobj
+ Cic2Xml.print_object uri ~ids_to_inner_sorts ~ask_dtd_to_the_getter:true
+ annobj
in
let xmlinnertypes =
Cic2Xml.print_inner_types uri ~ids_to_inner_sorts
in
let path = pathname ^ "/" ^ name in
let xml, bodyxml =
- Cic2Xml.print_object uri ~ids_to_inner_sorts annobj
+ Cic2Xml.print_object uri ~ids_to_inner_sorts ~ask_dtd_to_the_getter:false
+ annobj
in
let xmlinnertypes =
Cic2Xml.print_inner_types uri ~ids_to_inner_sorts
Cic2acic.acic_object_of_cic_object currentproof
in
let xml, bodyxml =
- match Cic2Xml.print_object uri ~ids_to_inner_sorts acurrentproof with
+ match
+ Cic2Xml.print_object uri ~ids_to_inner_sorts
+ ~ask_dtd_to_the_getter:true acurrentproof
+ with
xml,Some bodyxml -> xml,bodyxml
| _,None -> assert false
in