- All Modules
- All Functions
-
www.w3.org
- 2005
- XDM
- store
- introspection
- reflection
- external
-
xqdoc
-
project_xqdoc
-
xqdoc
(E)
- xqdoc2xhtml
-
project_xqdoc
- data processing
- expath.org
- www.functx.com
- debugger
- error
- www.zorba-xquery.com
http://www.zorba-xquery.com/modules/converters/base64
Module Description
Before using any of the functions below please remember to import the module namespace:
import module namespace base64 = "http://www.zorba-xquery.com/modules/converters/base64";
Base64 encoding and decoding
Author:
Matthias Brantner
XQuery version and encoding for this module:
xquery version "1.0" encoding "utf-8";
Zorba version for this module:
The latest version of this module is 2.0. For more information about module versioning in Zorba please check out this resource.
Module Resources
- the XQuery module can be found here.
Namespaces
base64 | http://www.zorba-xquery.com/modules/converters/base64 |
ver | http://www.zorba-xquery.com/options/versioning |
zerr | http://www.zorba-xquery.com/errors |
Function Summary
![]() |
decode
(
$base64 as xs:base64Binary
) as xs:string external Decode a xs:base64Binary. |
![]() |
decode
(
$base64 as xs:base64Binary,
$encoding as xs:string
) as xs:string external Decode a xs:base64Binary. |
![]() |
encode
(
$string as xs:string
) as xs:base64Binary external Encode a xs:string as xs:base64Binary. |
Functions
declare function base64:decode (
$base64 as xs:base64Binary
) as xs:string external
Decode a xs:base64Binary. The function assumes that the content after decoding is valid UTF-8.
Parameters:
- $base64 The xs:base64Binary item to decode
Returns:
- the base64 decoded value as string
declare function base64:decode ( $base64 as xs:base64Binary, $encoding as xs:string ) as xs:string external
Decode a xs:base64Binary. The function assumes that the content after decoding has the given encoding.
Parameters:
- $base64 The xs:base64Binary item to decode
- $encoding The encoding of the string after base64 decoding it.
Returns:
- the base64 decoded value as string
Errors:
- zerr:ZXQP0006 if the given encoding is invalid or not supported.
declare function base64:encode (
$string as xs:string
) as xs:base64Binary external
Encode a xs:string as xs:base64Binary.
Parameters:
- $string The item whose string-value should be encoded
Returns:
- the base64 encoded string-value of the item parameter