Commit 5994195a authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

add support for creator at tei:person

parent 8cb06cff
......@@ -277,25 +277,62 @@ for $n in $note
: :)
declare function local:creator($creators as element(tei:link)+)
as element(xhtml:li) {
if($creators[1]/parent::*/parent::tei:person)
then
(: person item that is the creator :)
element xhtml:li {
attribute class { "creator" },
"Urheber:",
element xhtml:ul {
for $creator in $creators
let $target := $creator/@target => substring-before(" ")
let $targetId := $target => substring-after(":")
let $targetNode := $f-indexproc:dataCollection/id($targetId)
let $htmlResource :=
(: TODO remove condition_s_ for final production release :)
if($targetNode)
then
if($targetNode[2])
then "two entities with same ID: " || $targetId
else local:get-list-by-entity( $targetNode )
else "target-not-available"
return
element xhtml:li {
element xhtml:a {
attribute href { "register-" || $htmlResource || ".html?e=" || string-join($targetId) },
if($targetNode[2])
then "two entities with same ID: " || $targetId
else string($targetNode/*[1])
}
}
}
}
else
(: work item with creator :)
element xhtml:li {
attribute class { "creator" },
"Urheber:",
element xhtml:ul {
for $creator in $creators
let $currentId := $creator/parent::*/parent::*/@xml:id
let $target := $creator/@target => substring-after(" ")
let $targetId := $target => substring-after(":")
let $targetNode := $f-indexproc:dataCollection/id($target)
let $targetNode := $f-indexproc:dataCollection/id($targetId)
let $htmlResource :=
(: TODO remove condition for final production release :)
if($targetNode)
then local:get-list-by-entity( $targetNode )
then
if($targetNode[2])
then "two entities with same ID: " || $targetId
else local:get-list-by-entity( $targetNode )
else "target-not-available"
return
element xhtml:li {
element xhtml:a {
attribute href { "register-" || $htmlResource || ".html?e=" || string-join($target) },
$targetNode/*[1]/string()
attribute href { "register-" || $htmlResource || ".html?e=" || string-join($targetId) },
if($targetNode[2])
then "two entities with same ID: " || $targetId
else string($targetNode/*[1])
}
}
}
......
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