Skip to content

Commit 9709c3b

Browse files
committed
linking to chapters as well as to sections
1 parent 3b7c8d7 commit 9709c3b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/search.xql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,17 @@ as element()* {
6161
Print the hierarchical context of a hit.
6262
:)
6363
declare %private function dq:print-headings($section as element()*, $docXPath as xs:string) {
64-
$section/ancestor-or-self::chapter/title//text(),
64+
let $nodeId := util:node-id($section)
65+
let $uri :=
66+
util:document-name(root($section)) || "?" || $docXPath || "&id=D" || $nodeId
67+
return
68+
<a href="{$uri}">{$section/ancestor-or-self::chapter/title/text()}</a>,
6569
for $s at $p in $section/ancestor-or-self::section
6670
let $nodeId := util:node-id($s)
6771
let $uri :=
6872
util:document-name(root($s)) || "?" || $docXPath || "&amp;id=D" || $nodeId || "#D" || $nodeId
6973
return
70-
(" > ", <a href="{$uri}">{$s/title//text()}</a>)
74+
(" > ", <a href="{$uri}">{$s/title/text()}</a>)
7175
};
7276

7377
(:~

0 commit comments

Comments
 (0)