Commit 135ba92c authored by Dennis Neumann's avatar Dennis Neumann
Browse files

Add licence from TEIs

parent 7a1dce0b
......@@ -107,6 +107,7 @@ Refer to comments in the code to understand the used algorithm.
<xsl:apply-templates select="titleStmt/title[@type='desc']/date[@type='orn']" />
<xsl:apply-templates select="titleStmt/author/name" />
<xsl:apply-templates select="sourceDesc" />
<xsl:apply-templates select="publicationStmt/availability/licence" />
</xsl:template>
<xsl:template match="profileDesc/textClass">
......@@ -161,6 +162,12 @@ Refer to comments in the code to understand the used algorithm.
</field>
</xsl:template>
<xsl:template match="licence">
<field name="licence">
<xsl:value-of select="text()" />
</field>
</xsl:template>
<xsl:template match="textClass/keywords[@scheme='#gnd']/term">
<field name="gnd_keyword">
<xsl:apply-templates mode="text_only" />
......
......@@ -35,6 +35,13 @@ public class XsltTest {
System.out.println(outputBaos.toString());
}
@Test
public void licence() throws Exception {
String result = transform("licence.xml");
assertXpathEvaluatesTo("CC BY-NC-SA-4.0", "//field[@name='licence']", result);
}
@Test
public void twoDifferentLanguages() throws Exception {
String result = transform("language_twoDifferentEntries.xml");
......
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<publicationStmt>
<availability>
<licence
target="https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode"
>CC BY-NC-SA-4.0</licence>
</availability>
</publicationStmt>
</fileDesc>
</teiHeader>
<text xml:id="my_id" xml:lang="ger">
<body>
<div>
<p>Test text.</p>
</div>
</body>
</text>
</TEI>
\ No newline at end of file
......@@ -57,6 +57,7 @@
<!-- for doctype 'article' -->
<field name="number_of_pages" type="int" />
<field name="language" type="string" multiValued="true" />
<field name="licence" type="string" />
<field name="fulltext" type="text_de" multiValued="false" />
<field name="fulltext_html" type="text_de" multiValued="false" />
<field name="short_title" type="text_de" multiValued="false" />
......
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