[MusicXML] Score exported to XML doesn't import back cleanly
Exporting the attached score to musicxml (in 2.3.2, as that score crashes in 3.0, see #281130: Crash of MuseScore 3 on opening a certain 2.x score) and importing that in 3.0 or 2.32. (so no regression) gives an error:
in 2.3.2:
Fatal error: line 5144 column 20 Element figured-bass is missing child element.
in 3.0 it is even (partly) translated, no idea where the translation comes from?
Fatal error: line 5144 column 20 Beim Element figured-bass fehlt ein Unterelement.
Ignoring that and the score loads (so workaround)
The culprit XML code:
<figured-bass> </figured-bass>
Stange enough the same constructs in lines 5179, 5240, 9403, 12792, 13018, and 39816 go unnoticed.
It complains about those though once the previous got fixed (removed), I'd rather prefer to see all validation errors in one go.
Attachment | Size |
---|---|
Three_Pieces_for_String_Quartet.mscz | 67.81 KB |
Three_Pieces_for_String_Quartet.musicxml | 1.26 MB |
Comments
Looking at the code writing the figured-bass element (FiguredBass::writeMusicXML()), it seems possible for it to incorrectly write an empty element. This is trivial to prevent. I haven't found the root cause yet, though.
XML validation is handled by Qt, all error messages generated are shown. No idea why error messages are translated now. As far as I know, nothing changed in the MusicXML importer. The validation error messages are passed unchanged to the dialog but in function ValidatorMessageHandler::handleMessage() they are prefixed with an untranslated "Fatal error: line xx column yy". This is a minor error in the importer.
OK, I really like the translated message, and don't care too much where it comes from ;-) was just curious. Esp. as it is different between 2.3.2 and 3.0, run at the same time.
But lets fix the untranslated part inside musescore, guess I'll add it to https://github.com/musescore/MuseScore/pull/4492
Still unresolved: it reports only the 1st error, why?
Just checked, the QXmlSchemaValidator simply returns only the first error it encounters. I cannot find any setting that changes this behaviour.
In reply to Just checked, the… by Leon Vinken
Pity. But looking at the docs I now know where the translation comes from: straight from Qt, from files we copy meanwhile, but didn't in 2.x