Commit 66c4e4be by Steinberg, Jan

xsl optimizations plus additional setSpec filter in xsl

parent 7efb1956
......@@ -34,7 +34,22 @@
<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:variable name="sets">
<xsl:for-each select="//oai:setSpec" >
<xsl:value-of select="text()"/>
<xsl:text> ; </xsl:text>
</xsl:for-each>
</xsl:variable>
<xsl:choose>
<xsl:when test="not(contains($sets, '10419_48639 ;'))" >
<xsl:value-of select="error(QName('','filteraway'), 'is not in set 10419_48639')" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="oai:OAI-PMH/oai:GetRecord/oai:record/oai:metadata/oai_dc:dc" />
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:element>
</xsl:template>
......@@ -136,14 +151,7 @@
<xsl:with-param name="key" select="'dc.source.series'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="substring-before(substring-after(., 'Series: '), ' ;')"/>
</xsl:call-template>
<xsl:if test="/OAI-PMH/GetRecord/record/metadata/oai_dc:dc/dc:type[starts-with(.,'doc-type')] != 'doc-type:book'">
<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="'381'"/>
</xsl:call-template>
</xsl:if>
</xsl:call-template>
<xsl:if test="contains(., ' ; ')">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.volume'"/>
......@@ -590,27 +598,35 @@
</xsl:template>
<xsl:template match="dc:publisher">
<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:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.publisher'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="normalize-space(substring-after(text(), ': '))"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.publisher'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="normalize-space(text())"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not(//dc:type/text() = 'doc-type:article')">
<xsl:choose>
<xsl:when test="contains(text(),'Wissenschaftszentrum Berlin')">
<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="'381'"/>
</xsl:call-template>
<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="Berlin"/>
</xsl:call-template>
</xsl:when>
<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:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.publisher'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="normalize-space(substring-after(text(), ': '))"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="dc:subject[starts-with(.,'ddc:')]">
......
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