Cannot read file, bad format
When trying to open file, the following message appears: Cannot read file [/File name and location shown.mscz]: bad format.
Details of the error are: XML read error at line 32788 column 23
The file opened without problem the previous day, and the only changes made were to dynamics.
Mac 10.10.5
Musescore 2.0.2
Comments
As always, it is difficult to help without seeing the score - attach it via the "File attachments" link right below where you type your post.
In reply to As always, it is difficult to by Marc Sabatella
Thanks Marc. File attached.
In reply to Thanks Marc. File attached. by KenS
The problem is a piece of text that reads "Oboe & Organ". There were a handful of bugs that could cause the "&" character in text to create corrupt files like this some times. I think all known cases have been fixed in current nightly builds, but if you can think of anything unusual about how you might have created or edited this bit of text, that would help. It would be good to see if the specific bug that you triggered is one of those that has been fixed.
Meanwhile, I have attached a fixed version of your file.
In reply to The problem is a piece of by Marc Sabatella
Thank you for the speedy help. I don't even know where the text came from, because I have checked a slightly older version of the score and that piece of text does not appear. However, I have previously used ampersands, so I shall steer clear of those in future. I thought the problem may have been something to do with some stray dynamics. When editing the score, I found a few duplicated dynamics markings that I could not highlight to delete, so I suspected it may have been those. Anyway, thanks again.
In reply to Thank you for the speedy by KenS
You're welcome! For the record, ampersands *should* be fine, there are just a few specific situations where they have caused problems, and we fix them as they are reported. Perhaps you were seeing #81501: Copy-and-paste text from external program results in loss of characters after "&" symbol or #72051: Reset text to style causes html escaped sequences to disappear. Both are fixed in current development builds and thus should be fixed for the next release.
I wonder if you could help again, please, same issue. Another file from the same work will not open. Apart from changes to dynamics markings, I noticed that some staff text was in a larger font, so I used the Inspector to reset the style of all similar text. I have checked all twelve movements from this work and this is the only remaining one at this stage that will not open. The message is: XML read error at line 56085 column 23.
File attached. Thanks.
In reply to I wonder if you could help by KenS
Interestingly the latest nightly build can't read it either. Andway, it again is a matter of an & , this time in a staff text (measure 82, "Oboe & Flute", twice)
Fixed score attached
General recipe to fix: save as mscx, open with a plain text Editor, go to the line and column MuseScore complained about and remove the offending character or replace be e.g. +. Then open the score in MuseScore and replace it by an & again
In reply to Interestingly the latest by Jojo-Schmitz
Or instead of removing the "&", replace it with "&" which is what was supoosed to have happend in the first place.
The bug reset to style is one of the know cases I mentioned above. It is fixed in current buikds, but fixed means, current builds won't *create* corrupt files like this any more. Already corrupted files still won't be able to open. I suspect that would be harder to fix since the score is no longer valid XML syntax.
Hi experts,
I've tracked a similar issue with the latest version: Replaced the style of the composer text. The text after "&" vanished and the file is not readable any more. Can you resore the enclosed version, please?
Thank you for your help and great software!
Christian
In reply to Hi experts, I've tracked a by ChristianADT
here we go
Actuall quite easy to fix, open the mscz with WinZip or 7zip, extract the mscx inside, take a plaintext Editor, search for "&" and replace with "&".
You can now move the mscx back into the mssz and open that, or upen the mscx and save as mscz (this would lose any embeded Images though)
In reply to here we go Actuall quite easy by Jojo-Schmitz
i got the same issue, please how to fix this thankss
XML read error at line 12, column 1:
In reply to i got the same issue, please… by natashastpr
See #304629: mari cegah corona
In reply to Hi experts, I've tracked a by ChristianADT
And to be clear: the bug still exists in the most recent *released* version, but is fixed in the current "development" versions (eg, the nightly builds) and should appear in the next release whenever that is.
I just got this bug now. MuseScore 2.0.3, I'd been editing a file yesterday, all ok then. When I came to open it today it gave this error and a line:col
Thank goodness for that is all I can say since it allowed me to fix the problem. I was able to rename the mscz file to a .zip file, open it, extract the mscx file from it, open that in visual studio, go to the line and column and fix the XML problem by hand.
The problem was a text item that had an unescaped ampersand (&) in it.
I'm fairly certain I didn't touch this text item for weeks, during which time the project had been saved many times.
There were other text items that properly escaped the &
So I'm not sure how this one got through, but at least I was able to recover from it. Maybe the parser on read could be a little more lenient, and finding an & followed by a space means unescaped &. XML sucks anyway IMO, it failed escaping 101 (it can't even escape CDATA end markers in CDATA content, and don't get me started about semantics of whitespace in values) so it's a broken format from the design. Maybe should use JSON instead.
In reply to I just got this bug now. by Adrien de Croy
Several issues with & have been fixed in 2.1
In reply to Several issues with & have by Jojo-Schmitz
when is 2.1 expected do you know? I'm presuming it isn't as dangerous an update as 3?
In reply to when is 2.1 expected do you by Adrien de Croy
The 2.1 nightly builds are pretty stable.
And don't get it wrong, with that this errors are no longer caused, but broken files from 2.0 will still be broken
In reply to The 2.1 nightly builds are by Jojo-Schmitz
sure. apart from being based on XML :)
thanks. trying it now. Still getting a weird error with brackets... I try to put one across 2 staves, and it flips it to the 3rd in my score as well which I don't want.... sigh.
In reply to sure. apart from being based by Adrien de Croy
I figured out a workaround for this.
Move the 2 staves I want to group to the bottom (by editing instruments), then I could add the bracket and there was no lower stave for it to snap onto.
Then I moved the instruments/staves back up again.
In reply to sure. apart from being based by Adrien de Croy
Can you produce a score that will show the problem so developers can fix ti?
In reply to Can you produce a score that by mike320
I've only seen it happen once, and I fixed the file already... if it happens again I'll let you know.
Same problem, but I can't seem to open it in a text editor. Can anyone help? And please walk me through the steps if this happens again? I have a mac
In reply to Same problem, but I can't… by JIP14
The file that you attached is an MSCZ file that has been renamed to give it a different extension. That is not what is meant by "save it as MSCX". But no matter. An MSCZ file is a valid ZIP archive, so it can be renamed with a .zip extension and extracted with a double-click. The extracted MSCX file is what you want to edit with a text editor.
It is also possible to extract the MSCX without renaming the file, using the unzip command.
I went ahead and corrected your score for you, and I have attached it to this post.
Please help me with this file. I don't know what wrong with this: XML read error at line 130, column 67: font
In reply to Please help me with this… by minhnhanbin
Here you go. Culprit was, again, a font name that contains an &
That issue should have been fixed ages ago (since 2.1), see #119041: Font name containing a ampersand will corrupt file, so not sure how it could have happened again?!?
The score seems to stem from an mxl (Compressed MusicXML) import, do you happen to have that file and can share it? Well possible there's a MusicXML bug in regards to ampersands in font names.
In reply to Here you go. Culprit was a… by Jojo-Schmitz
I found that the font of title has an "&" character so I changed it to another font and saved it and opened it successfully ( Sheet 1). But then I added 2 new staves and saved it, but when opened it (Sheet2), I got an error: XML read error at line 141, column 28: font
In reply to I found that the font of… by minhnhanbin
Sure enough the same issue, fixed in the attached
In reply to Sure enough the same issue,… by Jojo-Schmitz
How can I fix it myself, Sir?
In reply to How can I fix it myself, Sir? by minhnhanbin
It is described further up. Extract the mscx from the mscz like by using 7Zip, open the mscx with a text editor, go to the line MuseScore complains about and replace the & with an &