I need to convert a hexadecimal value to an integer value, how can I do that using XSLT?
For example, if the input is hexadecimal FF
, my output should b
Edit: Sorry, my bad I just noted the OP asked for hex to decimal and not the other way around.
hexToDecimal template for XSLT-1.0:
0
This needs math:power
from exslt http://exslt.org/math/
hexToDecimal function for XSLT-2.0:
Provided value is not hexadecimal...
Leaving this here, also it was not asked for, it might still be useful.
There is no directly implemented function in xslt, so you would have to write it yourself.
Here's a template for XSLT 1.0:
You call it like this:
4095
And a function for XSLT 2.0:
Which you can call like this:
Be aware that you have to declare the namespace for the function in you stylesheet.