Commit 99d03b9d authored by Fischer, Tim's avatar Fischer, Tim
Browse files

Added RatSWD sets

parent 1b8fc4f0
......@@ -62,6 +62,17 @@
<xsl:when test="contains($sets, 'col_10419_102943 ;')" >
<xsl:apply-templates select="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc" mode="ARLForMono"/>
</xsl:when>
<xsl:when test="contains($sets, 'col_10419_224180 ;')" >
<xsl:apply-templates select="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc" mode="ratSWD_output_series"/>
</xsl:when>
<xsl:when test="contains($sets, 'col_10419_43587 ;')" >
<xsl:apply-templates select="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc" mode="ratSWD_research_notes"/>
</xsl:when>
<xsl:when test="contains($sets, 'col_10419_40025 ;')" >
<xsl:apply-templates select="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc" mode="ratSWD_working_paper"/>
</xsl:when>
<xsl:otherwise>
<!-- xsl:value-of select="error(QName('','filteraway'), 'is not in relevant sets')" / -->
<xsl:call-template name="filterAwayElement" />
......@@ -2377,7 +2388,847 @@
</xsl:template>
<!-- And now comes the ARL Positionspapiere -->
<!-- And here follows ratSWD_output_series -->
<xsl:template match="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc" mode="ratSWD_output_series">
<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.contributor.corporateeditor'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'604'"/>
</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="'2'"/>
</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:apply-templates select="dc:type[@xml:lang='en-US']" /-->
<xsl:apply-templates select="dc:title" mode="ratSWD_output_series" />
<xsl:apply-templates select="dc:description" mode="ratSWD_output_series" />
<xsl:apply-templates select="dc:language" mode="ratSWD_output_series" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^http.*')]" mode="ratSWD_output_series" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^doi.*')]" mode="ratSWD_output_series" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^urn.*') and not(matches(text(), '^.*isbn:\d+.*'))]" mode="ratSWD_output_series" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^.*isbn:\d+.*')]" mode="ratSWD_output_series"/>
<xsl:apply-templates select="dc:type" mode="ratSWD_output_series" />
<xsl:apply-templates select="dc:relation" mode="ratSWD_output_series" />
<xsl:apply-templates select="dc:creator" mode="ratSWD_output_series" />
<xsl:apply-templates select="dc:date" mode="ratSWD_output_series"/>
<xsl:apply-templates select="dc:publisher" mode="ratSWD_output_series" />
<xsl:apply-templates select="dc:subject[starts-with(.,'ddc:')]" mode="ratSWD_output_series" />
<xsl:apply-templates select="dc:subject[not(starts-with(.,'ddc:'))]" mode="ratSWD_output_series" />
<xsl:apply-templates select="dc:rights" />
</xsl:template>
<xsl:template match="dc:description" mode="ratSWD_output_series">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( ../dc:language/text() )" />
<xsl:choose>
<xsl:when test="position() = 1 and $sanitizedLanguage = 'de'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'de'"/>
<xsl:with-param name="value" select="normalize-space(replace(text(),'[»«]','&quot;'))"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="position() = 1 and $sanitizedLanguage = 'en'">
<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(replace(text(),'[»«]','&quot;'))"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="position() != 1 and $sanitizedLanguage = 'de'">
<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(replace(text(),'[»«]','&quot;'))"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="position() != 1 and $sanitizedLanguage = 'en'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'de'"/>
<xsl:with-param name="value" select="normalize-space(replace(text(),'[»«]','&quot;'))"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="dc:date" mode="ratSWD_output_series">
<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="substring(text(),1,4)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:creator" mode="ratSWD_output_series">
<xsl:choose>
<xsl:when test="contains(text(),'Akademie für Raumforschung und Landesplanung')">
<!-- DO nothing! It is in anyway. -->
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.contributor.editor'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.series'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="RatSWD Output Series"/>
</xsl:call-template>
<xsl:template match="dc:relation" mode="ratSWD_output_series">
<xsl:if test="starts-with(., 'Series: ')">
<xsl:if test="contains(., ' ; ')">
<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="normalize-space(replace(substring-after(., ' ; '), 'No.',''))"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="dc:language" mode="ratSWD_output_series">
<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(), '^http.*')]" mode="ratSWD_output_series">
<xsl:if test="not(contains(text(), 'handle'))">
<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:if>
<xsl:if test="contains(text(), 'handle')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.handle'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="replace(text(),'http:','https:')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="dc:identifier[matches(text(), '^doi.*')]" mode="ratSWD_output_series">
<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:choose>
<xsl:when test="contains(.,'doi.org')">
<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="text()"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<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/', substring-after(text(), 'doi:'))"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="dc:identifier[matches(text(), '^urn.*') and not(matches(text(), '^.*isbn:\d+.*'))]" mode="ratSWD_output_series">
<xsl:choose>
<xsl:when test="contains(.,'https://nbn-resolving.org')">
<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="substring-after(text(),'nbn-resolving.org/')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<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="text()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="dc:identifier[matches(text(), '^.*isbn:\d+.*')]" mode="ratSWD_output_series">
<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="substring-after(text(), 'isbn:')"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:type" mode="ratSWD_output_series">
<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="'monograph'"/>
</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="'3'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:publisher" mode="ratSWD_output_series">
<xsl:if test="not(//dc:type/text() = 'doc-type:article')">
<xsl:choose>
<xsl:when test="contains(text(), ': ')">
<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="substring-before(text(), ': ')"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="dc:subject[starts-with(.,'ddc:')]" mode="ratSWD_output_series">
<xsl:if test="starts-with(.,'ddc:')">
<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="substring-after(., 'ddc:')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="dc:subject[not(starts-with(.,'ddc:'))]" mode="ratSWD_output_series">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.subject.other'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:title" mode="ratSWD_output_series">
<!--xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( @xml:lang )" /-->
<xsl:variable name="sanitizedMainLanguage" select="zoai:sanitizeLanguage( ../dc:language[1] )" />
<xsl:variable name="theOtherLanguage">
<xsl:choose>
<xsl:when test="$sanitizedMainLanguage = 'de'"><xsl:text>en</xsl:text></xsl:when>
<xsl:otherwise><xsl:text>de</xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($sanitizedMainLanguage) > 0 and position() = 1">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.title'"/>
<xsl:with-param name="language" select="$sanitizedMainLanguage"/>
<xsl:with-param name="value" select="normalize-space(replace(text(),'[»«]','&quot;'))"/>
</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="$theOtherLanguage"/>
<xsl:with-param name="value" select="normalize-space(replace(text(),'[»«]','&quot;'))"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- And here follows ratSWD_research_notes -->
<xsl:template match="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc" mode="ratSWD_research_notes">
<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.contributor.corporateeditor'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'604'"/>
</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="'2'"/>
</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:apply-templates select="dc:type[@xml:lang='en-US']" /-->
<xsl:apply-templates select="dc:title" mode="ratSWD_research_notes" />
<xsl:apply-templates select="dc:description" mode="ratSWD_research_notes" />
<xsl:apply-templates select="dc:language" mode="ratSWD_research_notes" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^http.*')]" mode="ratSWD_research_notes" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^doi.*')]" mode="ratSWD_research_notes" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^urn.*') and not(matches(text(), '^.*isbn:\d+.*'))]" mode="ratSWD_research_notes" />
<xsl:apply-templates select="dc:identifier[matches(text(), '^.*isbn:\d+.*')]" mode="ratSWD_research_notes"/>
<xsl:apply-templates select="dc:type" mode="ratSWD_research_notes" />
<xsl:apply-templates select="dc:relation" mode="ratSWD_research_notes" />
<xsl:apply-templates select="dc:creator" mode="ratSWD_research_notes" />
<xsl:apply-templates select="dc:date" mode="ratSWD_research_notes"/>
<xsl:apply-templates select="dc:publisher" mode="ratSWD_research_notes" />
<xsl:apply-templates select="dc:subject[starts-with(.,'ddc:')]" mode="ratSWD_research_notes" />
<xsl:apply-templates select="dc:subject[not(starts-with(.,'ddc:'))]" mode="ratSWD_research_notes" />
<xsl:apply-templates select="dc:rights" />
</xsl:template>
<xsl:template match="dc:description" mode="ratSWD_research_notes">
<xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( ../dc:language/text() )" />
<xsl:choose>
<xsl:when test="position() = 1 and $sanitizedLanguage = 'de'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'de'"/>
<xsl:with-param name="value" select="normalize-space(replace(text(),'[»«]','&quot;'))"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="position() = 1 and $sanitizedLanguage = 'en'">
<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(replace(text(),'[»«]','&quot;'))"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="position() != 1 and $sanitizedLanguage = 'de'">
<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(replace(text(),'[»«]','&quot;'))"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="position() != 1 and $sanitizedLanguage = 'en'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'de'"/>
<xsl:with-param name="value" select="normalize-space(replace(text(),'[»«]','&quot;'))"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="dc:date" mode="ratSWD_research_notes">
<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="substring(text(),1,4)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:creator" mode="ratSWD_research_notes">
<xsl:choose>
<xsl:when test="contains(text(),'Akademie für Raumforschung und Landesplanung')">
<!-- DO nothing! It is in anyway. -->
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.contributor.editor'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.series'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="RatSWD Research Notes"/>
</xsl:call-template>
<xsl:template match="dc:relation" mode="ratSWD_research_notes">
<xsl:if test="starts-with(., 'Series: ')">
<xsl:if test="contains(., ' ; ')">
<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="normalize-space(replace(substring-after(., ' ; '), 'No.',''))"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="dc:language" mode="ratSWD_research_notes">
<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(), '^http.*')]" mode="ratSWD_research_notes">
<xsl:if test="not(contains(text(), 'handle'))">
<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:if>
<xsl:if test="contains(text(), 'handle')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.handle'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="replace(text(),'http:','https:')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="dc:identifier[matches(text(), '^doi.*')]" mode="ratSWD_research_notes">
<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:choose>
<xsl:when test="contains(.,'doi.org')">
<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="text()"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<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/', substring-after(text(), 'doi:'))"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="dc:identifier[matches(text(), '^urn.*') and not(matches(text(), '^.*isbn:\d+.*'))]" mode="ratSWD_research_notes">
<xsl:choose>
<xsl:when test="contains(.,'https://nbn-resolving.org')">
<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="substring-after(text(),'nbn-resolving.org/')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<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="text()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="dc:identifier[matches(text(), '^.*isbn:\d+.*')]" mode="ratSWD_research_notes">
<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="substring-after(text(), 'isbn:')"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:type" mode="ratSWD_research_notes">
<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="'monograph'"/>
</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="'3'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:publisher" mode="ratSWD_research_notes">
<xsl:if test="not(//dc:type/text() = 'doc-type:article')">
<xsl:choose>
<xsl:when test="contains(text(), ': ')">
<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="substring-before(text(), ': ')"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="dc:subject[starts-with(.,'ddc:')]" mode="ratSWD_research_notes">
<xsl:if test="starts-with(.,'ddc:')">
<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="substring-after(., 'ddc:')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="dc:subject[not(starts-with(.,'ddc:'))]" mode="ratSWD_research_notes">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.subject.other'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:title" mode="ratSWD_research_notes">
<!--xsl:variable name="sanitizedLanguage" select="zoai:sanitizeLanguage( @xml:lang )" /-->
<xsl:variable name="sanitizedMainLanguage" select="zoai:sanitizeLanguage( ../dc:language[1] )" />
<xsl:variable name="theOtherLanguage">
<xsl:choose>
<xsl:when test="$sanitizedMainLanguage = 'de'"><xsl:text>en</xsl:text></xsl:when>
<xsl:otherwise><xsl:text>de</xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($sanitizedMainLanguage) > 0 and position() = 1">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.title'"/>
<xsl:with-param name="language" select="$sanitizedMainLanguage"/>
<xsl:with-param name="value" select="normalize-space(replace(text(),'[»«]','&quot;'))"/>
</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="$theOtherLanguage"/>
<xsl:with-param name="value" select="normalize-space(replace(text(),'[»«]','&quot;'))"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- And here follows ratSWD_working_paper -->