Changes to 'item' data by NE and quinn
[pazpar2-moved-to-github.git] / etc / cf.xsl
index b081eb9..959c82c 100644 (file)
     </pz:metadata>
   </xsl:template>
 
-  <xsl:template match="available">
+  <xsl:template match="item">
+    <pz:metadata type="locallocation">
+      <xsl:choose>
+       <xsl:when test="string-length(location)">
+         <xsl:value-of select="location"/>
+       </xsl:when>
+       <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+      </xsl:choose>
+    </pz:metadata>
+    <pz:metadata type="callnumber">
+      <xsl:choose>
+       <xsl:when test="string-length(callno)">
+         <xsl:value-of select="callno"/>
+       </xsl:when>
+       <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+      </xsl:choose>
+    </pz:metadata>
     <pz:metadata type="available">
-      <xsl:value-of select="."/>
+      <xsl:choose>
+       <xsl:when test="string-length(available)">
+         <xsl:value-of select="available"/>
+       </xsl:when>
+       <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+      </xsl:choose>
+    </pz:metadata>
+    <pz:metadata type="publicnote">
+      <xsl:choose>
+       <xsl:when test="string-length(publicnote)">
+         <xsl:value-of select="publicnote"/>
+       </xsl:when>
+       <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+      </xsl:choose>
     </pz:metadata>
   </xsl:template>
 
     </pz:metadata>
   </xsl:template>
 
-  <xsl:template match="location">
-    <pz:metadata type="location">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="callno">
-    <pz:metadata type="callno">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
   <xsl:template match="thumburl">
     <pz:metadata type="thumburl">
       <xsl:value-of select="."/>