Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
5f613e5e
Commit
5f613e5e
authored
Oct 30, 2019
by
Mathias Goebel
🎠
Browse files
place info on sketches at the editorial commentary. order items by occurence
parent
a0500a23
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
modules/fontane/stellenkommentar.xqm
View file @
5f613e5e
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment