Commit 784bbdd6 authored by Jonas Waeber's avatar Jonas Waeber

Update memobase xslt to latest.

parent d4c6e433
Pipeline #11949 passed with stages
in 4 minutes and 42 seconds
......@@ -25,6 +25,7 @@ import org.apache.logging.log4j.LogManager
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.api.assertAll
import org.memobase.testing.EmbeddedSftpServer
import java.io.InputStream
import java.util.Properties
......@@ -43,16 +44,24 @@ class TestXsltTransform {
}
@Test
fun `test xslt tranform`() {
fun `test old memobase xslt tranform`() {
val props = Properties()
props.setProperty("xsltFilePath", "${resourcePath}/test_transform/test-transformer.xslt")
props.setProperty("identifierFieldName", "identifierMain")
props.setProperty("recordTag", "record")
val transformer = XMLTransformer(props)
val result = transformer.applyXSLT("", createInputStream("test_transform/test-transformer.xml"))
assertThat(result.key)
.isEqualTo("ADG-102821")
assertThat(result.value.output.toString())
.isEqualTo(readFile("test_transform/output.json"))
assertAll("assert old memobase xslt transformation.",
{
assertThat(result.key)
.isEqualTo("ADG-102683")
},
{
assertThat(result.value.output.toString())
.isEqualTo(readFile("test_transform/output.json"))
}
)
}
}
{"title":"Grabung Castaneda (Siedlung)","SerieTitle":"Grabung Walo Burkart und Karl Keller-Tarnuzzer, Castaneda (Gräberfeld und Siedlung)","creatorPerson":{"name":"[unbekannt]"},"Keywords":"Ausgrabung, Archäologie","Abstract":"Feld 1, östlicher Teil von Westen","Claim":"Dieses Dokument wurde Dank der Unterstützung von Memoriav erhalten.","RecordingLocation":"Castaneda","contributorCorporateBody":{"name":"ADG"},"genre":"Grabungsfotografie / Arbeitsfotografie / Sachfotografie","objectType":"photograph","medium":"[keine Information vorhanden]","imageFormatColorMode":"sw","imageFormatRemarks":"Album-Nr.: A2","identifierOriginal":"102821","identifierCallNumber":"RM_1_33_6","identifierMain":"ADG-102821","location":"Schweiz, Graubünden, Castaneda","rightsHolder":"Archäologischer Dienst Graubünden","accessPhsyical":"onsite","accessDigital":"public"}
\ No newline at end of file
{"title":"Ausgrabung Crestaulta","SerieTitle":"Grabung Walo Burkart und Karl Keller-Tarnuzzer, Lumbrein-Surin (Crestaulta)","creatorPerson":{"name":"Karl Keller-Tarnuzzer"},"Keywords":"Ausgrabung, Archäologie","Abstract":"Herdstelle in Fläche D, 2. Situation (mittlere Schicht)","Context":"Verwandte Dokumente: RM_1_1_7","Claim":"Dieses Dokument wurde Dank der Unterstützung von Memoriav erhalten.","RecordingLocation":"Lumbrein-Surin, Crestaulta","contributorCorporateBody":{"name":"ADG"},"genre":"Grabungsfotografie / Arbeitsfotografie / Sachfotografie","objectType":"photograph","medium":"[keine Information vorhanden]","imageFormatColorMode":"sw","imageFormatRemarks":"Album-Nr.: A4","identifierOriginal":"102683","identifierCallNumber":"RM_1_3_10","identifierMain":"ADG-102683","location":"Schweiz, Graubünden, Lumbrein-Surin, Crestaulta","rightsHolder":"Archäologischer Dienst Graubünden","accessPhsyical":"onsite","accessDigital":"public"}
\ No newline at end of file
......@@ -12,10 +12,12 @@
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:fedora="info:fedora/fedora-system:def/relations-external#"
xmlns:fedora-model="info:fedora/fedora-system:def/model#"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xslt="http://www.w3.org/1999/XSL/Transform">
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
xmlns="urn:ebu:metadata-schema:ebuCore_2012"
xpath-default-namespace="urn:ebu:metadata-schema:ebuCore_2012">
<xsl:output
indent="no"
indent="yes"
method="xml"
/>
......@@ -24,15 +26,12 @@
</xsl:template>-->
<xsl:template match="/">
<record>
<xsl:template match="coreMetadata">
<xsl:element name="record">
<!--<xsl:apply-templates select="test"/>
<xsl:apply-templates select="title, ns2:title, alternativeTitle, subject, description, format/essenceLocator, format/medium, type/*, references"/>-->
<xsl:apply-templates />
</record>
<!--<xsl:element name="record">
<xsl:apply-templates select="test"/>
<xsl:apply-templates select="title, ns2:title, alternativeTitle, subject, description, format/essenceLocator, format/medium, type/*, references"/>
</xsl:element>-->
</xsl:element>
</xsl:template>
<!-- content of child node is copied to parent node -->
......@@ -169,4 +168,4 @@
<xsl:template match="isMemberOf | rights[@typeLabel='Usage']"/>
</xsl:stylesheet>
</xsl:stylesheet>
\ 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