Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MusicXML is not validated against schema anymore since Qt 6 #23726

Open
cbjeukendrup opened this issue Jul 22, 2024 · 4 comments
Open

MusicXML is not validated against schema anymore since Qt 6 #23726

cbjeukendrup opened this issue Jul 22, 2024 · 4 comments
Assignees
Labels
MusicXML P3 Priority: Low regression nightly Works correctly in the latest released version and is broken in the nightly builds

Comments

@cbjeukendrup
Copy link
Contributor

The MusicXML import code doesn't contain a lot of error handling, because before any reading is done, the XML file was validated against the MusicXML schema. That gave guarantee that the input is sane, so not much further error handling was necessary.

But in Qt 6, the XmlPatterns module, which contained the XML schema validator, was inexplicably removed. It is not immediately clear what to use as a replacement, as there are many XML libraries of differing sizes and qualities, and only few of them contain schema validation functionality. And extra work will be necessary to make these libraries fit into our code.

As a result, there is no validation at all, so insane MusicXML files will just be passed to the MusicXML importer which is not necessarily prepared for that.

To be clear, this issue does not affect valid MusicXML files in any way; it only affects how robust MuseScore is against invalid MusicXML files.

@cbjeukendrup cbjeukendrup added MusicXML regression nightly Works correctly in the latest released version and is broken in the nightly builds labels Jul 22, 2024
@jeetee
Copy link
Contributor

jeetee commented Jul 22, 2024

I had a coworker that fell back to https://xerces.apache.org/xerces-c/ early last year because of this when moving from Qt5 to Qt6. No idea on the complexity or ease of use of that library though.

EDIT: the project seems to lack maintenance though, so I've mentioned it more as a "look at it possibility" than a serious immediate solution. XERCESC-1800 seems a bit worrying, for example..

@igorkorsukov
Copy link
Contributor

I think we should solve this not by validating the schema, but by detecting errors and reporting them during the import of MusicXml files. Moreover, a valid schema does not mean that there are no errors, it only means that the file structure is as we expect (but for example, the content may be incorrect)

@Jojo-Schmitz
Copy link
Contributor

Schema validation does a good part of the error detection, but indeed not all. It still is usefull, and prevents is from having to reinvent the wheel, instead we'd just need to make it a bit rounder

@igorkorsukov
Copy link
Contributor

It just used to be out of the box, and it was easy to check the scheme. Not anymore. It's a difficult task now... so the question arises, what other options are there...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MusicXML P3 Priority: Low regression nightly Works correctly in the latest released version and is broken in the nightly builds
Projects
Status: Issues to fix
Development

No branches or pull requests

5 participants