Re: Xproc3 struggling to update ZIPs

Hi Colin,
Looks like a bug to me. Would you mind to use my ticket system, so I can keep track.
Thank you,
Achim

------------------------------------------------
Achim Berndzen
achim.berndzen@xml-project.com

<xml-project /> Achim Berndzen
Kleine Breite 26a
38302 Wolfenb├╝ttel, Germany

http://www.xml-project.com

> Am 27.05.2020 um 16:18 schrieb Colin Mackenzie <colin@mackenziesolutions.co.uk>:
> 
> Hi
> 
> I have been trying to find the best way in Xproc3 to take a .docx file, process only a couple of the content files then save to a new ZIP containing the unchanged plus updated files..
> I am trying to avoid having to load or process files in the ZIP that I do not need to update.
> 
> I have got stuck at the point I update the ZIP.
> I have tried various approaches, created a small test case to simply add a file to an archive (below) and changed the .docx to a windows created Zip or Zip created by other applications but no matter what I try I get the following message
> 
> =================================
> MorganaXProc-IIIse 0.9.2.5-beta
> Copyright 2011-2020 by <xml-project /> Achim Berndzen
> =================================
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <c:errors xmlns:c="http://www.w3.org/ns/xproc-step <http://www.w3.org/ns/xproc-step>"><c:error code="err:XC0085" name="saveZIP" type="p:archive" href="file:///C:/Users/colin/Documents/newco/wordXproc3Automate/testzip.xpl" line="11" column="31" xmlns:p="http://www.w3.org/ns/xproc <http://www.w3.org/ns/xproc>" xmlns:err="http://www.w3.org/ns/xproc-error <http://www.w3.org/ns/xproc-error>"><message>Error processing ZIP archive: invalid entry compressed size (expected 3537 but got 3304 bytes)</message></c:error></c:errors>
> 
> When I look inside the ZIP or check the zip-manifest then the compressed file size for the first file in the ZIP is  3537 bytes.
> 
> Is this a bug or am I doing something wrong?
> 
> The Xproc is 
> 
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc <http://www.w3.org/ns/xproc>" xmlns:c="http://www.w3.org/ns/xproc-step <http://www.w3.org/ns/xproc-step>" 
>     xmlns:cm="http://macksol.co.uk <http://macksol.co.uk/>"  xmlns:xs="http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema>"
>     version="3.0" name="autoDocX" type="cm:autoDocX">
>     
>     <p:input port="source" sequence="true"/>
>     <p:output port="result" primary="true" sequence="true" />
>     
>     <p:load name="fileToAdd" href="manifestShell.xml"/>
>     
>     <p:archive name="saveZIP">
>        <p:with-input port="manifest" pipe="@fileToAdd"/>
>        <p:with-input port="archive" href="fileTest.zip"/>
>     </p:archive>
>     <p:store name="storeZIP" href="fileTestOut.zip"/>
>     
> </p:declare-step>
> 
> The manifest file loaded @fileToAdd  that points to the file to be added is
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <c:archive xmlns:c="http://www.w3.org/ns/xproc-step <http://www.w3.org/ns/xproc-step>">
>     <c:entry name="logic.xml" href="logic.xml"/>
> </c:archive>
> 
> Thanks
> 
> Colin
> 

Received on Wednesday, 27 May 2020 14:39:21 UTC