Re: cx:unzip with content-type="image/png"

Note 3: I did not succeed to get any output on the result port from
p:store, whether or not I specify the cx:decode attribute:
   The output of this step is a document containing a single c:result
element whose
   content is the absolute URI of the document stored by the step. [4]
Also, when I add <p:output port="result" primary="false"/> to the step I get
"err:XS0044:A p:store step must contain only a signature. p:output not allowed."

As before, any thoughts and pointers to documentation are appreciated.

Regards,
Manfred

[4] http://www.w3.org/TR/xproc/#c.store

On 20/06/2010, Manfred Staudinger <manfred.staudinger@gmail.com> wrote:
> I'm using Calabash 0.9.21. When I use cx:unzip to extract thumbnail
> pictures with a content-type of "image/png" from a dwfx file (autocad)
> like:
> <p:for-each>
>    <p:iteration-source select="//dwf:Resource[@role='thumbnail']"/>
>    <p:variable name="nextdoc" select="substring(*/@href, 2)"/>
>    <p:variable name="img" select="concat('/img_',
> p:iteration-position(), '.png')"/>
>    <cx:unzip content-type="image/png">
>       <p:with-option name="href" select="$package"/>
>       <p:with-option name="file" select="$nextdoc"/>
>    </cx:unzip>
>    <p:store cx:decode="true">
>       <p:with-option name="href" select="concat($path, $img)"/>
>    </p:store>
> </p:for-each>
>
> The cx:unzip works according to its spec:
>    If the content-type specified is not an XML content type, the file is
> base64
>    encoded and returned in a single c:data element. [1]
> Note 1: the c:data wrapper does _not_ contain an encoding attribute
> nor is the need for it explicitly mentioned in the spec. But the XProc
> specification clearly states:
>    If the content was base64-encoded, the wrapper must have an encoding
>    attribute which specifies “base64”. [2]
> Note 2: The p:store with cx:decode="true" does not store the binary,
> but the unchanged output from the cx:unzip. But when I insert an
>    <p:add-attribute match="c:data" attribute-name="encoding"
>    attribute-value="base64"/>
> just before the p:store then the input is decoded as expected. The
> only documentation I found for the cx:decode extension attribute
>    If cx:decode=true and the input document is base64 encoded, decode it
> and
>    store the binary result. [3]
> does not show its dependence on the encoding attribute.
>
> Any thoughts and pointers to documentation are appreciated.
>
> Regards,
> Manfred
>
> [1] http://exproc.org/proposed/steps/other.html
> [2] http://www.w3.org/TR/xproc/#p.data
> [3] http://lists.w3.org/Archives/Public/xproc-dev/2009Oct/0006.html
>

Received on Tuesday, 22 June 2010 14:06:51 UTC