W3C home > Mailing lists > Public > xproc-dev@w3.org > February 2013

RE: Problems when copying files

From: Geert Josten <geert.josten@dayon.nl>
Date: Tue, 26 Feb 2013 13:02:57 +0100
Message-ID: <69b56918d04d016bb04ed02e049fa43c@mail.gmail.com>
To: Jostein Austvik Jacobsen <josteinaj@gmail.com>, George Cristian Bina <george@oxygenxml.com>
Cc: xproc-dev@w3.org
Sounds somewhat related to the ‘Multiple XSLT transformations with
intermediate files’ thread..


*Van:* Jostein Austvik Jacobsen [mailto:josteinaj@gmail.com]
*Verzonden:* dinsdag 26 februari 2013 9:58
*Aan:* George Cristian Bina
*CC:* xproc-dev@w3.org
*Onderwerp:* Re: Problems when copying files

It doesn't seem like the spec specifies whether an implementation should
creating any missing parent directories[1] so I don't know what is to be
expected. Maybe something like <p:store mkdirs="true|false" .../> could be

Since there's no "top-to-bottom" execution order in XProc, you're not
guaranteed that the copy operation from xml/ to xml1/ is completed before
the copy operation from xml1/ to xml2/.

AFAIK there's no multi-threading in calabash yet so the execution order for
a script when running it through calabash is the same every time if you run
it, and usually it executes bottom to top (it seems). So in your script,
all files from xml1/ will be copied to xml2/ *before* the files in xml/ is
copied to xml1/, which means there will be no files copied from xml1/ to
xml2/ at first run.

To make sure that you only load a file *after* the file is stored, you can
force a dependency between two steps by connecting it to a port or option
on the step that has a dependency:

<p:store href="test.xml" name="store1"/>


    <p:with-option name="href" select="'test.xml'">

        <p:pipe step="store1" port="result"/>



Calabash also has the cx:depends-on="step-name" attribute to simplify

<p:store href="test.xml" name="store1"/>

<p:load href="test.xml" cx:depends-on="store1"/>

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


On 26 February 2013 08:59, George Cristian Bina <george@oxygenxml.com>

Hi all,

Any feedback on the issue below?

Best Regards,
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

On 2/15/13 11:45 AM, George Cristian Bina wrote:


We obtain some strange results with the following script with Calabash
1.0.8 (I think I encountered this also on previous versions).

We have the following structure:


See the files content below [1].

The test.xpl script should load the files from the xml folder and then
store them in a folder called xml1, then load the files from the folder
xml1 and store them in a folder xml2.

Trying to run the script gives the following error:
Scenario: test
XProc file: /Users/george/Documents/test/xproc_samples/test.xpl
Engine name: Calabash XProc
Severity: error
Description: err:XC0017 : XC0017 It is a dynamic error if the absolute
path does not identify a directory.

I then created an xml1 folder so we have now the following structure


First run does not give any error but the result structure is


That is the file was copied to xml1 but no copy from xml1 to xml2 took
Running again the script with the new structure gives the desired result


Is this the expected behavior?

[1] sample files


<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
name="sampleCopyTest" version="1.0"

   <p:input port="source" sequence="true"/>
   <p:output port="result" sequence="true">

   <p:variable name="input" select="'xml/'"/>
   <p:variable name="out1" select="'xml1/'"/>
   <p:variable name="out2" select="'xml2/'"/>

     <p:with-option name="path" select="$input"/>

     <p:iteration-source select="/c:directory/c:file"/>
     <p:variable name="filename" select="/c:file/@name"/>
     <p:variable name="result" select="concat($out1, $filename)"/>

       <p:with-option name="href" select="concat($input, $filename)"/>
     <p:store omit-xml-declaration="false">
       <p:with-option name="href" select="$result"/>


     <p:with-option name="path" select="$out1"/>

     <p:iteration-source select="/c:directory/c:file"/>
     <p:variable name="filename" select="/c:file/@name"/>
     <p:variable name="result" select="concat($out2, $filename)"/>
       <p:with-option name="href" select="concat($out1, $filename)"/>
     <p:store omit-xml-declaration="false">
       <p:with-option name="href" select="$result"/>

Received on Tuesday, 26 February 2013 12:03:26 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:10 UTC