Commit dc902464 authored by Dennis Neumann's avatar Dennis Neumann
Browse files

Remove tabs and returns in the middle of strings

parent a8059d83
......@@ -21,7 +21,7 @@
<xsl:apply-templates select="teiHeader/fileDesc/titleStmt/title" mode="text_only" />
<field name="fulltext">
<xsl:apply-templates select="text/body/*" />
<xsl:apply-templates select="text/body/*" mode="text_only" />
......@@ -43,19 +43,19 @@
<xsl:apply-templates select="*|text()" mode="text_only" />
<xsl:template match="p">
<xsl:apply-templates select="*|text()" />
<xsl:template match="p" mode="text_only">
<xsl:apply-templates select="*|text()" mode="text_only" />
<xsl:template match="text()" mode="#all">
<xsl:value-of select="." />
<xsl:value-of select="replace(., '\s+', ' ')" />
<xsl:template match="lb">
<xsl:template match="lb" mode="text_only">
<xsl:text> </xsl:text>
<xsl:template match="note[@type='com']">
<xsl:template match="note[@type='com']" mode="text_only">
\ No newline at end of file
......@@ -35,6 +35,13 @@ public class XsltTest {
public void fullTitleWithSpaces_replacesWithOneSpace() throws Exception {
String result = transform("title_full_with_many_spaces.xml");
assertXpathEvaluatesTo("My title, with many spaces", "//field[@name='title']", result);
public void fullTitleWithPlace_createsField() throws Exception {
String result = transform("title_full_with_place.xml");
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="">
<title type="desc">My title,
with many spaces</title>
<text xml:id="my_id" xml:lang="ger">
\ 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