Add test data. Move to resources/
authorDennis Schafroth <dennis@indexdata.com>
Wed, 1 Feb 2012 15:38:28 +0000 (16:38 +0100)
committerDennis Schafroth <dennis@indexdata.com>
Wed, 1 Feb 2012 15:38:28 +0000 (16:38 +0100)
src/org/marc4j/test/WriterTest.java

index 2e0760a..7707fc2 100644 (file)
@@ -2,7 +2,13 @@ package org.marc4j.test;
 \r
 import java.io.ByteArrayInputStream;\r
 import java.io.ByteArrayOutputStream;\r
+import java.io.File;\r
+import java.io.FileOutputStream;\r
 import java.io.InputStream;\r
+import java.io.StringReader;\r
+\r
+import javax.xml.transform.stream.StreamResult;\r
+import javax.xml.transform.stream.StreamSource;\r
 \r
 import junit.framework.Test;\r
 import junit.framework.TestCase;\r
@@ -19,6 +25,8 @@ import org.marc4j.marc.Record;
 \r
 public class WriterTest extends TestCase {\r
 \r
+  \r
+  \r
     public void testMarcStreamWriter() throws Exception {\r
         InputStream input = getClass().getResourceAsStream(\r
                 "resources/summerland.xml");\r
@@ -57,7 +65,55 @@ public class WriterTest extends TestCase {
       input.close();\r
       writer.close();\r
     }\r
+\r
+    public void testTurboMarcXmlWriterAutoGraphics() throws Exception {\r
+      InputStream input = getClass().getResourceAsStream(\r
+              "resources/auto-graphics.mrc");\r
+      MarcWriter writer = new TurboMarcXmlWriter(new FileOutputStream( new File("auto-graphics.txml")), true);\r
+      MarcStreamReader reader = new MarcStreamReader(input);\r
+      int index = 0;\r
+      while (reader.hasNext()) {\r
+          Record record = reader.next();\r
+          writer.write(record);\r
+          index++;\r
+      }\r
+      System.out.println("Number of records: " + index);\r
+      input.close();\r
+      writer.close();\r
+    }\r
+\r
+    public void testMarcXmlWriterAutoGraphics() throws Exception {\r
+      InputStream input = getClass().getResourceAsStream(\r
+              "resources/auto-graphics.mrc");\r
+      MarcWriter writer = new MarcXmlWriter(new FileOutputStream( new File("auto-graphics.txml")), true);\r
+      MarcStreamReader reader = new MarcStreamReader(input);\r
+      int index = 0;\r
+      while (reader.hasNext()) {\r
+          Record record = reader.next();\r
+          writer.write(record);\r
+          index++;\r
+      }\r
+      System.out.println("Number of records: " + index);\r
+      input.close();\r
+      writer.close();\r
+    }\r
+\r
     \r
+    public void testTurboMarcXmlWriter2pz() throws Exception {\r
+      InputStream input = getClass().getResourceAsStream(\r
+              "resources/summerland.mrc");\r
+      StreamResult result = new StreamResult(System.out);\r
+      MarcWriter writer = new MarcXmlWriter(result, new StreamSource(new StringReader(tmarc2pz)));\r
+      \r
+      MarcStreamReader reader = new MarcStreamReader(input);\r
+      while (reader.hasNext()) {\r
+          Record record = reader.next();\r
+          writer.write(record);\r
+      }\r
+      input.close();\r
+      writer.close();\r
+    }\r
+\r
     public void testWriteAndRead() throws Exception {\r
         InputStream input = getClass().getResourceAsStream(\r
                 "resources/summerland.xml");\r
@@ -91,4 +147,341 @@ public class WriterTest extends TestCase {
     public static void main(String args[]) {\r
         TestRunner.run(suite());\r
     }\r
+\r
+\r
+    String tmarc2pz \r
+             = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + \r
+               "<xsl:stylesheet\r\n" + \r
+               "    version=\"1.0\"\r\n" + \r
+               "    xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\r\n" + \r
+               "    xmlns:pz=\"http://www.indexdata.com/pazpar2/1.0\"\r\n" + \r
+               "    xmlns:marc=\"http://www.loc.gov/MARC21/slim\">\r\n" + \r
+               "  <xsl:output indent=\"yes\" method=\"xml\" version=\"1.0\" encoding=\"UTF-8\"/>\r\n" + \r
+               "<!-- Extract metadata from MARC21/USMARC \r\n" + \r
+               "      http://www.loc.gov/marc/bibliographic/ecbdhome.html\r\n" + \r
+               "-->  \r\n" + \r
+               "  <xsl:include href=\"pz2-ourl-marc21.xsl\" />\r\n" + \r
+               "\r\n" + \r
+               "  <xsl:template match=\"/\">\r\n" + \r
+               "    <pz:collection> \r\n" + \r
+               "      <xsl:apply-templates />\r\n" + \r
+               "    </pz:collection>\r\n" + \r
+               "  </xsl:template>        \r\n" + \r
+               "  \r\n" + \r
+               "  <xsl:template match=\"//delete\">\r\n" + \r
+               "       <xsl:copy-of select=\".\"/>                                                                                                                                                                               \r\n" + \r
+               "  </xsl:template> \r\n" + \r
+               "  \r\n" + \r
+               "  <xsl:template match=\"//marc:record\">\r\n" + \r
+               "    <xsl:variable name=\"title_medium\" select=\"marc:datafield[@tag='245']/marc:subfield[@code='h']\"/>\r\n" + \r
+               "    <xsl:variable name=\"journal_title\" select=\"marc:datafield[@tag='773']/marc:subfield[@code='t']\"/>\r\n" + \r
+               "    <xsl:variable name=\"electronic_location_url\" select=\"marc:datafield[@tag='856']/marc:subfield[@code='u']\"/>\r\n" + \r
+               "    <xsl:variable name=\"fulltext_a\" select=\"marc:datafield[@tag='900']/marc:subfield[@code='a']\"/>\r\n" + \r
+               "    <xsl:variable name=\"fulltext_b\" select=\"marc:datafield[@tag='900']/marc:subfield[@code='b']\"/>\r\n" + \r
+               "    <xsl:variable name=\"medium\">\r\n" + \r
+               "      <xsl:choose>\r\n" + \r
+               "       <xsl:when test=\"$title_medium\">\r\n" + \r
+               "         <xsl:value-of select=\"substring-after(substring-before($title_medium,']'),'[')\"/>\r\n" + \r
+               "       </xsl:when>\r\n" + \r
+               "       <xsl:when test=\"$fulltext_a\">\r\n" + \r
+               "         <xsl:text>electronic resource</xsl:text>\r\n" + \r
+               "       </xsl:when>\r\n" + \r
+               "       <xsl:when test=\"$fulltext_b\">\r\n" + \r
+               "         <xsl:text>electronic resource</xsl:text>\r\n" + \r
+               "       </xsl:when>\r\n" + \r
+               "       <xsl:when test=\"$journal_title\">\r\n" + \r
+               "         <xsl:text>article</xsl:text>\r\n" + \r
+               "       </xsl:when>\r\n" + \r
+               "       <xsl:otherwise>\r\n" + \r
+               "         <xsl:text>book</xsl:text>\r\n" + \r
+               "       </xsl:otherwise>\r\n" + \r
+               "      </xsl:choose>\r\n" + \r
+               "    </xsl:variable>\r\n" + \r
+               "\r\n" + \r
+               "    <pz:record>      \r\n" + \r
+               "      <xsl:for-each select=\"marc:controlfield[@tag='001']\">\r\n" + \r
+               "        <pz:metadata type=\"id\">\r\n" + \r
+               "          <xsl:value-of select=\".\"/>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='010']\">\r\n" + \r
+               "        <pz:metadata type=\"lccn\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='020']\">\r\n" + \r
+               "        <pz:metadata type=\"isbn\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='022']\">\r\n" + \r
+               "        <pz:metadata type=\"issn\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='027']\">\r\n" + \r
+               "        <pz:metadata type=\"tech-rep-nr\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='035']\">\r\n" + \r
+               "        <pz:metadata type=\"system-control-nr\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='100']\">\r\n" + \r
+               "       <pz:metadata type=\"author\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"author-title\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='c']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"author-date\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='d']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='110']\">\r\n" + \r
+               "       <pz:metadata type=\"corporate-name\">\r\n" + \r
+               "           <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"corporate-location\">\r\n" + \r
+               "           <xsl:value-of select=\"marc:subfield[@code='c']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"corporate-date\">\r\n" + \r
+               "           <xsl:value-of select=\"marc:subfield[@code='d']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='111']\">\r\n" + \r
+               "       <pz:metadata type=\"meeting-name\">\r\n" + \r
+               "           <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"meeting-location\">\r\n" + \r
+               "           <xsl:value-of select=\"marc:subfield[@code='c']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"meeting-date\">\r\n" + \r
+               "           <xsl:value-of select=\"marc:subfield[@code='d']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='260']\">\r\n" + \r
+               "       <pz:metadata type=\"date\">\r\n" + \r
+               "           <xsl:value-of select=\"marc:subfield[@code='c']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='245']\">\r\n" + \r
+               "        <pz:metadata type=\"title\">\r\n" + \r
+               "          <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "        <pz:metadata type=\"title-remainder\">\r\n" + \r
+               "          <xsl:value-of select=\"marc:subfield[@code='b']\"/>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "        <pz:metadata type=\"title-responsibility\">\r\n" + \r
+               "          <xsl:value-of select=\"marc:subfield[@code='c']\"/>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "        <pz:metadata type=\"title-dates\">\r\n" + \r
+               "          <xsl:value-of select=\"marc:subfield[@code='f']\"/>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "        <pz:metadata type=\"title-medium\">\r\n" + \r
+               "          <xsl:value-of select=\"marc:subfield[@code='h']\"/>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "        <pz:metadata type=\"title-number-section\">\r\n" + \r
+               "          <xsl:value-of select=\"marc:subfield[@code='n']\"/>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='250']\">\r\n" + \r
+               "       <pz:metadata type=\"edition\">\r\n" + \r
+               "           <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='260']\">\r\n" + \r
+               "        <pz:metadata type=\"publication-place\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "        <pz:metadata type=\"publication-name\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='b']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "        <pz:metadata type=\"publication-date\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='c']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='300']\">\r\n" + \r
+               "       <pz:metadata type=\"physical-extent\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"physical-format\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='b']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"physical-dimensions\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='c']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"physical-accomp\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='e']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"physical-unittype\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='f']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"physical-unitsize\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='g']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"physical-specified\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='3']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='440']\">\r\n" + \r
+               "       <pz:metadata type=\"series-title\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag = '500' or @tag = '505' or @tag = '518' or @tag = '520' or @tag = '522']\">\r\n" + \r
+               "       <pz:metadata type=\"description\">\r\n" + \r
+               "            <xsl:value-of select=\"*/text()\"/>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "      \r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='600' or @tag='610' or @tag='611' or @tag='630' or @tag='648' or @tag='650' or @tag='651' or @tag='653' or @tag='654' or @tag='655' or @tag='656' or @tag='657' or @tag='658' or @tag='662' or @tag='69X']\">\r\n" + \r
+               "        <pz:metadata type=\"subject\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"subject-long\">\r\n" + \r
+               "         <xsl:for-each select=\"marc:subfield\">\r\n" + \r
+               "           <xsl:if test=\"position() > 1\">\r\n" + \r
+               "             <xsl:text>, </xsl:text>\r\n" + \r
+               "           </xsl:if>\r\n" + \r
+               "           <xsl:value-of select=\".\"/>\r\n" + \r
+               "         </xsl:for-each>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='856']\">\r\n" + \r
+               "       <pz:metadata type=\"electronic-url\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='u']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"electronic-text\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='y']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "       <pz:metadata type=\"electronic-note\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='z']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='773']\">\r\n" + \r
+               "        <pz:metadata type=\"citation\">\r\n" + \r
+               "          <xsl:for-each select=\"*\">\r\n" + \r
+               "            <xsl:value-of select=\"normalize-space(.)\"/>\r\n" + \r
+               "            <xsl:text> </xsl:text>\r\n" + \r
+               "          </xsl:for-each>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "        <xsl:if test=\"marc:subfield[@code='t']\">\r\n" + \r
+               "          <pz:metadata type=\"journal-title\">\r\n" + \r
+               "            <xsl:value-of select=\"marc:subfield[@code='t']\"/>\r\n" + \r
+               "          </pz:metadata>\r\n" + \r
+               "        </xsl:if>\r\n" + \r
+               "        <xsl:if test=\"marc:subfield[@code='g']\">\r\n" + \r
+               "          <pz:metadata type=\"journal-subpart\">\r\n" + \r
+               "            <xsl:value-of select=\"marc:subfield[@code='g']\"/>\r\n" + \r
+               "          </pz:metadata>\r\n" + \r
+               "        </xsl:if>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <pz:metadata type=\"medium\">\r\n" + \r
+               "       <xsl:value-of select=\"$medium\"/>\r\n" + \r
+               "      </pz:metadata>\r\n" + \r
+               "      \r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='900']/marc:subfield[@code='a']\">\r\n" + \r
+               "        <pz:metadata type=\"fulltext\">\r\n" + \r
+               "          <xsl:value-of select=\".\"/>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <!-- <xsl:if test=\"$fulltext_a\">\r\n" + \r
+               "       <pz:metadata type=\"fulltext\">\r\n" + \r
+               "         <xsl:value-of select=\"$fulltext_a\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:if> -->\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='900']/marc:subfield[@code='b']\">\r\n" + \r
+               "        <pz:metadata type=\"fulltext\">\r\n" + \r
+               "          <xsl:value-of select=\".\"/>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <!-- <xsl:if test=\"$fulltext_b\">\r\n" + \r
+               "       <pz:metadata type=\"fulltext\">\r\n" + \r
+               "         <xsl:value-of select=\"$fulltext_b\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:if> -->\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='907' or @tag='901']\">\r\n" + \r
+               "        <pz:metadata type=\"iii-id\">\r\n" + \r
+               "         <xsl:value-of select=\"marc:subfield[@code='a']\"/>\r\n" + \r
+               "       </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='926']\">\r\n" + \r
+               "        <pz:metadata type=\"holding\">\r\n" + \r
+               "         <xsl:for-each select=\"marc:subfield\">\r\n" + \r
+               "           <xsl:if test=\"position() > 1\">\r\n" + \r
+               "             <xsl:text> </xsl:text>\r\n" + \r
+               "           </xsl:if>\r\n" + \r
+               "           <xsl:value-of select=\".\"/>\r\n" + \r
+               "         </xsl:for-each>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='948']\">\r\n" + \r
+               "        <pz:metadata type=\"holding\">\r\n" + \r
+               "         <xsl:for-each select=\"marc:subfield\">\r\n" + \r
+               "           <xsl:if test=\"position() > 1\">\r\n" + \r
+               "             <xsl:text> </xsl:text>\r\n" + \r
+               "           </xsl:if>\r\n" + \r
+               "           <xsl:value-of select=\".\"/>\r\n" + \r
+               "         </xsl:for-each>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:for-each select=\"marc:datafield[@tag='991']\">\r\n" + \r
+               "        <pz:metadata type=\"holding\">\r\n" + \r
+               "         <xsl:for-each select=\"marc:subfield\">\r\n" + \r
+               "           <xsl:if test=\"position() > 1\">\r\n" + \r
+               "             <xsl:text> </xsl:text>\r\n" + \r
+               "           </xsl:if>\r\n" + \r
+               "           <xsl:value-of select=\".\"/>\r\n" + \r
+               "         </xsl:for-each>\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "      <xsl:if test=\"$open_url_resolver\">\r\n" + \r
+               "        <pz:metadata type=\"open-url\">\r\n" + \r
+               "            <xsl:call-template name=\"insert-md-openurl\" />\r\n" + \r
+               "        </pz:metadata>\r\n" + \r
+               "      </xsl:if>\r\n" + \r
+               "\r\n" + \r
+               "      <!--passthrough id data-->\r\n" + \r
+               "      <xsl:for-each select=\"pz:metadata\">\r\n" + \r
+               "          <xsl:copy-of select=\".\"/>\r\n" + \r
+               "      </xsl:for-each>\r\n" + \r
+               "\r\n" + \r
+               "    </pz:record>    \r\n" + \r
+               "  </xsl:template>\r\n" + \r
+               "\r\n" + \r
+               "  \r\n" + \r
+               "  <xsl:template match=\"text()\"/>\r\n" + \r
+               "\r\n" + \r
+               "</xsl:stylesheet>";\r
+\r
+\r
 }\r