Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
efb7b8b6
Commit
efb7b8b6
authored
Dec 11, 2018
by
mrodzis
🌿
Browse files
Improve whitespace handling between tei:hi (cf.
#37
)
parent
15ff7420
Changes
2
Show whitespace changes
Inline
Side-by-side
modules/fontane/teisimpleprint/tei2teisimple.xqm
View file @
efb7b8b6
...
...
@@ -315,7 +315,16 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a
fontaneSimple:transform($node/node(), $uri)
case element(tei:hi) return
fontaneSimple:copy-element($node, $uri)
(element {QName("http://www.tei-c.org/ns/1.0", $node/name())} {
$node/@*,
fontaneSimple:transform($node/node(), $uri)
},
if(not($node/@prev or $node/@next)
and $node/following::node()[1][self::text()][normalize-space(.) = ""]
and $node/following::*[1][self::tei:hi]) then
text{"@"}
else
())
(: TODO if $node/@type = "highlighted" then make
a hi[@type = "vertical-mark"] in the second stage of creating the
...
...
modules/fontane/teisimpleprint/tests/teisimple-test.xql
View file @
efb7b8b6
...
...
@@ -1466,3 +1466,16 @@ declare
function teisimple-test:additions-with-vague-placement($node as element(*)) {
fontaneSimple:transform($node, "16b00")
};
(: Two sequential tei:hi that are divided by a whitespace, e.g. C6, "Schlachtfeld von Jena und Auerstädt" :)
declare
%test:name("Two sequential tei:hi that are divided by a whitespace")
%test:args("<line xmlns=""http://www.tei-c.org/ns/1.0""><rs><hi>J<seg style=""text-decoration:underline"">ena</seg></hi> <hi><seg style=""text-decoration:underline"">und</seg></hi> <hi><seg style=""text-decoration:underline"">Auerſtäd</seg>t</hi></rs></line>")
%test:assertEquals("<milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>", "<rs xmlns=""http://www.tei-c.org/ns/1.0""><hi>Jena</hi>@<hi>und</hi>@<hi>Auerstädt</hi></rs>")
%test:args("<line xmlns=""http://www.tei-c.org/ns/1.0""><rs><hi xml:id=""some-id"" next=""#another-id"">J<seg style=""text-decoration:underline"">ena</seg></hi> <hi xml:id=""another-id"" prev=""#some-id""><seg style=""text-decoration:underline"">und</seg></hi></rs></line>")
%test:assertEquals("<milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""line""/>", "<rs xmlns=""http://www.tei-c.org/ns/1.0""><hi xml:id=""some-id"" next=""#another-id"">Jena</hi><hi xml:id=""another-id"" prev=""#some-id"">und</hi></rs>")
function teisimple-test:hi-with-whitespaces($node as element(*)) {
fontaneSimple:transform($node, "16b00")
};
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment