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

Add recipient and date fields

parent 7c0f5497
......@@ -19,6 +19,7 @@
</field>
<xsl:apply-templates select="teiHeader/fileDesc/titleStmt/title" mode="text_only" />
<xsl:apply-templates select="teiHeader/fileDesc/titleStmt/title[@type='desc']/name" mode="make_field" />
<xsl:apply-templates select="teiHeader/fileDesc/titleStmt/title[@type='desc']/date[@type='orn']" mode="make_field" />
<xsl:apply-templates select="teiHeader/fileDesc/titleStmt/author/name" mode="text_only" />
<field name="fulltext">
<xsl:apply-templates select="text/body/*" mode="text_only" />
......@@ -51,6 +52,18 @@
</field>
</xsl:template>
<xsl:template match="name[@type='person' and @subtype='rcp']" mode="make_field">
<field name="recipient">
<xsl:apply-templates select="*|text()" mode="text_only" />
</field>
</xsl:template>
<xsl:template match="date[@type='orn']" mode="make_field">
<field name="origin_date">
<xsl:value-of select="@when" />
</field>
</xsl:template>
<xsl:template match="name[@type='place']" mode="text_only">
<xsl:apply-templates select="*|text()" mode="text_only" />
</xsl:template>
......
......@@ -35,6 +35,20 @@ public class XsltTest {
System.out.println(outputBaos.toString());
}
@Test
public void date() throws Exception {
String result = transform("date.xml");
assertXpathEvaluatesTo("1822-01-19", "//field[@name='origin_date']", result);
}
@Test
public void recipient() throws Exception {
String result = transform("recipient.xml");
assertXpathEvaluatesTo("Dude", "//field[@name='recipient']", result);
}
@Test
public void destinationPlace() throws Exception {
String result = transform("place_destination.xml");
......
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title type="desc">My title <date type="orn" when="1822-01-19">Samstag, 19. Januar 1822</date></title>
</titleStmt>
</fileDesc>
</teiHeader>
<text xml:id="my_id" xml:lang="ger">
<body>
</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>
<fileDesc>
<titleStmt>
<title type="desc">My title <name type="person" subtype="rcp" ref="gnd:123">Dude</name></title>
</titleStmt>
</fileDesc>
</teiHeader>
<text xml:id="my_id" xml:lang="ger">
<body>
</body>
</text>
</TEI>
\ No newline at end of file
......@@ -8,7 +8,7 @@
stored="true"
required="false"
multiValued="false" />
<fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"
<fieldType name="date" class="solr.DateRangeField"
indexed="true"
stored="true"
required="false"
......@@ -52,8 +52,10 @@
<field name="short_title" type="text_de" multiValued="false" />
<field name="title" type="text_de" multiValued="false" />
<field name="author" type="text_de" multiValued="false" />
<field name="recipient" type="text_de" multiValued="false" />
<field name="origin_place" type="text_de" multiValued="false" />
<field name="destination_place" type="text_de" multiValued="false" />
<field name="origin_date" type="date" />
<!-- transaction log -->
<field name="_version_" type="long" indexed="true" stored="true" />
......
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