Commit 5f0f4fc8 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

new pointer handling

parent e36d47b7
......@@ -36,8 +36,6 @@ declare function local:pointer($pointer, $targetNode) {
};
declare function fontaneregister:events($eventDoc) {
let $test := console:log( "eve " || current-dateTime() )
let $eventURI := tokenize($eventDoc/base-uri(), '/|\.')[8]
return
(: Ereignisregister :)
......@@ -83,7 +81,6 @@ return
};
declare function fontaneregister:works($wrkDoc) {
let $test := console:log( "wrk " || current-dateTime() )
let $r := request:get-parameter('r', '')
let $e := request:get-parameter('e', '')
let $wrkURI := tokenize($wrkDoc/base-uri(), '/|\.')[8]
......@@ -156,9 +153,14 @@ return
};
declare function fontaneregister:persons( $persDoc ) {
let $test := console:log( "psn " || current-dateTime() )
declare function local:pointerTest($ref, $nb) as xs:boolean {
let $id := substring-after($ref, "#")
let $target := string-join( collection("/db/sade-projects/textgrid/data/xml/data/")//*[@xml:id = $id]//tei:link/@target )
return
contains($target, $nb)
};
declare function fontaneregister:persons( $persDoc ) {
let $persURI := tokenize($persDoc/base-uri(), '/|\.')[8]
return
(: Personenregister :)
......@@ -174,14 +176,21 @@ return
<div class="panel-body">
<ul>
{ for $pers in $persList/tei:person|$persList/tei:personGrp
let $geburtsdatum := ()
return
if( not( exists($pers/@xml:id)) ) then local:pointer($pers//tei:ptr, $persList/ancestor::*//*[@xml:id = substring-after($pers//tei:ptr/@target, '#')]) else
if (not($pers//tei:link/contains(@target, request:get-parameter('nb', 'textgrid')) = true() )) then ()
else
(: test if we process for a specific notebook :)
if (not(
($pers//tei:link/contains(@target, request:get-parameter('nb', 'textgrid')) = true() )
)
) then () else
if(not(local:pointerTest(string(string($pers//tei:note/tei:ptr/@target)), request:get-parameter('nb', 'textgrid')))) then () else
<li id="{$pers/@xml:id}" class="registerEintrag reg-{$pers/local-name()} {if($pers/@xml:id = request:get-parameter('e', '')) then 'fhighlighted' else ()}">
{$pers/tei:persName[1]/text()}
<span class="registerLink"> <a href="register.html?{replace(request:get-query-string(), '(&amp;)*e=.+(&amp;)*', '')||(if(request:get-query-string() = "") then () else "&amp;")}e={$pers/string(@xml:id)}"><i title="Link zu diesem Eintrag" class="fa fa-link"></i></a> </span>
{
if( not( exists($pers/@xml:id)) ) then local:pointer($pers//tei:ptr, $persList/ancestor::*//*[@xml:id = substring-after($pers//tei:ptr/@target, '#')])
else (
<span class="registerLink"> <a href="register.html?{replace(request:get-query-string(), '(&amp;)*e=.+(&amp;)*', '')||(if(request:get-query-string() = "") then () else "&amp;")}e={$pers/string(@xml:id)}"><i title="Link zu diesem Eintrag" class="fa fa-link"></i></a> </span>,
<ul>
{if(exists($pers/tei:persName[@type="variant"]))
then <li>im Text:
......@@ -204,6 +213,7 @@ return
</ul>
</li>
</ul>
)}
</li>
}
</ul>
......@@ -215,7 +225,6 @@ return
};
declare function fontaneregister:places($geoDoc) {
let $test := console:log( "plc " || current-dateTime() )
let $geoURI := tokenize($geoDoc/base-uri(), '/|\.')[8]
return
(: Ortsregister :)
......@@ -262,7 +271,6 @@ return
};
declare function fontaneregister:orgs($orgDoc) {
let $test := console:log( "org " || current-dateTime() )
let $orgURI := tokenize($orgDoc/base-uri(), '/|\.')[8]
return
(: Koerperschaftenregister :)
......
Supports Markdown
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