Validating or Compressing a MusicXML file
MusicXML Tasks validates any locally-stored MusicXML file against the MusicXML 4.0 schema. The MusicXML schema used for validation is included in the application, so the user only needs to have the MusicXML file available and enter its location in the tool.
MusicXML Tasks also compresses any XML file to a compressed file with a .mxl extension.
Validation and compression don't use the database, so no prior database setup is required for these operations.
validate box
MusicXML Validation
XML validation verifies that an XML document is well-formed (syntactically correct), and that the document conforms to the rules defined in the MusicXML schema.
Validation can be performed on both partwise and timewise MusicXML files.
Validation can be performed on compressed (.mxl) and uncompressed (.xml, .musicxml) files.
When validation is performed, the XML file is first read and then loaded as an XML document. The document is then validated using a SAX (Simple API for XML) parser.
The XML parser is included in the application, and validation error messages are those of the parser.
XML Validation on Windows
Validation uses the encoding indicated by the encoding attribute of the XML declaration, by default UTF-8.
In some cases, validation will fail when the encoding is given as UTF-8, and issue an error of this type:
Invalid byte 2 of 3-byte UTF-8 sequence
Usually, manually changing the encoding attribute value to ISO-8859-1 will result in a successful validation.
Validation Steps
To validate a MusicXML file: Validation output results will appear in the console area at the bottom of the tool.
Output examples
Successful validation:
validate success
Ill-formed XML document:
validate ill formed
Missing a required element:
validate missing element
Missing a required attribute:
validate missing attribute
Extraneous or misspelled element:
validate bad attribute
MusicXML Compression
Any .xml or .musicxml file can be compressed into a .mxl file.
The compressed file will contain the original XML file, and a META-INF/container.xml file that references the included XML file.
To compress an XML file: Compression output results will appear in the console area at the bottom of the tool.