Move uniform fields aftter date
authorDennis Schafroth <dennis@indexdata.com>
Wed, 22 Feb 2012 15:25:00 +0000 (16:25 +0100)
committerDennis Schafroth <dennis@indexdata.com>
Wed, 22 Feb 2012 15:25:00 +0000 (16:25 +0100)
src/org/marc4j/test/resources/marc21.xsl

index a6cdf84..1aec6b9 100644 (file)
        </pz:metadata>
       </xsl:for-each>
 
-      <xsl:for-each select="marc:datafield[@tag='130']">
-        <pz:metadata type="title-uniform">
-          <xsl:value-of select="marc:subfield[@code='a']" />
-        </pz:metadata>
-        <pz:metadata type="title-uniform-media">
-          <xsl:value-of select="marc:subfield[@code='m']" />
-        </pz:metadata>
-        <pz:metadata type="title-uniform-parts">
-          <xsl:value-of select="marc:subfield[@code='n']" />
-        </pz:metadata>
-        <pz:metadata type="title-uniform-partname">
-          <xsl:value-of select="marc:subfield[@code='p']" />
-        </pz:metadata>
-        <pz:metadata type="title-uniform-key">
-          <xsl:value-of select="marc:subfield[@code='r']" />
-        </pz:metadata>
-      </xsl:for-each>
-
       <xsl:for-each select="marc:datafield[@tag='260']">
         <pz:metadata type="date">
           <xsl:value-of select="translate(marc:subfield[@code='c'], 'cp[].', '')" />
         </pz:metadata>
       </xsl:if>
 
+      <xsl:for-each select="marc:datafield[@tag='130']">
+        <pz:metadata type="title-uniform">
+          <xsl:value-of select="marc:subfield[@code='a']" />
+        </pz:metadata>
+        <pz:metadata type="title-uniform-media">
+          <xsl:value-of select="marc:subfield[@code='m']" />
+        </pz:metadata>
+        <pz:metadata type="title-uniform-parts">
+          <xsl:value-of select="marc:subfield[@code='n']" />
+        </pz:metadata>
+        <pz:metadata type="title-uniform-partname">
+          <xsl:value-of select="marc:subfield[@code='p']" />
+        </pz:metadata>
+        <pz:metadata type="title-uniform-key">
+          <xsl:value-of select="marc:subfield[@code='r']" />
+        </pz:metadata>
+      </xsl:for-each>
+
       <xsl:for-each select="marc:datafield[@tag='245']">
         <pz:metadata type="title">
           <xsl:value-of select="marc:subfield[@code='a']"/>
                </pz:metadata>
        </xsl:for-each>
 
-      <xsl:for-each select="marc:datafield[@tag='856']">
-       <pz:metadata type="electronic-url">
-         <xsl:value-of select="marc:subfield[@code='u']"/>
-       </pz:metadata>
-       <pz:metadata type="electronic-text">
-         <xsl:value-of select="marc:subfield[@code='y' or @code='3']"/>
+    <xsl:for-each select="marc:datafield[@tag='856']">
+          <pz:metadata type="electronic-url">
+              <xsl:value-of select="marc:subfield[@code='u']"/>
+          </pz:metadata>
+          <pz:metadata type="electronic-text">
+               <xsl:choose>
+                       <xsl:when test="marc:subfield[@code='y']">
+                <xsl:value-of select="marc:subfield[@code='y']/text()" />
+                       </xsl:when>
+                       <xsl:when test="marc:subfield[@code='3']">
+                <xsl:value-of select="marc:subfield[@code='3']/text()" />
+                       </xsl:when>
+                       <xsl:otherwise>Get resource</xsl:otherwise>
+               </xsl:choose>
        </pz:metadata>
        <pz:metadata type="electronic-note">
          <xsl:value-of select="marc:subfield[@code='z']"/>