Commit e7de47d2 authored by mrodzis's avatar mrodzis 🌎
Browse files

Merge branch 'bugfix/#127-multi-target-results-in-multiple-commentary' into 'develop'

using a deep-equal to filter for distinct notes. would be better to prevent...

Closes #127

See merge request !56
parents 7b68c7d8 a44e32a4
......@@ -5,7 +5,7 @@ xquery version "3.1";
:
: @author Simon Sendler
: @author Mathias Göbel
: @version 1.1
: @version 1.2
: @since 3.2.2
: :)
......@@ -16,8 +16,9 @@ declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace test="http://exist-db.org/xquery/xqsuite";
declare namespace xhtml="http://www.w3.org/1999/xhtml";
import module namespace rest="http://exquery.org/ns/restxq";
import module namespace functx="http://www.functx.com";
import module namespace ixp="http://fontane-nb.dariah.eu/index-processor" at "index-processor.xqm";
import module namespace rest="http://exquery.org/ns/restxq";
declare variable $stk:dataPath := "/db/sade-projects/textgrid/data/xml/data";
declare variable $stk:dataCollection := collection($stk:dataPath);
......@@ -75,6 +76,7 @@ as element(xhtml:div)
element xhtml:div {
attribute class { "notes" },
element xhtml:ul {
let $preparedNotes :=
for $note in $page/(.//tei:*[@xml:id=$noteTargets] | .//tei:figure[@xml:id][tei:figDesc])
let $note := if($note/local-name() != "figure")
then $doc//tei:note[contains(@target, "#" || $note/@xml:id)]
......@@ -84,6 +86,10 @@ as element(xhtml:div)
attribute class { 'editorialNote' },
stk:noteParser($note)
}
for $pN at $pos in $preparedNotes
where functx:index-of-deep-equal-node($preparedNotes, $pN)[1] eq $pos
return
$pN
}
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment