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

place info on sketches at the editorial commentary. order items by occurence

parent a0500a23
......@@ -5,7 +5,7 @@ xquery version "3.1";
:
: @author Simon Sendler
: @author Mathias Göbel
: @version 1.0
: @version 1.1
: @since 3.2.2
: :)
......@@ -63,15 +63,22 @@ as element(xhtml:div)
let $docpath := $stk:dataPath || "/" || $uri || ".xml"
let $doc := doc($docpath)
let $surface := tokenize($surface, "-")
let $reference := $doc//tei:surface[@n = $surface]//@xml:id
let $page := $doc//tei:surface[@n = $surface]
let $notes := $doc//tei:note[@type="editorial"]
let $noteTargets := ($notes/@target ! replace(., "#", ""))
! tokenize(., " ")[contains(., "_"||$surface[1]||"_") or contains(., "_"||$surface[2]||"_")]
return
if (not(doc-available($docpath))) then error(QName("https://sade.textgrid.de/ns/error/fontane", "STK01"), "Document not in database.") else
if (not($surface = $doc//tei:surface/@n)) then error(QName("https://sade.textgrid.de/ns/error/fontane", "STK02"), "Surface «" || $surface || "» not available.") else
element xhtml:div {
attribute class { "notes" },
element xhtml:ul {
for $note in $doc//tei:note[@type="editorial"]
where $note/@target => replace("#", "") => tokenize(" ") = $reference
for $note in $page/(.//tei:*[@xml:id=$noteTargets] | .//tei:figure[@xml:id][tei:figDesc])
let $note := if($note/local-name() != "figure")
then $doc//tei:note[contains(@target, "#" || $note/@xml:id)]
else $note
return
element xhtml:li {
attribute class { 'editorialNote' },
......@@ -175,6 +182,7 @@ declare function stk:noteParser($note as node()*)
let $uri := $TGuri => substring-after(":")
let $pattern := "^#.+_.+_.+$"
return
if(starts-with($node/@target, "http:")) then $node//text() else
if (matches($node/@target, $pattern)) then
let $target := replace($node/@target, "#", "")
return
......@@ -208,7 +216,18 @@ declare function stk:noteParser($note as node()*)
$node/@style,
stk:noteParser($node/node())
}
case element (tei:figure) return
element xhtml:span {
attribute class { "target" },
"<Skizze>]",
element xhtml:ul {
element xhtml:li {
stk:noteParser($node/node())
}
}
}
case element (tei:figDesc) return
stk:noteParser($node/node())
case text() return $node
default return
......
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