Commit 413ecf38 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

fixes #99 (page blanche si nbhits=0)

parent c1bdcded
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -47,12 +47,16 @@ declare function max.util:buildXSLTDoc($xsltMain as xs:string, $xsltAddons as xs

declare function max.util:markSearchedText($node as node(), $search as xs:string,  $targetId as xs:string ?){
    let $target := if($targetId) then $targetId else 'text'
    return
    let $marked := ft:mark($node//*[@*:id=$target][.//text() contains text {$search}])
    return if($marked)
        then
        copy $c := $node
        modify (
            replace node $c/descendant-or-self::*[@*:id = $target] with ft:mark($c//*[@*:id=$target][.//text() contains text {$search}])
            replace node $c/descendant-or-self::*[@*:id = $target] with $marked
        )
        return  $c
    else $node

};

declare function max.util:addHTMLClass($htmlNode as node(), $targetId as xs:string, $className as xs:string){