Commit 64c5f0db authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

set better processing for getting list name

parent 8b8311be
......@@ -159,6 +159,7 @@ function index:get-list-by-id($id as xs:string)
as xs:string {
let $entity := $ixp:dataCollection/id($id)[ not(. instance of element(tei:handNote) ) ]
let $test := if($entity[2]) then error(QName("FONTANE", "INDEX-API3"), "Entity »" || $id || "« has more then one occurence." ) else ()
let $test := if($entity) then () else error(QName("FONTANE", "INDEX-API3"), "Entity »" || $id || "« was not found." )
return
switch ( $entity/local-name() )
case "event" return "listEvent"
......@@ -166,14 +167,14 @@ return
case "place" return "listPlace"
case "person" return
if($entity/ancestor::tei:item)
then index:get-list-by-id( ($entity/ancestor::tei:item)[last()]/string(@xml:id) )
then index:get-list-by-node($entity/ancestor::tei:item[@xml:id][1])
else "listPerson"
case "personGrp" return
if($entity/ancestor::tei:item)
then index:get-list-by-id( ($entity/ancestor::tei:item)[last()]/string(@xml:id) )
then index:get-list-by-node($entity/ancestor::tei:item[@xml:id][1])
else "listPerson"
default return
let $list := ($entity/ancestor::tei:list[@type])[last()]
let $list := $entity/ancestor::tei:list[@type]
return
$list/local-name() || "-" || string($list/@type)
};
......@@ -186,14 +187,14 @@ as xs:string {
case "place" return "listPlace"
case "person" return
if($node/ancestor::tei:item)
then index:get-list-by-id( ($node/ancestor::tei:item)[last()]/string(@xml:id) )
then index:get-list-by-node($node/ancestor::tei:item[@xml:id][1])
else "listPerson"
case "personGrp" return
if($node/ancestor::tei:item)
then index:get-list-by-id( ($node/ancestor::tei:item)[last()]/string(@xml:id) )
then index:get-list-by-node($node/ancestor::tei:item[@xml:id][1])
else "listPerson"
default return
let $list := ($node/ancestor::tei:list[@type])[last()]
let $list := $node/ancestor::tei:list[@type]
return
$list/local-name() || "-" || string($list/@type)
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment