In your XSL transforms, you can add logic dependent on string length as follows:
<xsl:choose>
<xsl:when test="string-length(@sec) >= 12">
<xsl:value-of select="substring(@sec,0,12)"/>...
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@sec"/>
</xsl:otherwise>
</xsl:choose>