using xsl 2.0, how would you convert an xs:float value to a hex-string representation of its binary value? i have no problem doing this for an integer (divide by 16 recursively and concatenate chars 0-9A-F), but float/double is stumping me.
<xsl:function name="my:float-to-hex" as="xs:string">
<xsl:param name="in" as="xs:float"/>
<xsl:sequence select="magic-here($in)"/>
</xsl:function>
a valid answer may be, "this is not possible," and that would be valuable to me if it were true. i'm open to other suggestions, but please don't depart from XSL. i am fully aware that there are more than one ways to skin this cat.
to clarify, the expected output would be the same as the output from this C code:
float f = 28.25f;
char *ptr = &f;
for(int i = 0; i < sizeof(float); i++) { printf("%02X", *(ptr + i)); }