BTW: I was pleasantly surprised to discover that when I made a BaseX database 
with an ePub zip file, and 
selected the appropriate options ( Parse files in archives, add other files as 
raw files ) 
I was able to serve and view the ePub files thru the rest interface, and links 
from the TOC to other document parts,
as well  as images in the ePUB all worked. 

I’m also enjoying learning to use some of the higher order function 
capabilities of XQuery 3.1 . 

The arrow syntax and the partial function application seem to be a great way to 
build a pipelines of transforms
that can mix  xslt:transform with XQuery functions . 


The results here aren’t very useful — I was just learning and testing the 
syntax, but this uses the  partial application ‘?’ 
Syntax to convert functions of N-args to functions of 1 arg, and build a list 
of 1-arg functions to feed to fold-left. 
The use case would be to create a map of lists of pipeline functions to be 
applied for different targets. 

Not sure if maintaining pipeline lists is a better way to manage this than just 
building pipelines using arrow => operator,
but I was just trying to explore some of the possible methods.

let $docid := 'SIB/sibv060.xml'
let $t1 := xslt:transform( ?,  "/projects/SIB/add_id_bov.xsl" )
let $t2 := xslt:transform( ?, 
"/projects/XTF/xtf.lib/style/dynaXML/docFormatter/tei/teiDocFormatter.xsl", 
map{ 'docId' : $docid  })
let $t3 := function($in) { $in//*  }
let $pipe := ( $t1, $t2, $t3, function($x) { $x ! name(.) }, distinct-values#1  
)
let $chain := function( $a, $b ) { $b($a) }
return fold-left( $pipe, doc($docid) , $chain )

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to