Commit af22223d authored by Steinberg, Jan's avatar Steinberg, Jan
Browse files

EJMI test and transformation xsl

parent f87e2c8d
......@@ -143,6 +143,92 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.other", "political unrest; violence; elections/voting; ethnic conflicts; comparative analysis") ) ); // test for replacing commas with semicolons
}
@Test
public void getSinglePublicationEjmi() throws IOException {
Map<String, String> map = new HashMap<>();
String oaiMarcXsltString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xslt/ejmi-oai_marc-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
map.put("oai_marc", oaiMarcXsltString);
String oaiDcXsltString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xslt/ejmi-oai_dc-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
map.put("oai_dc", oaiDcXsltString);
XsltTransformerOaiPmhBundlesStreamSource bss = new XsltTransformerOaiPmhBundlesStreamSource("https://mi-dnu.dp.ua/index.php/index/oai/", map);
Bundle bundle = bss.getBundle("oai:ojs.mi-dnu.dp.ua:article/2");
LOG.info("{}", bundle);
Set<Metadatum> metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
assertTrue( metadata.contains( new SimpleMetadatum("dc.type.stock", "article") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.type.document", "32") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.journal", "European Journal of Management Issues") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.pubstatus", "1") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Makohon, Y. V.") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Medvedkin, T. S.") ) );
assertEquals(2, metadata.stream().filter(m -> m.getKey().equals("dc.contributor.author") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.review", "1") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.description.review") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.date.issued", "2012") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "en", "In Circumstances that the global economic system to make the transition to a knowledge economy through innovative business models the knowledge gained status as a key product and became a major factor in the formation of competitive advantages of the subjects of world markets. The development of the scientific sphere intensified trade innovations and innovative products, based on the results of research and development. However, not all the subjects of scientific and technical products have sufficient financialresources to conduct basic research that can ensure the emergence of a fundamentally new development. This situation caused the amplification process of knowiedge transfer") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "ru", "В условиях перехода глобальных экономических систем к экономике знаний путем&nbsp; внедрения&nbsp; инновационных&nbsp; моделей&nbsp; хозяйствования&nbsp; знания&nbsp; приобретают&nbsp; статус&nbsp; ключевого&nbsp; товара&nbsp; и&nbsp; превращаются&nbsp; в&nbsp; важнейший&nbsp; фактор&nbsp; формирования&nbsp; конкурентных&nbsp; преимуществ&nbsp; субъектов&nbsp; мировых&nbsp; рынков.&nbsp; С&nbsp; развитием&nbsp; научной&nbsp; сферы интенсифицировалась торговля инновациями и инновационными продуктами, основой которых являются результаты НИОКР. При этом не все субъекты рынков научно-технической продукции располагают достаточными финансовыми ресурсами для проведения фундаментальных исследований, способных обеспечить появление принципиально новых разработок, что становится причиной интенсификации процесса трансфера знаний.") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "uk", "В умовах переходу глобальних економічних систем до економіки знань шляхом впровадження інноваційних моделей господарювання знання отримують статус ключового товару та перетворюються в найважливіший фактор формування конкурентних переваг суб’єктів світових ринків. З розвитком наукової сфери інтенсифікувалася торгівля інноваціями та інноваційними продуктами, основою яких є НДДКР. При цьому не всі суб’єкти ринків науково-технічної продукції мають у своєму розпорядженні достатньо фінансових ресурсів для проведення фундаментальних досліджень, здатних забезпечити виникнення принципово нових розробок, що стає причиною прискорення процесу трансферу знань.") ) );
assertEquals(3, metadata.stream().filter(m -> m.getKey().equals("dc.description.abstract") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.issn", "2523-451X") ) );
assertFalse( metadata.contains( new SimpleMetadatum("dc.identifier.issn", "2519-8564") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.url", "https://mi-dnu.dp.ua/index.php/MI/article/view/2/74") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.identifier.url") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.language", "uk") ) );
assertEquals(0, metadata.stream().filter(m -> m.getKey().equals("dc.source.volume") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.rights.licence", "16") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issue", "1") ) );
assertEquals(0, metadata.stream().filter(m -> m.getKey().equals("dc.source.issuetopic") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.pageinfo", "10-19") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.source.pageinfo") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title.alternative", "en", "International transfer of knowledge in a globalized world of economical condition") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title.alternative", "ru", "Международный трансфер знаний в условиях глобализации мировой экономики") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "uk", "Международный трансфер знаний в условиях глобализации мировой экономики") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://doi.org/10.15421/191202") ) );
assertTrue( metadata.contains( new SimpleMetadatum("internal.dda.reference", "https://mi-dnu.dp.ua/index.php/index/oai/@@oai:ojs.mi-dnu.dp.ua:article/2") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "MISC") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("internal.identifier.classoz", "10900") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.classoz", "10900") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("internal.identifier.ddc", "330") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.ddc", "330") ) );
assertTrue( metadata.contains( new SimpleMetadatum("internal.status", "formal und inhaltlich fertig erschlossen") ) );
// Set<InputStream> fileSet = bundle.getContents();
// assertEquals( 2, fileSet.size());
LOG.info("---------------------------------------");
// https://mi-dnu.dp.ua/index.php/index/oai?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:ojs.mi-dnu.dp.ua:article/186
bundle = bss.getBundle("oai:ojs.mi-dnu.dp.ua:article/186");
LOG.info("{}", bundle);
metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
assertTrue( metadata.contains( new SimpleMetadatum("dc.title.alternative", "en", "Identification of the theoretical aspects of enterprise reputation") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title.alternative", "ru", "Идентификация теоретических аспектов репутации предприятия") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "uk", "Ідентифікація теоретичних аспектів репутації підприємства") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.volume", "26") ) );
LOG.info("---------------------------------------");
// https://mi-dnu.dp.ua/index.php/index/oai?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:ojs.mi-dnu.dp.ua:article/70
bundle = bss.getBundle("oai:ojs.mi-dnu.dp.ua:article/70");
LOG.info("{}", bundle);
metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
assertTrue( metadata.contains( new SimpleMetadatum("dc.language", "uk") ) );
assertFalse( metadata.contains( new SimpleMetadatum("dc.language", "ru") ) );
}
@Test
public void getSinglePublicationJcca() throws IOException {
Map<String, String> map = new HashMap<>();
......
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:cc="http://www.d-nb.de/standards/cc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcmitype="http://purl.org/dc/dcmitype/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:ddb="http://www.d-nb.de/standards/ddb/"
xmlns:dini="http://www.d-nb.de/standards/xmetadissplus/type/"
xmlns:doi="http://www.d-nb.de/standards/doi/"
xmlns:hdl="http://www.d-nb.de/standards/hdl/"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
xmlns:nlm="http://dtd.nlm.nih.gov/publishing/2.3"
xmlns:oai="http://www.openarchives.org/OAI/2.0/"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:pc="http://www.d-nb.de/standards/pc/"
xmlns:thesis="http://www.ndltd.org/standards/metadata/etdms/1.0/"
xmlns:urn="http://www.d-nb.de/standards/urn/"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xMetaDiss="http://www.d-nb.de/standards/xmetadissplus/"
xmlns:xoai="http://www.lyncode.com/xoai"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:zoai="http://git.gesis.org/dda/zoai">
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<!-- <xsl:copy-of select="."/> -->
<!-- <xsl:message terminate="no">here is some message for stderr, e.g. <xsl:value-of select='text()' /> </xsl:message> -->
<!-- override default template -->
<xsl:template match="*" />
<xsl:template match="/">
<xsl:element name="bundle">
<xsl:element name="metadata">
<xsl:apply-templates select="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc" />
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template match="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc">
<xsl:apply-templates select="dc:title" />
<xsl:apply-templates select="dc:description[@xml:lang='en-US']" />
<xsl:apply-templates select="dc:description[@xml:lang='ru-RU']" />
<xsl:apply-templates select="dc:description[@xml:lang='uk-UA']" />
<xsl:apply-templates select="dc:language" />
<xsl:apply-templates select="dc:source[@xml:lang='en-US']" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^10\..*')]" />
<!--xsl:apply-templates select="dc:type[@xml:lang='en-US']" /-->
<xsl:apply-templates select="dc:relation" />
</xsl:template>
<xsl:template match="dc:relation">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.url'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:description[@xml:lang='uk-UA']">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( text() )" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'uk'"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:description[@xml:lang='ru-RU']">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( text() )" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'ru'"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:description[@xml:lang='en-US']">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( text() )" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'en'"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:language">
<xsl:if test="position()=1">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( text() )" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.language'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="$sanitizedLanguage"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="dc:identifier[matches(text(), '^10\..*')]">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.doi'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="concat('https://doi.org/', text())"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:source[@xml:lang='en-US']">
<xsl:variable name="pageinfo" select="tokenize( text(),'; ' )[last()]" />
<xsl:if test="$pageinfo != '' and matches($pageinfo, '^\d+(-\d+)?')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.pageinfo'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="$pageinfo"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="$pageinfo != '' and matches($pageinfo, '^\w\d+(-\w\d+)?')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.pageinfo'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="$pageinfo"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!--xsl:template match="dc:type[@xml:lang='en-US']">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.subject.other'"/>
<xsl:with-param name="language" select="'en'"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template-->
<xsl:template match="dc:title">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( @xml:lang )" />
<xsl:variable name="sanitizedMainLanguage" select="zoai:sanitizeLanguage( /oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc/dc:language[1] )" />
<xsl:choose>
<xsl:when test="$sanitizedLanguage = $sanitizedMainLanguage">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.title'"/>
<xsl:with-param name="language" select="$sanitizedLanguage"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$sanitizedLanguage = 'uk' and $sanitizedMainLanguage = ''">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.title'"/>
<xsl:with-param name="language" select="'uk'"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.title.alternative'"/>
<xsl:with-param name="language" select="$sanitizedLanguage"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="new-metadatum">
<xsl:param name="key" />
<xsl:param name="language" />
<xsl:param name="value" />
<xsl:element name="metadatum">
<xsl:element name="key">
<xsl:value-of select="$key" />
</xsl:element>
<xsl:if test="$language != ''">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage($language)" />
<xsl:element name="language">
<xsl:value-of select="$sanitizedLanguage" />
</xsl:element>
</xsl:if>
<xsl:element name="value">
<xsl:value-of select="$value" />
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:function name="zoai:sanitizeLanguage">
<xsl:param name="inputLanguage" />
<xsl:choose>
<xsl:when test="$inputLanguage = 'ger' or $inputLanguage = 'DE' or $inputLanguage = 'de-DE' or $inputLanguage = 'deu'">
<xsl:value-of select="'de'" />
</xsl:when>
<xsl:when test="$inputLanguage = 'eng' or $inputLanguage = 'EN' or $inputLanguage = 'en-US' or $inputLanguage = 'en-GB'">
<xsl:value-of select="'en'" />
</xsl:when>
<xsl:when test="$inputLanguage = 'ukr' or $inputLanguage = 'uk-UA'">
<xsl:value-of select="'uk'" />
</xsl:when>
<xsl:when test="$inputLanguage = 'rus' or $inputLanguage = 'ru-RU'">
<xsl:value-of select="'ru'" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$inputLanguage" />
</xsl:otherwise>
</xsl:choose>
</xsl:function>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:cc="http://www.d-nb.de/standards/cc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcmitype="http://purl.org/dc/dcmitype/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:ddb="http://www.d-nb.de/standards/ddb/"
xmlns:dini="http://www.d-nb.de/standards/xmetadissplus/type/"
xmlns:doi="http://www.d-nb.de/standards/doi/"
xmlns:hdl="http://www.d-nb.de/standards/hdl/"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
xmlns:nlm="http://dtd.nlm.nih.gov/publishing/2.3"
xmlns:oai="http://www.openarchives.org/OAI/2.0/"
xmlns:oai_marc="http://www.openarchives.org/OAI/1.1/oai_marc"
xmlns:pc="http://www.d-nb.de/standards/pc/"
xmlns:thesis="http://www.ndltd.org/standards/metadata/etdms/1.0/"
xmlns:urn="http://www.d-nb.de/standards/urn/"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xMetaDiss="http://www.d-nb.de/standards/xmetadissplus/"
xmlns:xoai="http://www.lyncode.com/xoai"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:zoai="http://git.gesis.org/dda/zoai"
>
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<!-- <xsl:message terminate="no">here is the tree at the current node <xsl:copy-of select="."/> </xsl:message> -->
<!-- <xsl:message terminate="no">here is some message for stderr, e.g. <xsl:value-of select='text()' /> </xsl:message> -->
<!--
<xsl:for-each select="./*">
<xsl:message terminate="no">a child=<xsl:value-of select="name()"/></xsl:message>
</xsl:for-each>
-->
<!-- override default template -->
<xsl:template match="*" />
<xsl:template match="/">
<xsl:element name="bundle">
<xsl:element name="metadata">
<xsl:variable name="ddaReference" select="concat(oai:OAI-PMH/oai:request[@verb='GetRecord']/text(), '@@', oai:OAI-PMH/oai:request[@verb='GetRecord']/@identifier)" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'internal.dda.reference'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="$ddaReference"/>
</xsl:call-template>
<xsl:apply-templates select="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_marc:oai_marc" />
<xsl:apply-templates select="oai:OAI-PMH/oai:GetRecord/oai:record/oai:header" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.type.stock'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'article'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.type.document'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'32'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'16'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.journal'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1507'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.pubstatus'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.publisher.country'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'MISC'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'ssoar.urn.registration'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'false'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.review'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'internal.identifier.classoz'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'10900'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.subject.classoz'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'10900'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.issn'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'2523-451X'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'internal.identifier.ddc'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'330'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.subject.ddc'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'330'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'internal.status'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'formal und inhaltlich fertig erschlossen'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template match="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_marc:oai_marc">
<xsl:apply-templates select="oai_marc:varfield[@id='022']/child::node()[@label='$a']"/>
<xsl:apply-templates select="oai_marc:varfield[@id='100']/child::node()[@label='a']"/>
<!--xsl:apply-templates select="oai_marc:varfield[@id='245']/child::node()[@label='a']"/-->
<xsl:apply-templates select="oai_marc:varfield[@id='520']/child::node()[@label='a']"/>
<!--xsl:apply-templates select="oai_marc:varfield[@id='546']/child::node()[@label='a']"/-->
<xsl:apply-templates select="oai_marc:varfield[@id='720']/child::node()[@label='a']"/>
<xsl:apply-templates select="oai_marc:varfield[@id='786']/child::node()[@label='n']"/>
<!--xsl:apply-templates select="oai_marc:varfield[@id='856']/child::node()[@label='u']"/-->
</xsl:template>
<!--xsl:template match="oai_marc:varfield[@id='022']/child::node()[@label='$a']">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.issn'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template-->
<xsl:template match="oai_marc:varfield[@id='100']/child::node()[@label='a']">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.contributor.author'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template>
<!--xsl:template match="oai_marc:varfield[@id='245']/child::node()[@label='a']">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.title'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template-->
<!--xsl:template match="oai_marc:varfield[@id='520']/child::node()[@label='a']">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'en'"/>
<xsl:with-param name="value" select="normalize-space(text())"/>
</xsl:call-template>
</xsl:template-->
<!--xsl:template match="oai_marc:varfield[@id='546']/child::node()[@label='a']">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.language'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="normalize-space(text())"/>
</xsl:call-template>
</xsl:template-->
<xsl:template match="oai_marc:varfield[@id='720']/child::node()[@label='a']">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.contributor.author'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="oai_marc:varfield[@id='786']/child::node()[@label='n']">
<xsl:if test="contains(text(), ' Том ')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.volume'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="replace(replace(text(), '^.* Том ', ''), ' .*$', '')"/>
</xsl:call-template>
</xsl:if>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.issue'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="replace(replace(text(), '^.*№ ', ''), ' +.*$', '')"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.date.issued'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="replace(replace(text(), '^.*\(', ''), '\).*$', '')"/>
</xsl:call-template>
</xsl:template>
<!--xsl:template match="oai_marc:varfield[@id='856']/child::node()[@label='u']">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.url'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template-->
<!-- guard against multiple set assignments such as 'region:ART' AND 'driver'
<xsl:if test="starts-with( text(), 'region:' )">
<xsl:choose>
<xsl:when test="text() = 'region:ART' or text() = 'region:LET'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.review'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.review'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'2'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>-->
<xsl:template name="new-metadatum">
<xsl:param name="key" />
<xsl:param name="language" />
<xsl:param name="value" />
<xsl:element name="metadatum">
<xsl:element name="key">
<xsl:value-of select="$key" />
</xsl:element>
<xsl:if test="$language != ''">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage($language)" />
<xsl:element name="language">
<xsl:value-of select="$sanitizedLanguage" />
</xsl:element>
</xsl:if>
<xsl:element name="value">
<xsl:value-of select="$value" />
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:function name="zoai:sanitizeLanguage">
<xsl:param name="inputLanguage" />
<xsl:choose>
<xsl:when test="$inputLanguage = 'ger' or $inputLanguage = 'DE' or $inputLanguage = 'de-DE' or $inputLanguage = 'deu'">
<xsl:value-of select="'de'" />
</xsl:when>
<xsl:when test="$inputLanguage = 'eng' or $inputLanguage = 'EN' or $inputLanguage = 'en-US' or $inputLanguage = 'en-GB'">