I am building an app, where I need to transform all files in what is $xml below from xml to html, with a certain xslt, obviously. Then I want them to be output as <li> <!-- the transformed output --> </li>
declare function app:XMLtoHTML-forAll ($node as node(), $model as map(*), $query as xs:string?){
let $ref := xs:string(request:get-parameter("document", ""))
let $xml := doc(concat("/db/apps/BookOfOrders/data/edition/",$ref))
let $xsl := doc("/db/apps/BookOfOrders/resources/xslt/xmlToHtml.xsl")
let $params :=
<parameters>
{for $p in request:get-parameter-names()
let $val := request:get-parameter($p,())
where not($p = ("document","directory","stylesheet"))
return
<param name="{$p}" value="{$val}"/>
}
</parameters>
for $doc in collection("/db/apps/BookOfOrders/data/edition")/tei:TEI
return
<li> {transform:transform($xml, $xsl, $params)} </li>
};
My function, however, returns empty <li></li>-elements for every document, I have in this folder.
Can anyone hint me towards what I am doing wrong?
Small Edit: it also does not use all files, but only what seems to be randomly pick one and transform this over and over ...