Where is there a definitive MusicXML validator?
This isn't really a feature request, but I keep getting tripped up by MusicXML files created by third-party apps (Sibelius, Finale, SharpEye, Neuratron) and indeed MusicXML files exported by MuseScore itself.
It would be great if someone who knows this field in detail could point us to a URL for a neutral MusicXML validator which can reliably validate MusicXML 1.0, 2.0 and 3.0. Is there such a service available?
Thanks!
Dan
Comments
It depends what you mean by "validator".
MusicXML 3.0 comes with a XSD schema. It defines the possible values of elements, which element can be added in other elements etc... MuseScore uses this schema to validate a MusicXML file when you open it. This schema is delivered by the MusicXML creators (see http://musicxml.org).
Once a MusicXML file is "valid" in term of schema validation, there is a second layer. A measure in 4/4 with a single quarter note, is that valid? Even when the schema validation says the file is OK, there could be many ways to encode a particular musical construction (for example a slur, or a full measure rest) and some software will export such a construction in a way, while others will do it another way. There is no validator for these behaviors and the MusicXML specification is fuzzy enough to make it impossible to create such a validator...
If you need more information about MusicXML, the best place is the MusicXML forum http://forums.makemusic.com/viewforum.php?f=12. Michael Good, the creator of MusicXML, will answer your questions there.
The instructions from http://web.archive.org/web/20210505231911/https://blog.karimratib.me/20… worked for me. I used the patch with the local files, changing the two lines each in
musicxml.xsd
andopus.xsd
to read[…] schemaLocation="xml.xsd"
and xlink.xsd respectively:It works as advertised:
Since I prefer xmlstarlet over xmllint, let’s do this:
With
xmlstarlet
the DOCTYPE is not ignored, so you have to pass the matching one (partwise.dtd
ortimewise.dtd
) instead of justmusicxml.dtd
; it says “Attempt to load network” but actually doesn’t.Enjoy!