@@ -110,8 +110,9 @@ declare function local:getTextNotePrecedingContent($elem as element()) as xs:str
110
110
else
111
111
(local:getTextNotePrecedingContent ($preceding))
112
112
};
113
+
113
114
(:~
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
115
116
:
116
117
: @param $participants a prefiltered sequence of annotation URIs pointing to $doc
117
118
: @param $doc a URI pointing to the MEI document
@@ -181,7 +182,7 @@ declare function local:getSourceParticipants($participants as xs:string*, $doc a
181
182
'origW' : $imgWidth
182
183
}
183
184
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))
185
186
186
187
where count ($elems) gt 0
187
188
@@ -202,24 +203,22 @@ declare function local:getSourceParticipants($participants as xs:string*, $doc a
202
203
}
203
204
};
204
205
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? {
206
207
if (local-name ($elems[1 ]) eq 'zone' )
207
208
then
208
- ($elems[1 ]/string (@xml:id))
209
+ ($elems[1 ]/data (@xml:id))
209
210
else
210
211
if (count ($elems) > 1 )
211
212
then
212
- (
213
- let $elemsSorted := for $elem in $elems
213
+ let $elemsSorted :=
214
+ for $elem in $elems
214
215
order by count ($elem/preceding::*)
215
- return
216
- $elem
216
+ return
217
+ $elem
217
218
return
218
219
concat ($elemsSorted[1 ]/@xml:id, '?tstamp2=' , (count ($elems) - 1 ), 'm+0' )
219
- )
220
220
else
221
- ($elems[1 ]/string (@xml:id))
222
-
221
+ ($elems[1 ]/data (@xml:id))
223
222
};
224
223
225
224
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
360
359
This function generates an image path for a specific zone on an image.
361
360
Based on a path prefix and a width.
362
361
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
366
365
367
366
@return A URL pointing to an image based as xs:string
368
367
:)
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 {
370
369
let $graphic := $zone/../mei:graphic[@type = 'facsimile' ]
371
370
372
371
let $imgX := number ($zone/@ulx)
0 commit comments