XSL files now in sync with future 1.7 series
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 6 May 2014 12:01:34 +0000 (14:01 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 6 May 2014 12:01:34 +0000 (14:01 +0200)
etc/cf.xsl
etc/solr-pz2.xsl

index 7796273..61edc04 100644 (file)
 
   <xsl:param name="medium" />
 
-  <!--
-    According to cf/builder/templates/parseTask.cff, connectors can
-    also generate a "medium" field, but that is ignored in this
-    stylesheet, the rule below instead using an XSLT parameter.
-    Should the data element be used in preference when it is included?
-  -->
-
+  <!-- Use medium parameter if given. Default to medium from connector -->
   <xsl:template match="/record">
     <pz:record>
       <pz:metadata type="medium">
index f6fa5dd..5a11a53 100644 (file)
   </xsl:template>
 
   <xsl:template name="string">
-      <pz:metadata>
-       <xsl:attribute  name="type">
-         <xsl:value-of select="../@name"/>
-       </xsl:attribute>
-       <xsl:choose>
-         <xsl:when test="../@name = 'medium' and string-length($medium) = 0">
-         </xsl:when>
-         <xsl:otherwise>
-           <xsl:value-of select="."/>
-         </xsl:otherwise>
-       </xsl:choose>
-      </pz:metadata>
+    <xsl:choose>
+      <xsl:when test="../@name = 'medium' and string-length($medium) &gt; 0">
+      </xsl:when>
+      <xsl:otherwise>
+       <pz:metadata>
+         <xsl:attribute  name="type">
+           <xsl:value-of select="../@name"/>
+         </xsl:attribute>
+         <xsl:value-of select="."/>
+       </pz:metadata>
+      </xsl:otherwise>
+    </xsl:choose>
   </xsl:template>
 
 </xsl:stylesheet>