@@ -45,18 +45,28 @@ declare function rf:print-recommendation($type) {
45
45
()
46
46
};
47
47
48
- declare function rf:print-centers () {
48
+ declare function rf:print-centers ($center ) {
49
49
for $c in data ($center:centers/@id)
50
50
return
51
- <option value = "{$c} " >{$c}</option>
51
+ if ($c eq $center)
52
+ then
53
+ (<option value = "{$c} " selected = "selected" >{$c}</option>)
54
+ else
55
+ (<option value = "{$c} " >{$c}</option>)
52
56
};
53
57
54
- declare function rf:print-domains () {
58
+ declare function rf:print-domains ($domainId ) {
55
59
for $d in $format:domains
60
+ let $id := $d/@id
56
61
return
57
- <option value = "{$d/@id} " >{$d/name/text ()}</option>
62
+ if ($id eq $domainId)
63
+ then
64
+ <option value = "{$id} " selected = "selected" >{$d/name/text ()}</option>
65
+ else
66
+ <option value = "{$id} " >{$d/name/text ()}</option>
58
67
};
59
68
69
+ (: deprecated
60
70
declare function rf:print-domains($path) {
61
71
let $size := count($format:domains)
62
72
let $lastDomain := $format:domains[$size]
@@ -70,6 +80,14 @@ declare function rf:print-domains($path) {
70
80
($link, " | ")
71
81
else
72
82
($link)
83
+ };:)
84
+
85
+ declare function rf:print-option ($selected, $value,$label) {
86
+ if ($selected eq $value)
87
+ then
88
+ <option value = "{$value} " selected = "selected" >{$label}</option>
89
+ else
90
+ <option value = "{$value} " >{$label}</option>
73
91
};
74
92
75
93
declare function rf:print-recommendation-level ($recommendationNumber) {
@@ -222,11 +240,16 @@ declare function rf:export-table($center, $domainId, $recommendationType, $nodes
222
240
223
241
return
224
242
<result>
225
- <filter>
226
- <center>{$center}</center>
227
- <domain>{$domainName}</domain>
228
- <level>{rf:print-recommendation-level ($recommendationType)}</level>
229
- </filter>
243
+ <header>
244
+ <title>CLARIN Standards Information System (SIS) export</title>
245
+ <url>{app:link ("views/recommended-formats-with-search.xq" )}</url>
246
+ <date>{fn:current-dateTime ()}</date>
247
+ <filter>
248
+ <center>{$center}</center>
249
+ <domain>{$domainName}</domain>
250
+ <level>{rf:print-recommendation-level ($recommendationType)}</level>
251
+ </filter>
252
+ </header>
230
253
<formats>{$rows}</formats>
231
254
</result>
232
255
0 commit comments