MusicXML fault in 2.0.3
'number="0"' is invalid in direction-type wedge:
<direction placement="below">
<direction-type>
<wedge type="crescendo" number="0"/>
</direction-type>
<staff>1</staff>
</direction>
I suggest you write the MusicXML using a validating serialiser, or you test using a validating parser.
You can also use SeeScore to test as that uses a validating parser
Attachment | Size |
---|---|
BoLaMuSiDDaDiaoXiaoTiQinXieZouQuDiErYueZhang_BoLaMuSiDDaDiaoXiaoTiQinXieZouQu.mxl | 41.95 KB |
Comments
Thank for you suggestion. MuseScore already use a validator on import, but there is no reason to make one on export except for testing: what we would do if the file isn't valid?
Do you have the mscz file?
In reply to Thank for you suggestion. by [DELETED] 5
Hi Lasconic,
Thank you for the prompt reply.
>Thank for you suggestion. MuseScore already use a validator on import, but
>there is no reason to make one on export except for testing: what we would do
>if the file isn't valid?
You would fail to write the file, and produce an error report identifying the exact problem, which in my world is better than writing a bad file. Perhaps that is a contentious view but it would certainly save me a lot of time trying to debug this sort of error!
SeeScore uses a validating parser so this file is completely useless. Also MuseScore has a problem reading it I think - certainly if it uses a validating parser.
I have asked the person who sent me the xml file to send the mscx. I'll let you have it ASAP.
best regards
James Sutton
In reply to Thank for you suggestion. by [DELETED] 5
Here are the files which produced the bad XML (see both bug reports)
Thanks for your help
James Sutton
In reply to Here are the files which by jsutton
Opening the 1st file, export as XML and import again gives:
Fatal error: line 29541 column 46 Content of attribute number does not match its type definition: 0 is not valid according to xs:positiveInteger..
(yes, with 2 dots at the end!) and this is indeed the line "<wedge type="crescendo" number="0"/>"
Sames step for the 2nd files gives:
Fatal error: line 56145 column 27 Element time-modification is not defined in this scope.
Seems it doesn't like it twice in a row?
Same steps for the 3rd file gives:
Fatal error: line 68478 column 46 Content of attribute number does not match its type definition: 0 is not valid according to xs:positiveInteger..
Same issue as with the 1st file
Of course, MuseScore should not produce invalid MusicXML, but this does not happen too often. I am not convinced migrating to a validating parser would bring enough benefits to justify the effort. With the exception of libmusicxml (which I do not know well), I am not aware of any available open source solution.
In reply to Of course, MuseScore should by Leon Vinken
Well, MuseScore could simply (pretend to) reimport the exported XML and use the existing validator, which does seem to detect the problems at hand here.
But yes, these should be rare cases, and probably not worth the extra time and work such a validation takes
In reply to Of course, MuseScore should by Leon Vinken
Found the cause of the 'number="0"': incomplete error handling in function ExportMusicXml::hairpin().
Created issue #125881: [MusicXML Export] invalid MusicXML when too many overlapping hairpins are present
In reply to Created issue #125881: by Leon Vinken
Also created issue #136446: [MusicXML Export] missing wedge stop