Commit f14fe31a authored by MRodz's avatar MRodz Committed by mrodzis
Browse files

Add first draft for 3.22.18 written additions in print

parent 1831999c
......@@ -217,6 +217,16 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
case element(tei:hi) return
fontaneSimpleHelpers:copy-element($node)
(: TODO if $node/@type = "highlighted" then make
a hi[@type = "vertical-mark"] in the second stage of creating the
simple format. use fontaneSimpleHelpers:get-xml-chunk($node) for this.:)
case element(tei:mod) return
if($node/@type = "highlighted"
and fontaneSimpleHelpers:is-hand-contemporary($node/@hand)) then
fontaneSimpleHelpers:copy-element($node)
else
fontaneSimple:transform($node/node())
case element(tei:anchor) return
fontaneSimpleHelpers:copy-element($node)
......
......@@ -1000,6 +1000,17 @@ declare
};
(: 3.22.18 Print: additions in writing :)
declare
%test:name("Print: additions in writing")
%test:args("<mod xmlns=""http://www.tei-c.org/ns/1.0"" type=""highlighted"" hand=""#Fontane"" spanTo=""#C04_36rfr_a"" style=""border-right-style:solid"" rend=""border-medium:pencil""/>")
%test:assertEquals("<mod xmlns=""http://www.tei-c.org/ns/1.0"" type=""highlighted"" hand=""#Fontane"" spanTo=""#C04_36rfr_a"" style=""border-right-style:solid"" rend=""border-medium:pencil""/>")
function teisimple-test:analyze-print-writing($node as element(*)) {
fontaneSimple:transform($node)
};
(: SECTIONS :)
declare
......
......@@ -19,7 +19,7 @@ import module namespace functx = "http://www.functx.com";
:
: TODO: check if we reach backside of calendar pages at all
: @author Michelle Rodzis
: @param $hand the tei:handShift/@new to be checked
: @param $hand the tei:handShift/@new or tei:mod/@hand to be checked
: @return xs:boolean
: :)
declare function fontaneSimpleHelpers:is-hand-contemporary($hand as xs:string?)
......@@ -321,4 +321,12 @@ as element(tei:seg) {
attribute rendition {$new-rendition},
fontaneSimple:transform($node/node())
}
};
declare function fontaneSimpleHelpers:get-xml-chunk($node as node()) as node()* {
let $target-id := substring-after($node/@spanTo, "#")
let $target := //tei:anchor[matches(@xml:id, $target-id)]
return
util:get-fragment-between($node, $target, false(), false())
};
\ No newline at end of file
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