Listing 1

yyyy/mm/dd

<xsl:sort order="ascending" select=
"substring(text(), 1,4)" />
<xsl:sort order="ascending" select=
"substring(text(), 6,2)" /> <xsl:sort order="ascending" select=
"substring(text(), 9,2)" />
dd/mm/yyyy
<xsl:sort order="ascending" select=
"substring(text(), 7,4)" />
<xsl:sort order="ascending" select=
"substring(text(), 4,2)" />
<xsl:sort order="ascending" select=
"substring(text(), 1,2)" />
hh:mm:ss
<xsl:sort order="ascending" select=
"substring(text(), 1,2)" />
<xsl:sort order="ascending" select=
"substring(text(), 4,2)" />
<xsl:sort order="ascending" select=
"substring(text(), 7,2)" />

Listing 2

<xsl:template match="/">
<xsl:for-each select="*">
<xsl:variable name="allContents" select="."/>

<!--In this template, I load the file into a variable so that it can be handled as a large string. Using the string functions like sub string, it is easy to parse given the start positions and lengths of the elements -->

<xsl:element name="customers">
<xsl:call-template name=
"SplitFixedLengthToXML">
<xsl:with-param name="strInput" select=
"$allContents"/>
<xsl:with-param name=
"lineLength" select="72"/>
</xsl:call-template>
</xsl:element>
</xsl:for-each>
</xsl:template>