この変換:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="x">
<xsl:variable name="vIntPart" select="floor(.)"/>
<xsl:variable name="vFractPart" select=". - $vIntPart"/>
<xsl:value-of select="concat(substring($vIntPart, 1,8),
'.',
substring($vFractPart*10000, 1,4)
)"/>
</xsl:template>
</xsl:stylesheet>
次の XML ドキュメントに適用した場合:
<t>
<x>1234567890.9876543</x>
<x>1234567890</x>
<x>.9876543</x>
</t>
必要な正しい結果が生成されます。
12345678.9876
12345678.0
0.9876