Read Binary Data Example

In this example, an Xml document is queried for a Binary (base64 encoded) node, the resulting JPEG imageĀ is then directly outputedĀ as the page result.

Smartsite SXML CopyCode image Copy Code
<se:xmlprocessor xml="{itemdata.field(xml, 1343)}">
    <se:parameters>
        <se:parameter name="namespaces">
            <se:collection>
                <se:member prefix="se">http://smartsite.nl/namespaces/sxml/1.0</se:member>
            </se:collection>
        </se:parameter>
        <se:parameter name="actions">
            <se:collection>
                <se:member query="/root/site/page/binarydata" type="singlenode">
                    {page.setforcedresult(datatable.getbytes(this.extractbinary()), 'image/jpeg', true)}
                </se:member>
            </se:collection>
        </se:parameter>
    </se:parameters>
</se:xmlprocessor>
Example Result CopyCode image Copy Code
(JPEG image)