Skip to content

Instantly share code, notes, and snippets.

@jmakeig
Created June 5, 2011 08:39
Show Gist options
  • Save jmakeig/1008795 to your computer and use it in GitHub Desktop.
Save jmakeig/1008795 to your computer and use it in GitHub Desktop.
Data URL from a binary document in MarkLogic
xquery version "1.0-ml";
let $img := doc("/binaries/12250.png")
let $ct := xdmp:uri-content-type(xdmp:node-uri($img/node()))
return <img src="{concat('data:', $ct, ';', 'base64,', xs:base64Binary($img/node()))}"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment