[MusicXML] Score exported to XML doesn't import back cleanly

• Jan 3, 2019 - 12:57
Reported version
3.0
Priority
P2 - Medium
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
No
Workaround
Yes
Project

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.


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.

Just checked, the QXmlSchemaValidator simply returns only the first error it encounters. I cannot find any setting that changes this behaviour.