From 4f89dd5fc17a31931e3bb22cc4a829a84973d25c Mon Sep 17 00:00:00 2001 From: apb Date: Mon, 13 Dec 2021 11:30:01 +0000 Subject: [PATCH] [fix] replace() -> fn:replace, simplify around #1445 include[@outputformat='print']) --- content-psrv.xqm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/content-psrv.xqm b/content-psrv.xqm index e6c8f4d..300de7a 100644 --- a/content-psrv.xqm +++ b/content-psrv.xqm @@ -119,7 +119,7 @@ declare %updating function copsrv:upload-zip( return archive:extract-to($extractTo, $archive, archive:entries($archive)[fn:contains(.,fn:replace($x,'.xml','.docx'))]) else ( - archive:extract-to($extractTo, $archive, archive:entries($archive)[fn:contains(.,replace($cid, '[^0-9]', ''))]) + archive:extract-to($extractTo, $archive, archive:entries($archive)[fn:contains(.,fn:replace($cid, '[^0-9]', ''))]) ) , let $stepChunk := @@ -1437,12 +1437,10 @@ catch * {(: transformation error :) return if($headerXML/*:book/*:include[@outputformat='print']) then - let $delete-element := %updating function($headerXML) - { - delete node $headerXML//*:include[@outputformat='print'] - } + let $out :=$headerXML transform with {delete node //*:include[@outputformat='print']} + return - file:write(concat($tempFilePath,$cpsrv:bloomsburydbk,$cpsrv:HeaderXml),$headerXML update (updating $delete-element(.) )) + file:write(concat($tempFilePath,$cpsrv:bloomsburydbk,$cpsrv:HeaderXml),$out) else() else() else()