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

handle empty UriBySignature, point to self in this case.

parent 0de17df0
......@@ -1979,7 +1979,9 @@ declare function fontaneTransfo:noteParser($note as node()*) {
let $targetParts := tokenize($node/@target, "_")
let $signature := $targetParts[1]
=> substring-after("#")
let $uri := local:getUriBySignature($signature)
let $TGuri := local:getUriBySignature($signature)
let $TGuri := if($TGuri = "") then string($node/ancestor::tei:TEI/tei:teiHeader//tei:idno[@type="TextGrid"])||".0" else $TGuri
let $uri := $TGuri
=> substring-after(":")
=> substring-before(".")
return
......@@ -2006,11 +2008,10 @@ declare function fontaneTransfo:noteParser($note as node()*) {
fontaneTransfo:noteParser($node/node())
};
declare function local:getUriBySignature($signature as xs:string) as xs:string {
declare function local:getUriBySignature($signature as xs:string) as xs:string* {
collection("/db/sade-projects/textgrid/data/xml/meta")//tgmd:object
[tgmd:generic/tgmd:provided/tgmd:title[starts-with(., "Notizbuch")][ends-with(., $signature)]]
/tgmd:generic/tgmd:generated/tgmd:textgridUri/string()
};
declare function local:teiref2href($ref as xs:string) as xs:string {
......
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