@@ -544,10 +544,9 @@ function process_one_file(path, full_file_name)
544
544
if abort_if (not score_partwise , " file does not appear to be exported from Finale" ) then
545
545
return
546
546
end
547
- local encoding_element = tinyxml2 .XMLHandle (score_partwise )
548
- :FirstChildElement (" identification" )
549
- :FirstChildElement (" encoding" )
550
- :ToElement ()
547
+ local information_element = tinyxml2 .XMLHandle (score_partwise ):FirstChildElement (" identification" ):ToElement ()
548
+ local encoding_element = tinyxml2 .XMLHandle (information_element ):FirstChildElement (" encoding" ):ToElement ()
549
+
551
550
local software_element = encoding_element and encoding_element :FirstChildElement (" software" )
552
551
local encoding_date_element = encoding_element and encoding_element :FirstChildElement (" encoding-date" )
553
552
if abort_if (not software_element or not encoding_date_element , " missing required element 'software' and/or 'encoding-date'" ) then
@@ -561,9 +560,9 @@ function process_one_file(path, full_file_name)
561
560
finaleplugin .Version .. " for " .. (finenv .UI ():IsOnMac () and " Mac" or " Windows" ))
562
561
local original_encoding_date = encoding_date_element :GetText ()
563
562
encoding_date_element :SetText (os.date (" %Y-%m-%d" ))
564
- local miscellaneous_element = encoding_element :FirstChildElement (" miscellaneous" )
563
+ local miscellaneous_element = information_element :FirstChildElement (" miscellaneous" )
565
564
if not miscellaneous_element then
566
- miscellaneous_element = encoding_element :InsertNewChildElement (" miscellaneous" )
565
+ miscellaneous_element = information_element :InsertNewChildElement (" miscellaneous" )
567
566
end
568
567
local function insert_miscellaneous_field (name , value )
569
568
local element = miscellaneous_element :InsertNewChildElement (" miscellaneous-field" )
0 commit comments