-let fill_table () =
- List.iter
- (fun (typ, fname) ->
- let entry = `Entry_document [ `Extend_dtd_fully; `Parse_xml_decl ] in
- let config = { default_config with encoding = `Enc_utf8 } in
- let entity_manager =
- create_entity_manager ~is_document:true config (from_file fname)
- in
- let pull_parser = create_pull_parser config entry entity_manager in
- match typ with
- | `Entities -> iter_entities_file add_macro pull_parser
- | `Dictionary -> iter_dictionary_file add_macro pull_parser)
- tables
+let parse_from_xml () =
+ let (macro2utf8, utf82macro) = (Hashtbl.create 2000, Hashtbl.create 2000) in
+ let add_macro macro utf8 =
+ debug_print (sprintf "Adding macro %s = '%s'" macro utf8);
+ Hashtbl.add macro2utf8 macro utf8;
+(* Hashtbl.add utf82macro utf8 macro *)
+ in
+ let fill_table () =
+ List.iter
+ (fun (typ, fname) ->
+ let entry = `Entry_document [ `Extend_dtd_fully; `Parse_xml_decl ] in
+ let config = PxpHelmConf.pxp_config in
+ let entity_manager =
+ create_entity_manager ~is_document:true config (from_file fname)
+ in
+ let pull_parser = create_pull_parser config entry entity_manager in
+ match typ with
+ | `Entities -> iter_entities_file add_macro pull_parser
+ | `Dictionary -> iter_dictionary_file add_macro pull_parser)
+ xml_tables
+ in
+ fill_table ();
+ macro2utf8