Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
20456fe3
Commit
20456fe3
authored
Aug 23, 2018
by
Mathias Goebel
Browse files
closes
#41
, adds test
parent
c10011ca
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
modules/fontane/index-api.xqm
View file @
20456fe3
...
...
@@ -144,7 +144,16 @@ else
default return "The prefix " || $prefix || " is not in the dictonary."
};
declare function local:get-list-by-id($id as xs:string)
declare
%test:name("entity list relation")
%test:args("Dom_Karlos_Figur") (: person in wrk :)
%test:assertEquals("list-works")
%test:args("Purschian") (: person :)
%test:assertEquals("listPerson")
function local:get-list-by-id($id as xs:string)
as xs:string {
let $entity := collection($index:dataPath)/id($id)
let $test := if($entity[2]) then error(QName("FONTANE", "INDEX-API3"), "Entity »" || $id || "« has more then one occurence." ) else ()
...
...
@@ -155,11 +164,11 @@ return
case "place" return "listPlace"
case "person" return
if($entity/ancestor::tei:item)
then local:get-list-by-id( $entity/ancestor::tei:item[last()]/string(@id) )
then local:get-list-by-id(
(
$entity/ancestor::tei:item
)
[last()]/string(@
xml:
id) )
else "listPerson"
case "personGrp" return
if($entity/ancestor::tei:item)
then local:get-list-by-id( $entity/ancestor::tei:item[last()]/string(@id) )
then local:get-list-by-id(
(
$entity/ancestor::tei:item
)
[last()]/string(@
xml:
id) )
else "listPerson"
default return
let $list := ($entity/ancestor::tei:list[@type])[last()]
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment