Converts $string-var (a string) to a base64 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 base64Binary 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:base64Binary(xs:string $string-var) —> xs:base64Binary
Returns base 64 binary value of $string-var.
Note: I took this from the test cases, is there a better example?
Invoking base64Binary("AaaaAAAA") returns the base64 binary value of AaaaAAAA, as shown in the following example query:
<result>{xf:base64Binary("AaaaAAAA")}</result>
The preceding query generates the following result:
<result>AaaaAAAA</result>
W3C base64Binary data type description.