Converts $string-var (a string) to a hex-encoded arbitrary binary data.
If the value of $string-var is the empty sequence, the following error is displayed in the mapper:
Error occured while executing XQuery: Error loading the XQuery or XSLT for this method: Type error in function hexBinary invocation: expected type [string@http://www.w3.org/2001/XMLSchema], given type empty
The empty sequence is a sequence containing zero items (), which is similar to null in SQL.
xf:hexBinary(xs:string $string-var) —> xs:hexBinary
Represents the string to be converted to a hex-encoded number. |
The base 64 binary value of $string-var.
Invoking hexBinary("0FD7") returns the hex-encoded binary value of 0FD7, as shown in the following example query:
<result>{xf:hexBinary("0FD7")}</result>
The preceding query generates the following result:
<result>0FD7</result>
Note: The hex-encoded binary value of 0FD7 is equivalent to the decimal value of 4055 and the binary value of 111111010111.
W3C hexBinary data type description.