[airframe] expand airframe file includes before using it

see #2012
This commit is contained in:
Gautier Hattenberger
2017-02-16 01:51:17 +01:00
parent 861986abae
commit 5539bc81ac
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -460,6 +460,7 @@ let create_ac = fun ?(confirm_kill=true) alert (geomap:G.widget) (acs_notebook:G
(* do not check dtd if it is a http url *)
let via_http = Str.string_match (Str.regexp "http") af_url 0 in
let af_xml = ExtXml.parse_file ~noprovedtd:via_http af_file in
let af_xml = try Gen_common.expand_includes ac_id af_xml with _ -> af_xml in
(** Get an alternate speech name if available *)
let speech_name = get_speech_name af_xml name in
+1 -1
View File
@@ -65,7 +65,7 @@ let aircraft = fun name ->
let airframe_file = user_conf_path // ExtXml.attrib aircraft_xml "airframe" in
{ id = id; name = name;
airframe = ExtXml.parse_file airframe_file;
airframe = Gen_common.expand_includes (string_of_int id) (ExtXml.parse_file airframe_file);
flight_plan = ExtXml.parse_file (user_conf_path // ExtXml.attrib aircraft_xml "flight_plan");
radio = ExtXml.parse_file (user_conf_path // ExtXml.attrib aircraft_xml "radio")
}