Commit f5679ca2 authored by Gerrit Hübbers's avatar Gerrit Hübbers 🃏
Browse files

Add Transcript Verlag assets

parent 9587cf0f
package org.gesis.dda.publishing.domain.impl; package org.gesis.dda.publishing.domain.impl;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.IOException; import java.io.IOException;
import java.io.StringReader; import java.io.StringReader;
...@@ -90,15 +91,15 @@ public class XmlXsltBundlesStreamSourceTest { ...@@ -90,15 +91,15 @@ public class XmlXsltBundlesStreamSourceTest {
assertEquals( "xmlxslt-database-4711", underTest.getReference() ); assertEquals( "xmlxslt-bundlessource-4711", underTest.getReference() );
{ {
Bundle regierenBundle = underTest.getBundlesStream().filter(b -> b.getReference().equals("xmlxslt-database-4711@@f3ae7b1fec56419eaa3a34bed68232cb") ).findFirst().get(); Bundle regierenBundle = underTest.getBundlesStream().filter(b -> b.getReference().equals("xmlxslt-bundlessource-4711@@f3ae7b1fec56419eaa3a34bed68232cb") ).findFirst().get();
LOG.info("regierenBundle=\n{}", regierenBundle); LOG.info("regierenBundle=\n{}", regierenBundle);
Metadatum regierenBundleMetadatumInternalDdaReference = regierenBundle.getMetadata().stream().filter(m -> m.getKey().equals("internal.dda.reference")).findFirst().get(); Metadatum regierenBundleMetadatumInternalDdaReference = regierenBundle.getMetadata().stream().filter(m -> m.getKey().equals("internal.dda.reference")).findFirst().get();
assertEquals("xmlxslt-database-4711@@f3ae7b1fec56419eaa3a34bed68232cb", regierenBundleMetadatumInternalDdaReference.getValue() ); assertEquals("xmlxslt-bundlessource-4711@@f3ae7b1fec56419eaa3a34bed68232cb", regierenBundleMetadatumInternalDdaReference.getValue() );
Stream<Metadatum> regierenBundleMetadataDcContributorAuthor = regierenBundle.getMetadata().stream().filter(m -> m.getKey().equals("dc.contributor.author")); Stream<Metadatum> regierenBundleMetadataDcContributorAuthor = regierenBundle.getMetadata().stream().filter(m -> m.getKey().equals("dc.contributor.author"));
assertEquals(1, regierenBundleMetadataDcContributorAuthor.count() ); assertEquals(1, regierenBundleMetadataDcContributorAuthor.count() );
...@@ -161,7 +162,7 @@ public class XmlXsltBundlesStreamSourceTest { ...@@ -161,7 +162,7 @@ public class XmlXsltBundlesStreamSourceTest {
} }
{ {
Bundle bildungsforschungBundle = underTest.getBundlesStream().filter(b -> b.getReference().equals("xmlxslt-database-4711@@e8d053068a59466486680c6c90ee459b") ).findFirst().get(); Bundle bildungsforschungBundle = underTest.getBundlesStream().filter(b -> b.getReference().equals("xmlxslt-bundlessource-4711@@e8d053068a59466486680c6c90ee459b") ).findFirst().get();
LOG.info("regierenBundle=\n{}", bildungsforschungBundle); LOG.info("regierenBundle=\n{}", bildungsforschungBundle);
...@@ -259,4 +260,114 @@ public class XmlXsltBundlesStreamSourceTest { ...@@ -259,4 +260,114 @@ public class XmlXsltBundlesStreamSourceTest {
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.type.stock")).count() ); assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.type.stock")).count() );
assertEquals("article", metadata.stream().filter(m -> m.getKey().equals("dc.type.stock")).findFirst().get().getValue() ); assertEquals("article", metadata.stream().filter(m -> m.getKey().equals("dc.type.stock")).findFirst().get().getValue() );
} }
@Test
public void testTranscriptVerlagOnix() throws IOException {
String onixXmlString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xml/onix/transcript_dg.201808021513.onix21-fixed.xml"), StandardCharsets.UTF_8);
LOG.info("onixXmlString={}", onixXmlString);
String xsltString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xslt/onix-transcript-2-xmlbundles.xslt"), StandardCharsets.UTF_8);
LOG.info("xsltString={}", xsltString);
XmlXsltBundlesStreamSource underTest = new XmlXsltBundlesStreamSource(onixXmlString, xsltString, 1234);
Set<Metadatum> metadata = underTest.getAllMetadata("10039-9783839437124");
Metadatum internalDdaReference = metadata.stream().filter(m -> m.getKey().equals("internal.dda.reference")).findFirst().get();
assertEquals("xmlxslt-bundlessource-1234@@10039-9783839437124", internalDdaReference.getValue() );
Stream<Metadatum> dcContributorAuthor = metadata.stream().filter(m -> m.getKey().equals("dc.contributor.author"));
assertEquals(1, dcContributorAuthor.count() );
assertEquals("Hildebrand, Marius", metadata.stream().filter(m -> m.getKey().equals("dc.contributor.author")).findFirst().get().getValue() );
Stream<Metadatum> dcContributorEditor = metadata.stream().filter(m -> m.getKey().equals("dc.contributor.editor"));
assertEquals(0, dcContributorEditor.count() );
Stream<Metadatum> dcDateIssued = metadata.stream().filter(m -> m.getKey().equals("dc.date.issued"));
assertEquals(1, dcDateIssued.count() );
assertEquals("2017", metadata.stream().filter(m -> m.getKey().equals("dc.date.issued")).findFirst().get().getValue() );
Stream<Metadatum> regierenBundleMetadataDcIdentifierIsbn = metadata.stream().filter(m -> m.getKey().equals("dc.identifier.isbn"));
assertEquals(1, regierenBundleMetadataDcIdentifierIsbn.count() );
assertEquals("978-3-8394-3712-4", metadata.stream().filter(m -> m.getKey().equals("dc.identifier.isbn")).findFirst().get().getValue() );
Stream<Metadatum> regierenBundleMetadataDcLanguage = metadata.stream().filter(m -> m.getKey().equals("dc.language"));
assertEquals(1, regierenBundleMetadataDcLanguage.count() );
assertEquals("de", metadata.stream().filter(m -> m.getKey().equals("dc.language")).findFirst().get().getValue() );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.publisher")).count() );
assertEquals("transcript Verlag", metadata.stream().filter(m -> m.getKey().equals("dc.publisher")).findFirst().get().getValue() );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title")).count() );
assertEquals("Rechtspopulismus und Hegemonie: Der Aufstieg der SVP und die diskursive Transformation der politischen Schweiz", metadata.stream().filter(m -> m.getKey().equals("dc.title")).findFirst().get().getValue() );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.publisher.country")).count() );
assertEquals("DEU", metadata.stream().filter(m -> m.getKey().equals("dc.publisher.country")).findFirst().get().getValue() );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.publisher.city")).count() );
assertEquals("Opladen", metadata.stream().filter(m -> m.getKey().equals("dc.publisher.city")).findFirst().get().getValue() );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.identifier.doi")).count() );
assertEquals("https://doi.org/10.14361/9783839437124", metadata.stream().filter(m -> m.getKey().equals("dc.identifier.doi")).findFirst().get().getValue() );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.source.pageinfo")).count() );
assertEquals("398", metadata.stream().filter(m -> m.getKey().equals("dc.source.pageinfo")).findFirst().get().getValue() );
Set<Metadatum> dcSubjectOtherMetadata = metadata.stream().filter(m -> m.getKey().equals("dc.subject.other")).collect( Collectors.toSet() );
assertEquals(26, dcSubjectOtherMetadata.size() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Populismus".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Populism".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "SVP".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Schweiz".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Hegemonie".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Ernesto Laclau".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Rechtspopulismus".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Populismustheorie".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Diskursive Transformation".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Kulturrassismus".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Politik".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Politische Parteien".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Politische Soziologie".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Politische Ideologien".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Politikwissenschaft".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Switzerland".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Hegemony".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Right-wing-populism".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Theory of Populism".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Discursive Transformation".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Cultural Racism".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Politics".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Political Parties".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Political Sociology".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Political Ideologies".equals( m.getValue() ) ).count() );
assertEquals(1, dcSubjectOtherMetadata.stream().filter( m -> "Political Science".equals( m.getValue() ) ).count() );
Set<Metadatum> dcDescriptionAbstractMetadata = metadata.stream().filter(m -> m.getKey().equals("dc.description.abstract")).collect( Collectors.toSet() );
dcDescriptionAbstractMetadata.stream().map(Object::toString).forEach(LOG::info);
assertEquals(2, dcDescriptionAbstractMetadata.size() );
Metadatum expectedAbstractEn = new SimpleMetadatum("dc.description.abstract", "en", "<p>This study shines a new light on the rise of the Swiss People's Party that goes beyond the customary populism analyses centred around socio-structural issues and ideology critiques.</p>");
assertTrue( dcDescriptionAbstractMetadata.contains(expectedAbstractEn) );
Metadatum expectedAbstractDe = new SimpleMetadatum("dc.description.abstract", "de", "<p>Die Schweizerische Volkspartei ist binnen 25 Jahren von einer braven Klientelpartei zum politischen Taktgeber avanciert. Sie ist nicht nur die stärkste politische Kraft des Landes, sondern auch ein Vorbild des europäischen Rechtspopulismus.<br />Marius Hildebrand beleuchtet die Karriere der SVP mithilfe der formalen Populismustheorie Ernesto Laclaus. Im Unterschied zu sozialstrukturellen und ideologiekritischen Analysen, die den Populismus als Anomalie perspektivieren, wird er hier als Effekt einer diskursiven Transformation der politischen Schweiz betrachtet.</p>");
assertTrue( dcDescriptionAbstractMetadata.contains(expectedAbstractDe) );
assertEquals(0, metadata.stream().filter(m -> m.getKey().equals("dc.source.series")).count() );
assertEquals(0, metadata.stream().filter(m -> m.getKey().equals("dc.source.edition")).count() );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.type.stock")).count() );
assertEquals("article", metadata.stream().filter(m -> m.getKey().equals("dc.type.stock")).findFirst().get().getValue() );
}
} }
...@@ -169,6 +169,14 @@ ...@@ -169,6 +169,14 @@
</xsl:call-template> </xsl:call-template>
</xsl:template> </xsl:template>
<xsl:template match="productidentifier[b221 = '15']">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.isbn'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="java:org.gesis.dda.xslt.XsltUtil.hyphenizeIsbn( b244/text() )" />
</xsl:call-template>
</xsl:template>
<xsl:template match="productidentifier[b221 = '06']"> <xsl:template match="productidentifier[b221 = '06']">
<xsl:call-template name="new-metadatum"> <xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.doi'"/> <xsl:with-param name="key" select="'dc.identifier.doi'"/>
...@@ -279,226 +287,6 @@ ...@@ -279,226 +287,6 @@
</xsl:template> </xsl:template>
<xsl:template match="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/nlm:article">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( @xml:lang )" />
<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:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="oai:OAI-PMH/oai:GetRecord/oai:record/oai:header">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/nlm:article/nlm:front">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:journal-meta">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:issn[@pub-type='epub']">
<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="nlm:article-meta">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:contrib-group">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:contrib[@contrib-type='author']">
<xsl:variable name="fullName" select="concat( nlm:name/nlm:surname/text(), ', ', nlm:name/nlm:given-names/text() )" />
<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="$fullName"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:article-id[@pub-id-type='doi']">
<xsl:variable name="doi" select="concat( 'https://doi.org/', text() )" />
<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="$doi"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:pub-date[@pub-type='collection']">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:year">
<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="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:abstract-trans">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage(@xml:lang)" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="$sanitizedLanguage"/>
<xsl:with-param name="value" select="nlm:p/text()"/>
</xsl:call-template>
<xsl:variable name="maybeUrn" select="zoai:extractUrnFromFqsAbstract( nlm:p/text() )" />
<xsl:if test="$maybeUrn != ''">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.urn'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="$maybeUrn"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="nlm:self-uri[ not(@content-type) ]">
<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="@xlink:href"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:permissions">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="nlm:license">
<xsl:choose>
<xsl:when test="@xlink:href = 'http://creativecommons.org/licenses/by/4.0'">
<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:when>
<xsl:when test="@xlink:href = 'http://creativecommons.org/licenses/by-nc-nd/4.0'">
<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="'20'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@xlink:href = 'http://creativecommons.org/licenses/by-nc/4.0'">
<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="'32'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<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="@xlink:href"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="nlm:issue">
<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="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:issue-title">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.issuetopic'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:volume">
<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="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="nlm:kwd-group">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="/oai:OAI-PMH/oai:GetRecord/oai:record/oai:header/oai:setSpec">
<!-- http://www.qualitative-research.net/index.php/fqs/oai?verb=ListSets -->
<!-- http://www.qualitative-research.net/index.php/fqs/about/editorialPolicies#peerReviewProcess -->
<!-- guard against multiple set assignments such as 'fqsregion:ART' AND 'ec_fundedresources' -->
<xsl:if test="starts-with( text(), 'fqs:' )">
<xsl:choose>
<xsl:when test="text() = 'fqs:REV' or text() = 'fqs:U22' or text() = 'fqs:U23' or text() = 'fqs:U24'">
<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="'recension'"/>
</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="'23'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="text() = 'fqs:CONF'">
<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="'16'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<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:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template name="new-metadatum"> <xsl:template name="new-metadatum">
<xsl:param name="key" /> <xsl:param name="key" />
<xsl:param name="language" /> <xsl:param name="language" />
......
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.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: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"
xmlns:java="http://xml.apache.org/xalan/java"
>
<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:param name="bundlesSourceReference"/>
<xsl:param name="util"/>
<xsl:template match="/">
<xsl:element name="bundles">
<xsl:element name="reference" >
<xsl:value-of select="$bundlesSourceReference" />
</xsl:element>
<xsl:apply-templates select="ONIXmessage/product" />
</xsl:element>
</xsl:template>
<xsl:template match="ONIXmessage/product" >
<xsl:element name="bundle">
<xsl:element name="metadata">
<xsl:apply-templates select="contributor/b037" />
<xsl:apply-templates select="a001" />
<xsl:apply-templates select="b003" />
<xsl:apply-templates select="productidentifier" />
<xsl:apply-templates select="language" />
<xsl:apply-templates select="publisher" />
<xsl:apply-templates select="title" />
<xsl:apply-templates select="b083" />
<xsl:apply-templates select="b255" />
<xsl:apply-templates select="mainsubject" />
<xsl:apply-templates select="subject" />
<xsl:apply-templates select="othertext" />
<xsl:apply-templates select="series" />
<xsl:apply-templates select="b057" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.publisher.city'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'Opladen'"/>
</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="'DEU'"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="contributor[b035 = 'B01']/b037">
<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="'collection'" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<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:otherwise>
</xsl:choose>
<!--
<xsl:apply-templates select="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/nlm:article" />
<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.source.journal'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'132'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'ssoar.contributor.institution'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'FQS'"/>
</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="'DEU'"/>
</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:element>
</xsl:element>
</xsl:template>
<xsl:template match="contributor[b035 = 'A01']/b037">
<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>