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

Add 3.21.11 deletions

parent efcbd58f
......@@ -110,10 +110,35 @@ declare
(: GENETIC INFORMATION :)
(: 3.21.11. DELETIONS :)
declare
%test:name("Deletions")
%test:args("<del xmlns=""http://www.tei-c.org/ns/1.0"">(Dann folgen wohl Reiſe</del>")
%test:assertEmpty
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0""><line xmlns=""http://www.tei-c.org/ns/1.0"">herab über <seg xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""A02_76v_1"" next=""#A02_76v_2"" type=""cancel"">den nordiſchſten</seg></line><zone xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""A02_76v_2"" prev=""#A02_76v_1"" type=""cancel""><line xmlns=""http://www.tei-c.org/ns/1.0"">Gardinenſchnittkleidern und</line></zone></zone>")
%test:assertEquals("herab über ")
(: restoring text :)
%test:args("<restore xmlns=""http://www.tei-c.org/ns/1.0""><del xmlns=""http://www.tei-c.org/ns/1.0""><seg xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C12_48r_b"" prev=""#C12_48r_a"" style=""text-decoration:line-through"" rend=""line-through-style:double"">z. B.</seg></del></restore>")
%test:assertEquals("<seg xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C12_48r_b"" prev=""#C12_48r_a"" style=""text-decoration:line-through"" rend=""line-through-style:double"">z. B.</seg>")
(: restored deletion that was again deleted :)
%test:args("<del xmlns=""http://www.tei-c.org/ns/1.0""><seg xmlns=""http://www.tei-c.org/ns/1.0"" style=""text-decoration:line-through"" rend=""line-through-style:single_oblique(45deg)""><restore xmlns=""http://www.tei-c.org/ns/1.0""><del xmlns=""http://www.tei-c.org/ns/1.0""><seg xmlns=""http://www.tei-c.org/ns/1.0"" style=""text-decoration:line-through"">ſich</seg></del></restore></seg></del>")
%test:assertEmpty
(: partly restored deletion :)
%test:args("<del xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""B04_52v_d"" prev=""#B04_52v_c""><seg xmlns=""http://www.tei-c.org/ns/1.0"" style=""text-decoration:line-through"">hand <restore xmlns=""http://www.tei-c.org/ns/1.0"">führen kann</restore></seg></del>")
%test:assertEquals("führen kann")
(: restored deletion :)
%test:args("<line xmlns=""http://www.tei-c.org/ns/1.0""><mod xmlns=""http://www.tei-c.org/ns/1.0"" type=""subst""><del xmlns=""http://www.tei-c.org/ns/1.0""><seg xmlns=""http://www.tei-c.org/ns/1.0"" style=""text-decoration:line-through"" rend=""line-through-medium:blue_pencil""> Herbstesbunte </seg><restore xmlns=""http://www.tei-c.org/ns/1.0""><mod xmlns=""http://www.tei-c.org/ns/1.0"" type=""subst""><del xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""B04_53v_a"">Waldes</del></mod></restore><add xmlns=""http://www.tei-c.org/ns/1.0"">Wälder</add></del><redo xmlns=""http://www.tei-c.org/ns/1.0"" target=""#B04_53v_a"" style=""text-decoration:line-through"" rend=""line-through-medium:blue_pencil""/><add xmlns=""http://www.tei-c.org/ns/1.0"">Rot und gelbe Herbstes</add></mod>lehnen </line>")
%test:assertEquals("Rot und gelbe Herbstes","lehnen ")
(: marking something as complete :)
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""marked_off"" xml:id=""E04_39r_2"" uly=""0.5""><line xmlns=""http://www.tei-c.org/ns/1.0""><hi xmlns=""http://www.tei-c.org/ns/1.0"">3<seg xmlns=""http://www.tei-c.org/ns/1.0"" style=""text-decoration:underline"">. Kapitel</seg></hi>.</line></zone>")
%test:assertEquals("<seg xmlns=""http://www.tei-c.org/ns/1.0"" type=""marked_off"" xml:id=""E04_39r_2"">3<seg xmlns=""http://www.tei-c.org/ns/1.0"" style=""text-decoration:underline"">. Kapitel</seg>.</seg>")
function teisimple-test:analyze-del($node as element(*)) {
fontane-simple:transform($node)
};
......
......@@ -76,9 +76,19 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
element tei:graphic {
$node/@*
}
case element(tei:del)
return
case element(tei:del) return
if($node/parent::tei:restore) then
fontane-simple:transform($node/node())
else if($node/descendant::tei:restore) then
fontane-simple:transform($node/descendant::tei:restore)
else
()
case element(tei:restore) return
if(count($node/child::*) = 1 and $node/child::tei:del
and $node/ancestor::tei:del) then
()
else
fontane-simple:transform($node/node())
case element(tei:fw)
return
()
......@@ -125,7 +135,8 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
$node/@*,
fontane-simple:transform($node/node())
}
else if($node/@type = "auction_number")
else if($node/@type = "auction_number"
or $node/@type = "cancel")
then
()
else
......@@ -204,22 +215,29 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
}
else
()
case element(tei:zone)
return
if(matches($node/@style, "border-style:solid")
and not(matches($node/@style, "border-radius"))
and not($node/@rend = "border-style:house")) then
element tei:div {
attribute type {"frame"},
fontane-simple:transform($node/node())
}
else if(matches($node/@rend, "border-bottom-style:brace")) then
(fontane-simple:transform($node/node()),
element tei:ab {
attribute type {"bottom-brace"}
})
else
fontane-simple:transform($node/node())
case element(tei:zone) return
if(matches($node/@style, "border-style:solid")
and not(matches($node/@style, "border-radius"))
and not($node/@rend = "border-style:house")) then
element tei:div {
attribute type {"frame"},
fontane-simple:transform($node/node())
}
else if(matches($node/@rend, "border-bottom-style:brace")) then
(fontane-simple:transform($node/node()),
element tei:ab {
attribute type {"bottom-brace"}
})
else if($node/@type = "cancel") then
()
else if($node/@type = "marked_off") then
element tei:seg {
$node/@type,
$node/@xml:id,
fontane-simple:transform($node/node())
}
else
fontane-simple:transform($node/node())
case element(tei:figure) return
if(count($node/child::*) = 1 and $node/child::tei:figDesc) then
(: genealogy lines probably shouldn't be displayed, but I still have to
......
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