-(* PXP version *)
-(*open Pxp_dtd*)
-(*open Pxp_document*)
-(*open Pxp_types*)
-(*open Pxp_yacc*)
-
-(*let save_to =*)
-(* let dtd = new dtd PxpHelmConf.pxp_config.warner `Enc_utf8 in*)
-(* let create_key_node key value = |+ create a <key name="foo">value</key> +|*)
-(* let element =*)
-(* create_element_node ~valcheck:false PxpHelmConf.pxp_spec dtd*)
-(* "key" ["name", key]*)
-(* in*)
-(* let data = create_data_node PxpHelmConf.pxp_spec dtd value in*)
-(* element#append_node data;*)
-(* element*)
-(* in*)
-(* let is_section name =*)
-(* fun node ->*)
-(* match node#node_type with*)
-(* | T_element "section" ->*)
-(* (try node#attribute "name" = Value name with Not_found -> false)*)
-(* | _ -> false*)
-(* in*)
-(* let add_key_node root sections key value =*)
-(* let rec aux node = function*)
-(* | [] ->*)
-(* let key_node = create_key_node key value in*)
-(* node#append_node key_node*)
-(* | section :: tl ->*)
-(* let next_node =*)
-(* try*)
-(* find ~deeply:false (is_section section) node*)
-(* with Not_found ->*)
-(* let section_node =*)
-(* create_element_node ~valcheck:false PxpHelmConf.pxp_spec dtd*)
-(* "section" ["name", section]*)
-(* in*)
-(* node#append_node section_node;*)
-(* section_node*)
-(* in*)
-(* aux next_node tl*)
-(* in*)
-(* aux root sections*)
-(* in*)
-(* fun registry fname ->*)
-(* let xml_root =*)
-(* create_element_node ~valcheck:false PxpHelmConf.pxp_spec dtd*)
-(* "helm_registry" []*)
-(* in*)
-(* Hashtbl.iter*)
-(* (fun key value ->*)
-(* let sections, key =*)
-(* let hd, tl =*)
-(* match List.rev (Str.split dot_RE key) with*)
-(* | hd :: tl -> hd, tl*)
-(* | _ -> assert false*)
-(* in*)
-(* List.rev tl, hd*)
-(* in*)
-(* add_key_node xml_root sections key value)*)
-(* registry;*)
-(* let outfile = open_out fname in*)
-(* Unix.lockf (Unix.descr_of_out_channel outfile) Unix.F_LOCK 0; |+ blocks +|*)
-(* if*)
-(* Unix.system "xmllint --version &> /dev/null" = Unix.WEXITED 0*)
-(* then begin*)
-(* let (xmllint_in, xmllint_out) =*)
-(* Unix.open_process "xmllint --format --encode utf8 -"*)
-(* in*)
-(* xml_root#write (`Out_channel xmllint_out) `Enc_utf8;*)
-(* close_out xmllint_out;*)
-(* try*)
-(* while true do*)
-(* output_string outfile (input_line xmllint_in ^ "\n")*)
-(* done*)
-(* with End_of_file ->*)
-(* close_in xmllint_in;*)
-(* ignore (Unix.close_process (xmllint_in, xmllint_out))*)
-(* end else*)
-(* xml_root#write (`Out_channel outfile) `Enc_utf8;*)
-(* Unix.lockf (Unix.descr_of_out_channel outfile) Unix.F_ULOCK 0;*)
-(* close_out outfile*)
-
-(* PXP version *)
-(*let load_from_absolute =*)
-(* let config = PxpHelmConf.pxp_config in*)
-(* let entry = `Entry_document [ `Extend_dtd_fully; `Parse_xml_decl ] in*)
-(* let fold_key key_stack key =*)
-(* match key_stack with*)
-(* | [] -> key*)
-(* | _ -> String.concat "." key_stack ^ "." ^ key*)
-(* in*)
-(* fun registry fname ->*)
-(* debug_print ("Loading configuration from " ^ fname);*)
-(* let document =*)
-(* parse_wfdocument_entity config (from_file fname) PxpHelmConf.pxp_spec*)
-(* in*)
-(* let rec aux key_stack node =*)
-(* node#iter_nodes (fun n ->*)
-(* try*)
-(* (match n#node_type with*)
-(* | T_element "section" ->*)
-(* let section = n#required_string_attribute "name" in*)
-(* aux (key_stack @ [section]) n*)
-(* | T_element "key" ->*)
-(* let key = n#required_string_attribute "name" in*)
-(* let value = n#data in*)
-(* set registry ~key:(fold_key key_stack key) ~value*)
-(* | _ -> ())*)
-(* with exn ->*)
-(* let (fname, line, pos) = n#position in*)
-(* raise (Parse_error (fname, line, pos,*)
-(* "Uncaught exception: " ^ Printexc.to_string exn)))*)
-(* in*)
-(* let backup = backup_registry registry in*)
-(* Hashtbl.clear registry;*)
-(* try*)
-(* aux [] document#root*)
-(* with exn ->*)
-(* restore_registry backup registry;*)
-(* raise exn*)
-
-(* XmlPushParser version *)
-let load_from_absolute registry fname =
- let path = ref [] in (* <section> elements entered so far *)