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

Change @rend to @rendition

parent 0b840d22
......@@ -215,7 +215,10 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
else if($node/@type = "item" and not($node/@xml:id)) then
element tei:item {
$node/@rend,
if($node/@rend) then
attribute rendition {$node/@rend}
else
(),
fontaneSimple:transform($node/node())
}
......@@ -372,10 +375,6 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
case element(tei:milestone) return
if($node/@unit = "illustration") then
()
(: else if($node/@unit = "section") then:)
(: simpleHelpers:make-section($node):)
(: else if($node/@unit = "pararaph") then:)
(: fontaneSimple:make-paragraph($node):)
else
fontaneSimple:copy-element($node)
......@@ -472,7 +471,11 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
else if($node/@type = "list" or $node/@type = "item") then
element {QName("http://www.tei-c.org/ns/1.0", $node/@type)} {
$node/(@xml:id, @rend, @rendition, @subtype, @prev, @next),
$node/(@xml:id, @subtype, @rendition, @prev, @next),
if($node/@rend) then
attribute rendition {$node/@rend}
else
(),
fontaneSimple:transform($node/node())
}
......@@ -682,7 +685,11 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
:)
declare function fontaneSimple:copy-element($node as node()) as node() {
element {QName("http://www.tei-c.org/ns/1.0", $node/name())}{
$node/@*,
$node/(@* except @rend),
if($node/@rend) then
attribute rendition {$node/@rend}
else
(),
fontaneSimple:transform($node/node())
}
};
......
......@@ -406,7 +406,7 @@ as element(tei:milestone) {
element tei:milestone {
attribute unit {"line"},
if($node/@rend) then
$node/@rend
attribute rendition {$node/@rend}
else
()
}
......
......@@ -150,7 +150,7 @@ declare
declare
%test:name("Paragraphs")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0""><line xmlns=""http://www.tei-c.org/ns/1.0"" style=""margin-left:1.0cm"">noch nicht recht aufgehn.</line><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""paragraph""/><line xmlns=""http://www.tei-c.org/ns/1.0"" style=""margin-left:2.8cm"" rend=""indent"">Unter den andern</line></zone>")
%test:assertEquals("<milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>", "noch nicht recht aufgehn.", "<milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""paragraph""/>", "<milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line"" rend=""indent""/>", "Unter den andern")
%test:assertEquals("<milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>", "noch nicht recht aufgehn.", "<milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""paragraph""/>", "<milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line"" rendition=""indent""/>", "Unter den andern")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0""><figure xmlns=""http://www.tei-c.org/ns/1.0""><figDesc xmlns=""http://www.tei-c.org/ns/1.0""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""http://vocab.getty.edu/aat/300200009"">horizontale einfache Absatzlinie</ref></figDesc></figure><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""paragraph""/></zone>")
%test:assertEquals("<ab xmlns=""http://www.tei-c.org/ns/1.0"" type=""short-paragraph-line""/>", "<milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""paragraph""/>")
......@@ -182,7 +182,7 @@ declare
%test:assertEquals("<div xmlns=""http://www.tei-c.org/ns/1.0"" type=""dialogue""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/><hi xmlns=""http://www.tei-c.org/ns/1.0"">Er</hi>. <seg xmlns=""http://www.tei-c.org/ns/1.0"" type =""said"">Nun kommt der Däne nicht wieder.</seg><lb xmlns=""http://www.tei-c.org/ns/1.0"" type=""edited_text""/><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/><hi>Ich</hi>. <seg xmlns=""http://www.tei-c.org/ns/1.0"" type =""said"">Wer weiß.</seg></div>")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""dialogue""><line xmlns=""http://www.tei-c.org/ns/1.0""><seg xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""D07_69v_a"" next=""#D07_69v_1"" type=""said"">Hören Se, </seg></line><zone xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""D07_69v_1"" prev=""#D07_69v_a"" type=""said""><line xmlns=""http://www.tei-c.org/ns/1.0"">der ganze Krieg war nich</line><line xmlns=""http://www.tei-c.org/ns/1.0"">nöthig.</line></zone><zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""said""><line xmlns=""http://www.tei-c.org/ns/1.0"" rend=""indent"">Nich?</line></zone></zone>")
%test:assertEquals("<div xmlns=""http://www.tei-c.org/ns/1.0"" type=""dialogue""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/><seg xmlns=""http://www.tei-c.org/ns/1.0"" type =""said"">Hören Se, <milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>der ganze Krieg war nich<milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>nöthig.</seg><lb xmlns=""http://www.tei-c.org/ns/1.0"" type=""edited_text""/><seg xmlns=""http://www.tei-c.org/ns/1.0"" type =""said""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line"" rend=""indent""/>Nich?</seg></div>")
%test:assertEquals("<div xmlns=""http://www.tei-c.org/ns/1.0"" type=""dialogue""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/><seg xmlns=""http://www.tei-c.org/ns/1.0"" type =""said"">Hören Se, <milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>der ganze Krieg war nich<milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>nöthig.</seg><lb xmlns=""http://www.tei-c.org/ns/1.0"" type=""edited_text""/><seg xmlns=""http://www.tei-c.org/ns/1.0"" type =""said""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line"" rendition=""indent""/>Nich?</seg></div>")
function teisimple-test:analyze-dialogues($node as element(*)) {
fontaneSimple:transform($node)
......@@ -225,13 +225,13 @@ declare
declare
%test:name("Lists")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""list"" rend=""indent""><line xmlns=""http://www.tei-c.org/ns/1.0"" type=""item"">Ludwig der Springer,</line><line xmlns=""http://www.tei-c.org/ns/1.0"" type=""item"">Ludwig der Eiſerne,</line></zone>")
%test:assertEquals("<list xmlns=""http://www.tei-c.org/ns/1.0"" rend=""indent""><item xmlns=""http://www.tei-c.org/ns/1.0"">Ludwig der Springer,</item><item xmlns=""http://www.tei-c.org/ns/1.0"">Ludwig der Eiserne,</item></list>")
%test:assertEquals("<list xmlns=""http://www.tei-c.org/ns/1.0"" rendition=""indent""><item xmlns=""http://www.tei-c.org/ns/1.0"">Ludwig der Springer,</item><item xmlns=""http://www.tei-c.org/ns/1.0"">Ludwig der Eiserne,</item></list>")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0""><surface xmlns=""http://www.tei-c.org/ns/1.0"" n=""37v""><zone xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C08_37v_1"" next=""#C08_38r_1"" type=""list"" rend=""indent""><zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""item""><line xmlns=""http://www.tei-c.org/ns/1.0"">1. Mantegna:</line></zone></zone></surface><surface xmlns=""http://www.tei-c.org/ns/1.0"" n=""38r""><zone xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C08_38r_1"" prev=""#C08_37v_1"" type=""list"" rend=""indent""><zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""item""><line xmlns=""http://www.tei-c.org/ns/1.0"">4. Guercino:</line> </zone></zone></surface></zone>")
%test:assertEquals("<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""37v""/>", "<list xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C08_37v_1"" rend=""indent"" next=""#C08_38r_1""><item xmlns=""http://www.tei-c.org/ns/1.0""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>1. Mantegna:</item></list>", "<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""38r""/>", "<list xmlns=""http://www.tei-c.org/ns/1.0"" prev=""#C08_37v_1"" rend=""indent"" xml:id=""C08_38r_1""><item xmlns=""http://www.tei-c.org/ns/1.0""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>4. Guercino:</item></list>")
%test:assertEquals("<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""37v""/>", "<list xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C08_37v_1"" rendition=""indent"" next=""#C08_38r_1""><item xmlns=""http://www.tei-c.org/ns/1.0""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>1. Mantegna:</item></list>", "<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""38r""/>", "<list xmlns=""http://www.tei-c.org/ns/1.0"" prev=""#C08_37v_1"" rendition=""indent"" xml:id=""C08_38r_1""><item xmlns=""http://www.tei-c.org/ns/1.0""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>4. Guercino:</item></list>")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0""><surface xmlns=""http://www.tei-c.org/ns/1.0"" n=""19r""><zone xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C06_19r_1"" next=""#C06_20r_1"" type=""list""><line xmlns=""http://www.tei-c.org/ns/1.0"" type=""item"" rend=""indent"">c. Das Grumbach⸗Beil</line><zone xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C06_19r_2"" next=""#C06_20r_2"" type=""item""><line xmlns=""http://www.tei-c.org/ns/1.0"" rend=""indent"">d. Das 101 Richtſchwert;</line></zone></zone></surface><surface xmlns=""http://www.tei-c.org/ns/1.0"" n=""19v""/><surface xmlns=""http://www.tei-c.org/ns/1.0"" n=""20r""><zone xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C06_20r_1"" prev=""#C06_19r_1"" type=""list""><zone xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C06_20r_2"" prev=""C06_19r_2"" type=""item""><line xmlns=""http://www.tei-c.org/ns/1.0"">Theils weil Raum und</line></zone></zone></surface></zone>")
%test:assertEquals("<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""19r""/>", "<list xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C06_19r_1"" next=""#C06_20r_1""><item xmlns=""http://www.tei-c.org/ns/1.0"" rend=""indent"">c. Das Grumbach⸗Beil</item><item xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C06_19r_2"" next=""#C06_20r_2""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line"" rend=""indent""/>d. Das 101 Richtschwert;</item></list>", "<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""19v""/>", "<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""20r""/>", "<list xmlns=""http://www.tei-c.org/ns/1.0"" prev=""#C06_19r_1"" xml:id=""C06_20r_1""><item xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C06_20r_2"" prev=""C06_19r_2""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>Theils weil Raum und</item></list>")
%test:assertEquals("<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""19r""/>", "<list xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C06_19r_1"" next=""#C06_20r_1""><item xmlns=""http://www.tei-c.org/ns/1.0"" rendition=""indent"">c. Das Grumbach⸗Beil</item><item xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C06_19r_2"" next=""#C06_20r_2""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line"" rendition=""indent""/>d. Das 101 Richtschwert;</item></list>", "<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""19v""/>", "<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""20r""/>", "<list xmlns=""http://www.tei-c.org/ns/1.0"" prev=""#C06_19r_1"" xml:id=""C06_20r_1""><item xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C06_20r_2"" prev=""C06_19r_2""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>Theils weil Raum und</item></list>")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""toc"" subtype=""Fontane""><line xmlns=""http://www.tei-c.org/ns/1.0"" type=""item""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""#xpath(//surface[@n='13r'])"">Groſsbeeren</ref></line><line xmlns=""http://www.tei-c.org/ns/1.0"" type=""item""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""#xpath(//surface[@n='25r'])"">Blankenfelde</ref></line></zone>")
%test:assertEquals("<list xmlns=""http://www.tei-c.org/ns/1.0"" type=""toc"" subtype=""Fontane""><item xmlns=""http://www.tei-c.org/ns/1.0""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""#xpath(//surface[@n='13r'])"">Grossbeeren</ref></item><item xmlns=""http://www.tei-c.org/ns/1.0""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""#xpath(//surface[@n='25r'])"">Blankenfelde</ref></item></list>")
......
This diff is collapsed.
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