Error message when importing files: "... not a valid MusicXML file"

• Aug 25, 2022 - 02:50

I have about 50 files that I am currently transferring from my DAW in MusicXML format for import into Musescore. Most of the files are importing fine, but for some reason 5 of them are being interpreted by Musescore as invalid MusicXML files. A window comes up saying that the such and such .xml file “is not a valid MusicXML file”.

Clicking on the ‘Show Details’ tab brings up the following message:
Fatal error: line 18 column 50 Expected '#' or '[a-zA-Z]', but got ' '.

The error message is almost identical for each of the invalid files, except the column number is different for 3 of them.
Fatal error: line 18 column 50 Expected '#' or '[a-zA-Z]', but got ' '.
Fatal error: line 18 column 29 Expected '#' or '[a-zA-Z]', but got ' '.
Fatal error: line 18 column 48 Expected '#' or '[a-zA-Z]', but got ' '.
Fatal error: line 18 column 29 Expected '#' or '[a-zA-Z]', but got ' '.
Fatal error: line 18 column 45 Expected '#' or '[a-zA-Z]', but got ' '.

They are all ‘line 18’. If I try and open any of the files, Musescore crashes every time.

Has anyone got any idea what this could be?
I have attached one of the files.


Comments

Well, yes, the error message is accurate. XML files are just plain text files, so if yo open one in a text editor, you can the problem for yourself on line 18. Actually, Chrome normally tries to display XML files nicely formatted, but it complains about this one, same line. The issue is, the "&" character is not legal in XMl files unless treated specially, and that's not the case here (in the "part-name" where is says "Piano & Solo Violin". Simply change that "&" to the word "and" - same for line 27 a little further down - and save. Then it opens fine.

Meanwhile, you should report this bug to Reaper 0- they apparently aren't handling "&" characters in part names correctly. To be fair, MuseScore once had the exact same problem, it's an easy mistake to make!

In reply to by Jojo-Schmitz

Thank you Marc for getting straight to the problem. I would never have got there myself, even if I had have thought to open the file in a text editor. Changing the “&” for “and” did the trick.

For 3 of the files the “&” was in the file name, but I didn’t understand why files without the “&” in the file name were causing the same problem. Then I realized when I opened these files that there was an “&” in a track name (e.g. “Violins 1 & 2”).

Poor Reaper got the blame, but the problem was actually in Cakewalk, not Reaper. Cakewalk wasn’t talking to Musescore very well so I purchased Reaper as a go between. I had to export MIDI files from Cakewalk to Reaper, then use Reaper to save them in MusicXML format for export to Musescore. I discovered that if an “&” was in Reaper and not in Cakewalk the .xml file was valid. It was only if the “&” was also in Cakewalk that the .xml file was not valid.

Regarding your comment, Jojo, yes good idea, even if the error message itself was altered to simply state: “a problem has occurred with the use of “&” in the .xml file name/project track name.”

I had a similar problem importing an Irish jig in ABC notation. It kept saying invalid music xml file. After reading the comments here, I changed the Gaelic title (which had several accented characters in it) to the plain English translation and then it imported fine. So it's not just ampersands that scramble it, but other characters as well. It does not like Gaelic!

Do you still have an unanswered question? Please log in first to post your question.