Commit 0f4c7be7 authored by Dennis Neumann's avatar Dennis Neumann
Browse files

Add some spaces in highlighting snippets

parent 4be8237e
......@@ -190,11 +190,16 @@ Furthermore, a warning message is generated that contains data of the first occu
<xsl:apply-templates mode="text_only"/>
</xsl:template>
<xsl:template match="p" mode="text_only">
<xsl:template match="p | salute | signed | addrLine | dateline" mode="text_only">
<xsl:apply-templates mode="text_only" />
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="note[@place='end']" mode="text_only">
<xsl:text> </xsl:text>
<xsl:apply-templates mode="text_only" />
</xsl:template>
<xsl:template match="lb" mode="text_only">
<xsl:variable name="precedingText" select="preceding-sibling::text()[1]" />
<xsl:choose>
......
......@@ -35,6 +35,20 @@ public class XsltTest {
System.out.println(outputBaos.toString());
}
@Test
public void spaceAfterAddressLine() throws Exception {
String result = transform("address-in-opener.xml");
assertXpathEvaluatesTo("An des ", "//field[@name='fulltext']", result);
}
@Test
public void spaceAfterSaluteAndSigned() throws Exception {
String result = transform("closer-with-salute-and-signed.xml");
assertXpathEvaluatesTo("treulichst Goethe. ", "//field[@name='fulltext']", result);
}
@Test
public void differentHyphensAtLinebreak() throws Exception {
String result = transform("hyphens.xml");
......
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
</teiHeader>
<text xml:id="my_id" xml:lang="ger">
<body>
<div>
<opener>
<address>
<addrLine>An</addrLine>
<addrLine>des</addrLine>
</address>
</opener>
</div>
</body>
</text>
</TEI>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
</teiHeader>
<text xml:id="my_id" xml:lang="ger">
<body>
<div>
<closer>
<salute>treulichst</salute>
<signed><name type="person">Goethe</name>.</signed>
</closer>
</div>
</body>
</text>
</TEI>
\ No newline at end of file
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