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

Add 3.12.9. (topography) and 3.21.10.1 (frames)

parent cfe9d685
......@@ -272,4 +272,40 @@ declare
%test:assertEquals("<gap xmlns=""http://www.tei-c.org/ns/1.0"" reason=""damage"" unit=""mm"" quantity=""64""/>")
function teisimple-test:analyze-illeg-word($node as element(*)) {
fontane-simple:transform($node)
};
(: 3.21.9 TOPOGRPHY OF THE PAGE :)
declare
%test:name("Topography of the page")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" rotate=""270"" uly=""16"" style=""border-bottom-style:solid; border-right-style:solid; padding-bottom:0.5cm; padding-right:0.5cm""><line style=""margin-left:0cm""> 4. Iron and Steel.</line></zone>")
%test:assertEquals(" 4. Iron and Steel.")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" rotate=""326""><line style=""margin-left:0.0cm"">werfen </line></zone>")
%test:assertEquals("werfen ")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0""><zone xmlns=""http://www.tei-c.org/ns/1.0"" style=""font-size:x-large"" ulx=""2.1"" uly=""13.8"" lrx=""2.9"" lry=""15.0""><line xmlns=""http://www.tei-c.org/ns/1.0"" style=""margin-left:0.0cm"">(</line></zone></zone>")
%test:assertEquals("(")
function teisimple-test:analyze-topography($node as element(*)) {
fontane-simple:transform($node)
};
(: 3.21.10 FRAMES ETC. :)
declare
%test:name("Rectangular frames")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" style=""border-style:solid"" ulx=""0.3"" uly=""6.1"" lrx=""8.3"" lry=""9.3""><line style=""margin-left:1.1cm"">Test</line></zone>")
%test:assertEquals("<div xmlns=""http://www.tei-c.org/ns/1.0"" type=""frame"">Test</div>")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" style=""border-left-style:solid; border-top-style:solid; border-right-style:solid"" ulx=""0.4"" uly=""7.3"" lrx=""9.9"" lry=""16.1""><zone xmlns=""http://www.tei-c.org/ns/1.0"" ulx=""0.0"" uly=""0.5"" lrx=""9.2"" lry=""5.8""><line xmlns=""http://www.tei-c.org/ns/1.0"" style=""margin-left:0.5cm"">„Es hätte ſie ſehr</line></zone></zone>")
%test:assertEquals("„Es hätte ſie ſehr")
function teisimple-test:analyze-rect-frames($node as element(*)) {
fontane-simple:transform($node)
};
declare
%test:name("Other frames")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" style=""border-style:solid; border-radius:50%"" rend=""border-medium:red_pencil"" ulx=""2.4"" uly=""1.6"" lrx=""5.7"" lry=""9.0""><zone xmlns=""http://www.tei-c.org/ns/1.0"" rotate=""270"" ulx=""3.1"" uly=""7.6"" lrx=""7.8"" lry=""5.1""><line xmlns=""http://www.tei-c.org/ns/1.0"" style=""margin-left:0.0cm"">S. 260</line></zone></zone>")
%test:assertEquals("S. 260")
%test:args("<zone style=""border-style:solid"" rend=""border-style:house"" rotate=""180"" ulx=""2.4"" uly=""6.4"" lrx=""4.2"" lry=""7.3""><line style=""margin-left:0.0cm"">Die</line></zone>")
%test:assertEquals("Die")
function teisimple-test:analyze-other-frames($node as element(*)) {
fontane-simple:transform($node)
};
\ No newline at end of file
......@@ -191,6 +191,18 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
element tei:gap {
$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
fontane-simple:transform($node/node())
default return
fontane-simple:transform($node/node())
};
......
Supports Markdown
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