this is my transformation for making every file in a directory into a carousel (bootstrap), I need, however, for the first file (Folio001.xml), the class "active" to be added to the last line of the code
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
<div class="carousel-item"> {transform:transform($doc, $xsl, $params)} </div>
};
Is there an easy way to do this without changing the most of the code? I was thinking of sth. like this:
if(file-name="Folio001.xml")
return
<div class="carousel-item active"> {transform:transform($doc, $xsl, $params)} </div>
else
return
<div class="carousel-item"> {transform:transform($doc, $xsl, $params)} </div>
THanks in advance, K