Commit 100601c5 authored by Michelle Rodzis's avatar Michelle Rodzis Committed by mrodzis
Browse files

Add 3.26.1 dates

parent 8dcb43e3
...@@ -482,14 +482,18 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* { ...@@ -482,14 +482,18 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
()), ()),
(if($node/@to-iso) then (if($node/@to-iso) then
attribute to {$node/@to-iso} attribute to {$node/@to-iso}
else
()),
(if($node/@notAfter-iso) then
attribute notAfter {$node/@notAfter-iso}
else else
()), ()),
$node/(@* except (@when-iso, @to-iso, @from-iso)), $node/(@* except (@when-iso, @to-iso, @from-iso, @notAfter-iso)),
fontaneSimple:transform($node/node()) fontaneSimple:transform($node/node())
} }
case element(tei:ptr) return case element(tei:ptr) return
() text{"test"}
default return default return
fontaneSimple:transform($node/node()) fontaneSimple:transform($node/node())
......
...@@ -1049,6 +1049,51 @@ declare ...@@ -1049,6 +1049,51 @@ declare
(:};:) (:};:)
(: 3.26 ENTITIES :)
(: 3.26.1 Dates :)
declare
%test:name("Dates")
%test:args("<line xmlns=""http://www.tei-c.org/ns/1.0""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium=""black_ink""/><seg xmlns=""http://www.tei-c.org/ns/1.0""><date xmlns=""http://www.tei-c.org/ns/1.0"" type=""synchronous"" when-iso=""1873-01-01"">1873</date></seg></line>")
%test:assertEquals("<handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium=""black_ink""/>", "<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""synchronous"" when=""1873-01-01"">1873</date>")
%test:args("<line xmlns=""http://www.tei-c.org/ns/1.0""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium=""black_ink""/><date xmlns=""http://www.tei-c.org/ns/1.0"" type=""asynchronous"" from-iso=""1873"">1873</date></line>")
%test:assertEquals("<handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium=""black_ink""/>", "<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""asynchronous"" from=""1873"">1873</date>")
%test:args("<line xmlns=""http://www.tei-c.org/ns/1.0""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium=""black_ink""/><date xmlns=""http://www.tei-c.org/ns/1.0"" type=""synchronous"" to-iso=""-0122"">123 v. Chr.</date></line>")
%test:assertEquals("<handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium=""black_ink""/>", "<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""synchronous"" to=""-0122"">123 v. Chr.</date>")
%test:args("<line xmlns=""http://www.tei-c.org/ns/1.0""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium=""black_ink""/><date xmlns=""http://www.tei-c.org/ns/1.0"" type=""asynchronous"" from-iso=""1873-07"">1873</date></line>")
%test:assertEquals("<handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium=""black_ink""/>", "<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""asynchronous"" from=""1873-07"">1873</date>")
%test:args("<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""fictional"" when-iso=""--09-20""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium=""black_ink""/>20. September</date>")
%test:assertEquals("<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""fictional"" when=""--09-20""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium=""black_ink""/>20. September</date>")
%test:args("<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""asynchronous"" from-iso=""1521-05-04"" to-iso=""1522-03-06""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium=""black_ink""/>Vom 4. Mai 1521 bis 6. März 1522</date>")
%test:assertEquals("<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""asynchronous"" from=""1521-05-04"" to=""1522-03-06""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane"" medium=""black_ink""/>Vom 4. Mai 1521 bis 6. März 1522</date>")
%test:args("<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""asynchronous"" when-iso=""0450"" precision=""low""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>um 450</date>")
%test:assertEquals("<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""asynchronous"" when=""0450"" precision=""low""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>um 450</date>")
%test:args("<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""asynchronous"" notAfter-iso=""1515"" cert=""low""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>1515 oder auch schon früher</date>")
%test:assertEquals("<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""asynchronous"" notAfter=""1515"" cert=""low""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>1515 oder auch schon früher</date>")
%test:args("<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""posthumous"" when-iso=""1925-10""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>Oktober 1925</date>")
%test:assertEquals("<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""posthumous"" when=""1925-10""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>Oktober 1925</date>")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0""><date xmlns=""http://www.tei-c.org/ns/1.0"" type=""synchronous"" when-iso=""1871-04-23"" xml:id=""D08_21v_a""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>22. April</date><note xmlns=""http://www.tei-c.org/ns/1.0"" type=""editorial"" target=""#D08_21v_a"">Richtig: 23. April 1871.</note></zone>")
%test:assertEquals("<date xmlns=""http://www.tei-c.org/ns/1.0"" type=""synchronous"" when=""1871-04-23"" xml:id=""D08_21v_a""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>22. April</date>", "<note xmlns=""http://www.tei-c.org/ns/1.0"" type=""editorial"" target=""#D08_21v_a"">Richtig: 23. April 1871.</note>")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0""><surface xmlns=""http://www.tei-c.org/ns/1.0"" n=""1r""><line xmlns=""http://www.tei-c.org/ns/1.0""><seg xmlns=""http://www.tei-c.org/ns/1.0""><date xmlns=""http://www.tei-c.org/ns/1.0"" from-iso=""1796"" to-iso=""1854"" xml:id=""a"" next=""#b""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>geboren 1796</date></seg></line></surface><surface xmlns=""http://www.tei-c.org/ns/1.0"" n=""1v""><line xmlns=""http://www.tei-c.org/ns/1.0""><seg xmlns=""http://www.tei-c.org/ns/1.0""><date xmlns=""http://www.tei-c.org/ns/1.0"" from-iso=""1796"" to-iso=""1854"" xml:id=""b"" prev=""#a""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>gestorben 1854</date></seg></line></surface></zone>")
%test:assertEquals("<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""1r""/>", "<date xmlns=""http://www.tei-c.org/ns/1.0"" from=""1796"" to=""1854"" xml:id=""a"" next=""#b""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>geboren 1796</date>", "<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""1v""/>", "<date xmlns=""http://www.tei-c.org/ns/1.0"" from=""1796"" to=""1854"" xml:id=""b"" prev=""#a"">gestorben 1854</date>")
(: actually both tei:date should be merged into one element.for convenience we do that in the second processing step :)
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0""><line xmlns=""http://www.tei-c.org/ns/1.0""><seg xmlns=""http://www.tei-c.org/ns/1.0""><date xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C07_2r_a"" next=""#C07_2r_b"" type=""asynchronous"" from-iso=""1521-05-04"" to-iso=""1522-03-06""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>Vom 4. Mai 1521 bis</date></seg></line><line xmlns=""http://www.tei-c.org/ns/1.0""><seg xmlns=""http://www.tei-c.org/ns/1.0""><date xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C07_2r_b"" prev=""#C07_2r_a"" type=""asynchronous"" from-iso=""1521-05-04"" to-iso=""1522-03-06""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>6. März 1522</date></seg></line></zone>")
%test:assertEquals("<date xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C07_2r_a"" next=""#C07_2r_b"" type=""asynchronous"" from=""1521-05-04"" to=""1522-03-06""><handShift xmlns=""http://www.tei-c.org/ns/1.0"" new=""#Fontane""/>Vom 4. Mai 1521 bis</date>", "<date xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C07_2r_b"" prev=""#C07_2r_a"" type=""asynchronous"" from=""1521-05-04"" to=""1522-03-06"">6. März 1522</date>")
function teisimple-test:analyze-entities-dates($node as element(*)) {
fontaneSimple:transform($node)
};
(: SECTIONS :) (: SECTIONS :)
declare declare
......
This diff is collapsed.
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