Skip to content

Commit f37a3e4

Browse files
committed
fix function signatures
and apply some minor updates to documentation and code
1 parent 2102337 commit f37a3e4

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

add/data/xql/getAnnotationPreviews.xql

+14-15
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ declare function local:getTextNotePrecedingContent($elem as element()) as xs:str
110110
else
111111
(local:getTextNotePrecedingContent($preceding))
112112
};
113+
113114
(:~
114-
: This function returns a map with details of annotation participants from a specific music source
115+
: This function returns a sequence of maps with details of annotation participants from a specific music source
115116
:
116117
: @param $participants a prefiltered sequence of annotation URIs pointing to $doc
117118
: @param $doc a URI pointing to the MEI document
@@ -181,7 +182,7 @@ declare function local:getSourceParticipants($participants as xs:string*, $doc a
181182
'origW': $imgWidth
182183
}
183184

184-
let $linkUri := concat('xmldb:exist://', document-uri($graphic/root()), '#', local:getSourceLinkTarget($elems, $zones))
185+
let $linkUri := concat('xmldb:exist://', document-uri($graphic/root()), '#', local:getSourceLinkTarget($elems))
185186

186187
where count($elems) gt 0
187188

@@ -202,24 +203,22 @@ declare function local:getSourceParticipants($participants as xs:string*, $doc a
202203
}
203204
};
204205

205-
declare function local:getSourceLinkTarget($elems as node()*, $zones as node()*) as xs:string {
206+
declare function local:getSourceLinkTarget($elems as node()*) as xs:string? {
206207
if (local-name($elems[1]) eq 'zone')
207208
then
208-
($elems[1]/string(@xml:id))
209+
($elems[1]/data(@xml:id))
209210
else
210211
if (count($elems) > 1)
211212
then
212-
(
213-
let $elemsSorted := for $elem in $elems
213+
let $elemsSorted :=
214+
for $elem in $elems
214215
order by count($elem/preceding::*)
215-
return
216-
$elem
216+
return
217+
$elem
217218
return
218219
concat($elemsSorted[1]/@xml:id, '?tstamp2=', (count($elems) - 1), 'm+0')
219-
)
220220
else
221-
($elems[1]/string(@xml:id))
222-
221+
($elems[1]/data(@xml:id))
223222
};
224223

225224
declare function local:groupParticipants($participants as xs:string*, $doc as xs:string) as xs:string* {
@@ -360,13 +359,13 @@ declare function local:getImageAreaPath($basePath as xs:string, $graphic as elem
360359
This function generates an image path for a specific zone on an image.
361360
Based on a path prefix and a width.
362361
363-
@param $basePath The base path prefix for the image databse
364-
@param $zone The zone with coordiantes on the image
365-
@param $width The width the image should be loaded with
362+
@param $zone The zone with coordinates on the image
363+
@param $imgWidth The width the image should be loaded with
364+
@param $imgHeight The height the image should be loaded with
366365
367366
@return A URL pointing to an image based as xs:string
368367
:)
369-
declare function local:getImageAreaParams($zone as element()?, $imgWidth as xs:int, $imgHeight as xs:int) as xs:string {
368+
declare function local:getImageAreaParams($zone as element()?, $imgWidth as xs:double, $imgHeight as xs:double) as xs:string {
370369
let $graphic := $zone/../mei:graphic[@type = 'facsimile']
371370

372371
let $imgX := number($zone/@ulx)

0 commit comments

Comments
 (0)