XSL files now in sync with future 1.7 series
[pazpar2-moved-to-github.git] / etc / solr-pz2.xsl
index a2b33e0..5a11a53 100644 (file)
 
   <xsl:template match="doc">
     <pz:record>
+      <xsl:if test="string-length($medium) &gt; 0">
+        <pz:metadata type="medium">
+           <xsl:value-of select="$medium"/>
+        </pz:metadata>
+      </xsl:if>
       <xsl:apply-templates></xsl:apply-templates>
     </pz:record>
   </xsl:template>
 
+  <xsl:template match="float[@name]">
+    <pz:metadata>
+       <xsl:attribute  name="type">
+         <xsl:value-of select="@name"/>
+       </xsl:attribute>
+       <xsl:value-of select="."/>
+    </pz:metadata>
+  </xsl:template>
+
   <xsl:template match="str[@name]">
     <pz:metadata>
        <xsl:attribute  name="type">
     </pz:metadata>
   </xsl:template>
 
+  <xsl:template match="date[@name]">
+    <pz:metadata>
+       <xsl:attribute  name="type">
+         <xsl:value-of select="@name"/>
+       </xsl:attribute>
+       <xsl:value-of select="."/>
+    </pz:metadata>
+  </xsl:template>
+
   <xsl:template match="arr">
     <xsl:for-each select="str">
       <xsl:call-template name="string"/>
   </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:value-of select="$medium"/>
-         </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>