[Home] [By Thread] [By Date] [Recent Entries]
Michael Kay wrote:
Something like this perhaps:
<xsl:function name="my:int-to-hex" as="xs:string">
<xsl:param name="in" as="xs:integer"/>
<xsl:sequence
select="if ($in eq 0)
then '0'
else
concat(if ($in gt 16)
then my:int-to-hex($in idiv 16)
else '',
substring('0123456789ABCDEF',
($in mod 16) + 1, 1))"/>
</xsl:function>But what's wrong with having two functions anyway?
Incidentally, do try to get into the habit of declaring your parameter and return types. It helps people reading your code, it helps the compiler, and it helps you.
Yves
|

Cart



