http://onionworks.net/2006/imageservice

createWorkspace (target : xlink) : nodeset

This method enables the creation of a workspace on the basis of existing picture data or via a space indication. Picture data can be loaded either directly via the data source (default) or via a binary method.

In the example, a picture is now read from a data source. The parameter “fromDataSource” does not have to be set since this is set to the value “true()”by default.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ise="http://onionworks.net/2006/imageservice/encoders" xmlns:is="http://onionworks.net/2006/imageservice" xmlns:b="http://onionworks.net/2004/renderengine/binary" xmlns:onion="http://onionworks.net/2004/data" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" indent="no" />
<xsl:template match="/resource">
<xsl:variable name="workspace" select="is:createWorkspace(@src)" />
<xsl:variable name="doWrite" select="is:writeWorkspace($workspace, ise:createGifEncoder())" />
<b:output mimeType="image/gif">
<b:webResponse expires="60" />
</b:output>
</xsl:template>
</xsl:stylesheet>
Creating workspace

This example creates a workspace from the picture data of a resource and then writes it into the output stream in picture format Gif.

Moreover, the variable “workspace” now contains the following XML.

<workspace>
<image width="320" colorDepth="32" pixelFormat="Pixel32bppBgra" height="240">
<resolution x="96" y="96" units="DotsPerInch" />
</image>
</workspace>