Commit 66c4e4be authored by Steinberg, Jan's avatar Steinberg, Jan
Browse files

xsl optimizations plus additional setSpec filter in xsl

parent 7efb1956
Loading
Loading
Loading
Loading
+46 −30
Original line number Diff line number Diff line
@@ -34,7 +34,22 @@
    <xsl:template match="/">
        <xsl:element name="bundle">
            <xsl:element name="metadata">
                <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>
@@ -137,13 +152,6 @@
          <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: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: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: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>
  </xsl:template>
  
    <xsl:template match="dc:subject[starts-with(.,'ddc:')]">