Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WeGA-WebApp-lib
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
busoni-schriften
WeGA-WebApp-lib
Commits
4dbfae09
Commit
4dbfae09
authored
7 years ago
by
Peter Stadler
Browse files
Options
Downloads
Patches
Plain Diff
added function `wega-util-shared:order-by-cert()`
parent
9ff9f589
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xquery/wega-util-shared.xqm
+22
-0
22 additions, 0 deletions
xquery/wega-util-shared.xqm
with
22 additions
and
0 deletions
xquery/wega-util-shared.xqm
+
22
−
0
View file @
4dbfae09
...
@@ -47,3 +47,25 @@ declare function wega-util-shared:guess-mimeType-from-suffix($suffix as xs:strin
...
@@ -47,3 +47,25 @@ declare function wega-util-shared:guess-mimeType-from-suffix($suffix as xs:strin
case
'txt'
return
'text/plain'
case
'txt'
return
'text/plain'
default
return
()
default
return
()
};
};
(:~
: Sort TEI elements by their cert-attribute (e.g. <tei:date cert="medium"/>)
: NB: items without cert-attribute will rank the highest, followed by 'high', 'medium', 'low', 'unknown'
:
: @param $items the items to sort
: @return the sorted sequence of the items
~:)
declare
function
wega-util-shared:order-by-cert
(
$items
as
item
()
*
)
as
item
()
*
{
let
$order
:=
map
{
'high'
:=
1
,
'medium'
:=
2
,
'low'
:=
3
,
'unknown'
:=
4
,
''
:=
0
}
return
for
$i
in
$items
let
$cert
:=
$i
/
string
(
@cert
)
order
by
$order
(
$cert
)
return
$i
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment