http://onionworks.net/2006/imageservice

applyCommand (workspaceOrImage : nodeset, imageCommand : nodeset) : void

With this method it is possible to execute commands for changing the picture information or form. You will find a list of possible commands on your imageserver under port 8082 (e.g.: http://ihrImageserver.de:8082). Possible transfer types of the parameter “workspaceOrImage” are a workspace created with “createWorkspace” or an image object created with “createImage”. The commands executed with the “create” method of the commands library are to be transferred to the parameter “imageCommand”.

In the following example, the syntax of the method is illustrated.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ise="http://onionworks.net/2006/imageservice/encoders" xmlns:isc="http://onionworks.net/2006/imageservice/commands" xmlns:iscan="http://onionworks.net/2006/imageservice/canvas" 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="resample" select="is:applyCommand($workspace,isc:create('resample',is:createSize(100,100)))" />
<xsl:variable name="doWrite" select="is:writeWorkspace($workspace, 'Jpeg')" />
<b:output mimeType="image/jpeg">
<b:webResponse expires="60" />
</b:output>
</xsl:template>
</xsl:stylesheet>
Changing the picture size

In this example, a picture loaded from the data source is reduced to the size 100 x 100 and then written into the output stream in JPEG picture format.