Commit 65eda79f authored by mrodzis's avatar mrodzis 🌿
Browse files

Feature/#84 rotated sketches

parent e5ad9d49
......@@ -58,8 +58,12 @@ declare function prepCom:recursion($nodes as node()*) as node()* {
typeswitch ($node)
case text() return
$node
case comment() return
()
if(matches($node/string(), "rotate")) then
$node
else
()
(: in case of figures the text in the tei:figDesc serves as editorial
commentary - there's no tei:note referring to it. thus we set a
......@@ -204,7 +208,10 @@ declare function prepCom:find-literature($nodes as node()*) as node()* {
case text() return
$node
case comment() return
()
if(matches($node/string(), "rotate")) then
$node
else
()
case element(tei:ptr) return
if($node[ancestor::tei:note[@type = "editorial"]]) then
......
......@@ -24,7 +24,10 @@ declare function presort:prepare($nodes as node()*) as node()* {
$node
case comment() return
()
if(matches($node/string(), "rotate")) then
$node
else
()
default return
if($node/preceding-sibling::*[self::tei:addSpan][1][@place = 'interlinear'][@prev or @next]
......
......@@ -683,12 +683,28 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a
replace($img-url, ",1000", ",500")
else
$img-url
let $rotation :=
(: no children and comment right after element:)
if($node/following-sibling::node()[1][self::comment()][matches(./string(), "rotate")]
and not($node/child::*)) then
substring-after($node/following::comment()[1], "rotate(")
=> substring-before("deg")
(: comment as first descendant :)
else if($node/child::node()[1][self::comment()][matches(./string(), "rotate")]) then
substring-after($node/child::comment()[1], "rotate(")
=> substring-before("deg")
else
()
return
element {QName("http://www.tei-c.org/ns/1.0", $node/name())}{
$node/@*,
attribute position {$display},
attribute href {$img-url},
if($rotation) then
attribute rotate {$rotation}
else
(),
fontaneSimple:transform($node/node(), $uri)
}
else
......
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