SmartMusic Finale Garritan MusicXML

MIDI XML Sorting

<?xml version="1.0" encoding="UTF-8"?>

    MIDI XML midixml.xsl for sorting MIDI files with
    absolute timestamps.

    Version 3.0
    Copyright © 2004-2011 MakeMusic, Inc.
    This MusicXML™ work is being provided by the copyright
    holder under the MusicXML Public License Version 3.0,
    available from:

    XSL Stylesheet for sorting MIDI XML by absolute timestamp.


    The identity transformation. Used for everything aside
    from the track element.

  <xsl:template match="text()">
    <xsl:value-of select="." />
  <xsl:template match="*|@*|comment()|processing-instruction()">

    When we get to a Track, sort all events within the track
    by their Absolute timestamp.

  <xsl:template match="Track">
    <xsl:element name="Track">
        <xsl:sort data-type="number" select="Absolute" />