From 51e6b3de4916ae17c04ab9ebfa02213a03091567 Mon Sep 17 00:00:00 2001 From: Levi Balling Date: Wed, 3 May 2023 16:26:33 -0600 Subject: [PATCH] Updated the XTCE parser to support larger xtce files(10's of MB). Also had situation where I was entering an else case of the converter. --- lib/cosmos/packets/parsers/xtce_parser.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cosmos/packets/parsers/xtce_parser.rb b/lib/cosmos/packets/parsers/xtce_parser.rb index 0eb100a0d..07c91744c 100644 --- a/lib/cosmos/packets/parsers/xtce_parser.rb +++ b/lib/cosmos/packets/parsers/xtce_parser.rb @@ -62,7 +62,7 @@ def parse(filename, target_name) # Fortify complains about Path Manipulation here # We have previously validated the file is a .xtce file in packet_config # The file is opened read-only and then immediately parsed by Nokogiri - doc = File.open(filename) { |f| Nokogiri::XML(f, nil, nil, Nokogiri::XML::ParseOptions::STRICT | Nokogiri::XML::ParseOptions::NOBLANKS) } + doc = File.open(filename) { |f| Nokogiri::XML(f, nil, nil, Nokogiri::XML::ParseOptions::STRICT | Nokogiri::XML::ParseOptions::NOBLANKS | Nokogiri::XML::ParseOptions::HUGE) } # Determine the @current_target_name xtce_process_element(doc.root) @current_target_name = target_name if target_name @@ -612,6 +612,8 @@ def set_min_max_default(item, type, data_type) # Strip quotes from strings if type.initialValue[0] == '"' && type.initialValue[-1] == '"' item.default = type.initialValue[1..-2] + else + item.default = type.initialValue end end else