[gcs] on flight plan save: correct dtd for subdirs

not nice, but works...
This commit is contained in:
Felix Ruess
2013-09-21 15:42:00 +02:00
parent f0b857ed40
commit 16d5bd4478
+5 -1
View File
@@ -50,7 +50,11 @@ let save_fp = fun geomap ->
None -> () None -> ()
| Some file -> | Some file ->
let f = open_out file in let f = open_out file in
fprintf f "<!DOCTYPE flight_plan SYSTEM \"flight_plan.dtd\">\n\n"; let fp_path = Str.replace_first (Str.regexp Env.flight_plans_path) "" (Filename.dirname file) in
let l = Str.split (Str.regexp Filename.dir_sep) fp_path in
let rel_path = String.concat Filename.dir_sep (Array.to_list (Array.make (List.length l) Filename.parent_dir_name)) in
let fp_dtd = rel_path // "flight_plan.dtd" in
fprintf f "<!DOCTYPE flight_plan SYSTEM \"%s\">\n\n" fp_dtd;
fprintf f "%s\n" (ExtXml.to_string_fmt fp#xml); fprintf f "%s\n" (ExtXml.to_string_fmt fp#xml);
close_out f; close_out f;
current_fp := Some (fp, file); current_fp := Some (fp, file);