Loading rxq/util.xqm +6 −2 Original line number Diff line number Diff line Loading @@ -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){ Loading Loading
rxq/util.xqm +6 −2 Original line number Diff line number Diff line Loading @@ -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){ Loading