- From: Benjamin W. Bohl <b.w.bohl@gmail.com>
- Date: Wed, 17 Apr 2024 15:56:05 +0200
- To: xproc-dev@w3.org
- Message-ID: <CAGWTMS25wwgfB50mQzVubn1PrAotzSh3rLrOSSVJra+d-kugqQ@mail.gmail.com>
Dear list:eners,
I'm still learning XProc and wanted to copy some image files from a
directory using pxf:copy in my pipeline running on xmlcalabash-1.5.7-120.
Nevertheless, I cannot make it work and always get a strange SaxonAPIError:
com.xmlcalabash.core.XProcException: XProc error err:XD0045
[…]
Caused by: net.sf.saxon.s9api.SaxonApiException: The string
"file:/Volumes/VCS/SVN/bazga-ed..." cannot be cast to a boolean
The string that throws the error is my target option for pxf:copy.
Here is the portion of the step from my pipeline:
<p:load name="load.again">
<p:with-option name="href" select="*replace*( *string-join*( (
*$dir.build.base*, *$edition.id <http://edition.id>*, *$edition.id
<http://edition.id>* || '.xml' ), '/' ), '//' , '/' )">
<p:pipe step="store" port="result"/>
</p:with-option>
</p:load>
<p:filter select="//*mei:manifestation*[*mei:classification*//*mei:term*
[*@corresp*='https://zimmermann-gesamtausgabe.de/manifestation-class/online'
]]/*mei:componentList*/*mei:manifestation*[*mei:classification*//*mei:term*/
*@corresp*='https://zimmermann-gesamtausgabe.de/edition-components/media']"
/>
<p:directory-list>
<p:with-option name="path" select="/*mei:manifestation*/*@target*"
/>
</p:directory-list>
<p:make-absolute-uris match="//*c:file*/*@name*" />
<p:group>
<p:for-each name="copy-media">
<p:iteration-source select="//*c:file*[*ends-with*(*@name*,
'.txt')]" />
<p:variable name="filename" select="*tokenize*(*c:file*/*@name*,
'/')[*last*()]" />
<p:variable name="target" select="*replace*( *string-join*( (
*$dir.build.base*, *$edition.id <http://edition.id>*, 'media', *$filename* )
, '/' ), '//' , '/' )" />
<pxf:copy>
<p:with-option name="href" select="/*c:file*/*@name*" >
<p:pipe port="current" step="copy-media"/>
</p:with-option>
<p:with-option name="target" select="*$target*">
<p:pipe port="current" step="copy-media"/>
</p:with-option>
</pxf:copy>
</p:for-each>
</p:group>
It seems to me that this might be connected to some variable conversion
that produces an error?
Any help appreciated ;-)
All the best wishes,
Benjamin
Received on Thursday, 18 April 2024 12:07:23 UTC