Part of PAZ-996.
authorMike Taylor <mike@indexdata.com>
Fri, 27 Mar 2015 14:10:06 +0000 (14:10 +0000)
committerMike Taylor <mike@indexdata.com>
Fri, 27 Mar 2015 14:10:06 +0000 (14:10 +0000)
Use XPath's starts-with() function for detecting Creative Commons
licence URIs, so that versions prior to 4.0 are recognised. Catches
two instances of CC By-NC-ND v3.0 in the East London data.

etc/xsl/solr-pz2.xsl

index 50a2a89..c88b1ed 100644 (file)
        <xsl:if test="../@name='license_url'">
         <pz:metadata type="license_name">
          <xsl:choose>
-          <xsl:when test=". = 'http://creativecommons.org/licenses/by/4.0'">
+          <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by/')">
            CC By
           </xsl:when>
-          <xsl:when test=". = 'http://creativecommons.org/licenses/by-nd/4.0'">
+          <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nd/')">
            CC By-ND
           </xsl:when>
-          <xsl:when test=". = 'http://creativecommons.org/licenses/by-nd-sa/4.0'">
+          <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nd-sa/')">
            CC By-ND-SA
           </xsl:when>
-          <xsl:when test=". = 'http://creativecommons.org/licenses/by-nc/4.0'">
+          <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nc/')">
            CC By-NC
           </xsl:when>
-          <xsl:when test=". = 'http://creativecommons.org/licenses/by-nc-nd/4.0'">
+          <xsl:when test="starts-with(., 'http://creativecommons.org/licenses/by-nc-nd/')">
            CC By-NC-ND
           </xsl:when>
           <xsl:otherwise>