Towards PAZ-996.
[pazpar2-moved-to-github.git] / etc / xsl / solr-pz2.xsl
index 5a11a53..50a2a89 100644 (file)
          </xsl:attribute>
          <xsl:value-of select="."/>
        </pz:metadata>
+       <xsl:if test="../@name='license_url'">
+        <pz:metadata type="license_name">
+         <xsl:choose>
+          <xsl:when test=". = 'http://creativecommons.org/licenses/by/4.0'">
+           CC By
+          </xsl:when>
+          <xsl:when test=". = 'http://creativecommons.org/licenses/by-nd/4.0'">
+           CC By-ND
+          </xsl:when>
+          <xsl:when test=". = 'http://creativecommons.org/licenses/by-nd-sa/4.0'">
+           CC By-ND-SA
+          </xsl:when>
+          <xsl:when test=". = 'http://creativecommons.org/licenses/by-nc/4.0'">
+           CC By-NC
+          </xsl:when>
+          <xsl:when test=". = 'http://creativecommons.org/licenses/by-nc-nd/4.0'">
+           CC By-NC-ND
+          </xsl:when>
+          <xsl:otherwise>
+           [unknown]
+          </xsl:otherwise>
+         </xsl:choose>
+        </pz:metadata>
+       </xsl:if>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>