image href - base64 string
Posted: Wed Sep 29, 2021 2:09 am
Hi,
I have a client using DITA with oXygen 23.1.
Their image tags looks like:
The actual image data is stored as blobs in a SQL database. I have a REST endpoint (xquery) exposed in eXist-db that makes a SQL fetch to the server and returns the blob data as a base64-encoded string. The returned string is prefixed with "data:image/jpeg;base64," followed by the actual base64 image string.
I've tried setting up the CSS like:
I've played around with the serialization parameters on the xquery side. Besides no serialization, I've tried:
Am I missing something? Is there a way for a DITA image to render in oXygen with the href attempting to display a base64 image string?
I have a client using DITA with oXygen 23.1.
Their image tags looks like:
Code: Select all
<image href="456"/>
I've tried setting up the CSS like:
Code: Select all
image {
content: oxy_url(oxy_concat("httpURLtoExistDB.../getImage.xqy?id=",attr(href))) !important;
}
Code: Select all
declare option exist:serialize "method=text media-type=image/jpeg";
...
(: tried with and without the data:image/jpeg;base64, prefix :)
(: return $imgDoc :)
return "data:image/jpeg;base64," || $imgDoc
Code: Select all
declare option exist:serialize "method=xhtml media-type=text/html";
...
let $src := "data:image/jpeg;base64," || $imgDoc
return <img src="{$src}"/>