[open-ils-commits] [GIT] Evergreen ILS branch tags/rel_3_1_rc created. baaa6be41c10fe8930a48dee6bbd667595112ed7

Evergreen Git git at git.evergreen-ils.org
Mon Mar 26 15:00:36 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, tags/rel_3_1_rc has been created
        at  baaa6be41c10fe8930a48dee6bbd667595112ed7 (commit)

- Log -----------------------------------------------------------------
commit baaa6be41c10fe8930a48dee6bbd667595112ed7
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Mon Mar 26 12:46:06 2018 -0400

    Small fix to release note numbering
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/docs/RELEASE_NOTES_3_1.adoc b/docs/RELEASE_NOTES_3_1.adoc
index 3d2658a..5def9cd 100644
--- a/docs/RELEASE_NOTES_3_1.adoc
+++ b/docs/RELEASE_NOTES_3_1.adoc
@@ -1,4 +1,4 @@
-Evergreen 3_1 Release Notes
+Evergreen 3.1 Release Notes
 ===========================
 :toc:
 :numbered:

commit e7e98f2016ce9bc0ecaa74938c8b9a47ee620523
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Mon Mar 26 10:59:21 2018 -0400

    Bumping version numbers, adding Upgrade Script and Changelog
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/ChangeLog b/ChangeLog
index 1f72b2c..f2ce495 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,3679 @@
-Evergreen doesn't keep a GNU-style ChangeLog except in release tarballs.
-Those seeking a change log are encouraged to run 'git log -v', or read
-it online at: http://git.evergreen-ils.org/?p=Evergreen.git;a=log
+commit 44766aa54d66b9b2c402b83ee58f42f11b1bb71d
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Mon Mar 26 09:38:52 2018 -0400
+
+    Bumping Perl version string
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+1	1	Open-ILS/src/perlmods/lib/OpenILS.pm
+
+commit e05f6ee0d5d8c2577fad2ca767864e0f6a3dfb8f
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Mon Mar 26 09:33:49 2018 -0400
+
+    Translation updates - po files
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+34	0	build/i18n/po/FlattenerGrid.js/en-GB.po
+19	14	build/i18n/po/acq.js/en-GB.po
+7	3	build/i18n/po/acq/ar-JO.po
+8	4	build/i18n/po/acq/cs-CZ.po
+7	3	build/i18n/po/acq/de-DE.po
+7	3	build/i18n/po/acq/es-ES.po
+7	3	build/i18n/po/acq/hy-AM.po
+7	3	build/i18n/po/acq/ru-RU.po
+3	3	build/i18n/po/cat.properties/ar-JO.po
+6	6	build/i18n/po/cat.properties/cs-CZ.po
+3	3	build/i18n/po/cat.properties/de-DE.po
+3	3	build/i18n/po/cat.properties/en-CA.po
+3	3	build/i18n/po/cat.properties/en-GB.po
+3	3	build/i18n/po/cat.properties/es-ES.po
+3	3	build/i18n/po/cat.properties/fi-FI.po
+3	3	build/i18n/po/cat.properties/fr-CA.po
+3	3	build/i18n/po/cat.properties/he-IL.po
+3	3	build/i18n/po/cat.properties/hu-HU.po
+3	3	build/i18n/po/cat.properties/hy-AM.po
+3	3	build/i18n/po/cat.properties/oc-FR.po
+3	3	build/i18n/po/cat.properties/pt-BR.po
+3	3	build/i18n/po/cat.properties/ru-RU.po
+3	3	build/i18n/po/cat.properties/sv-SE.po
+3	3	build/i18n/po/cat.properties/tr-TR.po
+4	4	build/i18n/po/circ.properties/cs-CZ.po
+3	3	build/i18n/po/common.properties/ar-JO.po
+3	3	build/i18n/po/common.properties/cs-CZ.po
+4	4	build/i18n/po/common.properties/de-DE.po
+3	3	build/i18n/po/common.properties/en-CA.po
+3	3	build/i18n/po/common.properties/en-GB.po
+3	3	build/i18n/po/common.properties/es-ES.po
+3	3	build/i18n/po/common.properties/fi-FI.po
+3	3	build/i18n/po/common.properties/fr-CA.po
+3	3	build/i18n/po/common.properties/he-IL.po
+3	3	build/i18n/po/common.properties/hu-HU.po
+3	3	build/i18n/po/common.properties/hy-AM.po
+3	3	build/i18n/po/common.properties/oc-FR.po
+3	3	build/i18n/po/common.properties/pt-BR.po
+3	3	build/i18n/po/common.properties/ru-RU.po
+3	3	build/i18n/po/common.properties/sv-SE.po
+3	3	build/i18n/po/common.properties/tr-TR.po
+20	12	build/i18n/po/conify/ar-JO.po
+21	13	build/i18n/po/conify/cs-CZ.po
+20	12	build/i18n/po/conify/es-ES.po
+20	12	build/i18n/po/conify/hy-AM.po
+3516	3427	build/i18n/po/db.seed/ar-JO.po
+3559	3470	build/i18n/po/db.seed/cs-CZ.po
+3496	3407	build/i18n/po/db.seed/de-DE.po
+3497	3408	build/i18n/po/db.seed/en-CA.po
+3498	3409	build/i18n/po/db.seed/en-GB.po
+3522	3433	build/i18n/po/db.seed/es-ES.po
+3506	3417	build/i18n/po/db.seed/fi-FI.po
+3505	3416	build/i18n/po/db.seed/fr-CA.po
+3489	3400	build/i18n/po/db.seed/he-IL.po
+3489	3400	build/i18n/po/db.seed/hu-HU.po
+3523	3434	build/i18n/po/db.seed/hy-AM.po
+3496	3407	build/i18n/po/db.seed/oc-FR.po
+3502	3413	build/i18n/po/db.seed/pt-BR.po
+3503	3414	build/i18n/po/db.seed/ru-RU.po
+3489	3400	build/i18n/po/db.seed/sv-SE.po
+3491	3402	build/i18n/po/db.seed/tr-TR.po
+2477	2314	build/i18n/po/fm_IDL.dtd/ar-JO.po
+2489	2326	build/i18n/po/fm_IDL.dtd/cs-CZ.po
+2460	2303	build/i18n/po/fm_IDL.dtd/de-DE.po
+2474	2314	build/i18n/po/fm_IDL.dtd/en-CA.po
+2473	2313	build/i18n/po/fm_IDL.dtd/en-GB.po
+2474	2314	build/i18n/po/fm_IDL.dtd/es-ES.po
+2474	2314	build/i18n/po/fm_IDL.dtd/fi-FI.po
+2459	2302	build/i18n/po/fm_IDL.dtd/fr-CA.po
+2457	2300	build/i18n/po/fm_IDL.dtd/he-IL.po
+2457	2300	build/i18n/po/fm_IDL.dtd/hu-HU.po
+2477	2314	build/i18n/po/fm_IDL.dtd/hy-AM.po
+2458	2301	build/i18n/po/fm_IDL.dtd/oc-FR.po
+2470	2310	build/i18n/po/fm_IDL.dtd/pt-BR.po
+2470	2310	build/i18n/po/fm_IDL.dtd/ru-RU.po
+2457	2300	build/i18n/po/fm_IDL.dtd/sv-SE.po
+2457	2300	build/i18n/po/fm_IDL.dtd/tr-TR.po
+13	10	build/i18n/po/ils_events.xml/ar-JO.po
+17	12	build/i18n/po/ils_events.xml/cs-CZ.po
+10	10	build/i18n/po/ils_events.xml/de-DE.po
+10	10	build/i18n/po/ils_events.xml/en-CA.po
+10	10	build/i18n/po/ils_events.xml/en-GB.po
+10	10	build/i18n/po/ils_events.xml/es-ES.po
+10	10	build/i18n/po/ils_events.xml/fi-FI.po
+10	10	build/i18n/po/ils_events.xml/fr-CA.po
+9	9	build/i18n/po/ils_events.xml/he-IL.po
+9	9	build/i18n/po/ils_events.xml/hu-HU.po
+14	11	build/i18n/po/ils_events.xml/hy-AM.po
+9	9	build/i18n/po/ils_events.xml/oc-FR.po
+10	10	build/i18n/po/ils_events.xml/pt-BR.po
+10	10	build/i18n/po/ils_events.xml/ru-RU.po
+9	9	build/i18n/po/ils_events.xml/sv-SE.po
+9	9	build/i18n/po/ils_events.xml/tr-TR.po
+36	52	build/i18n/po/lang.dtd/ar-JO.po
+107	91	build/i18n/po/lang.dtd/cs-CZ.po
+26	25	build/i18n/po/lang.dtd/de-DE.po
+38	54	build/i18n/po/lang.dtd/en-CA.po
+38	54	build/i18n/po/lang.dtd/en-GB.po
+39	55	build/i18n/po/lang.dtd/es-ES.po
+39	55	build/i18n/po/lang.dtd/fi-FI.po
+26	25	build/i18n/po/lang.dtd/fr-CA.po
+26	25	build/i18n/po/lang.dtd/he-IL.po
+26	25	build/i18n/po/lang.dtd/hu-HU.po
+89	73	build/i18n/po/lang.dtd/hy-AM.po
+26	25	build/i18n/po/lang.dtd/oc-FR.po
+26	25	build/i18n/po/lang.dtd/pt-BR.po
+26	25	build/i18n/po/lang.dtd/ru-RU.po
+26	25	build/i18n/po/lang.dtd/sv-SE.po
+26	25	build/i18n/po/lang.dtd/tr-TR.po
+11	11	build/i18n/po/offline.properties/cs-CZ.po
+81	61	build/i18n/po/tpac/ar-JO.po
+82	62	build/i18n/po/tpac/cs-CZ.po
+237	217	build/i18n/po/tpac/de-DE.po
+237	217	build/i18n/po/tpac/en-CA.po
+237	217	build/i18n/po/tpac/en-GB.po
+81	61	build/i18n/po/tpac/es-ES.po
+237	217	build/i18n/po/tpac/fi-FI.po
+237	217	build/i18n/po/tpac/fr-CA.po
+237	217	build/i18n/po/tpac/he-IL.po
+237	217	build/i18n/po/tpac/hu-HU.po
+237	217	build/i18n/po/tpac/hy-AM.po
+237	217	build/i18n/po/tpac/oc-FR.po
+237	217	build/i18n/po/tpac/pt-BR.po
+237	217	build/i18n/po/tpac/ru-RU.po
+237	217	build/i18n/po/tpac/sv-SE.po
+237	217	build/i18n/po/tpac/tr-TR.po
+5	5	build/i18n/po/vandelay/ar-JO.po
+5	5	build/i18n/po/vandelay/cs-CZ.po
+5	5	build/i18n/po/vandelay/de-DE.po
+5	5	build/i18n/po/vandelay/es-ES.po
+5	5	build/i18n/po/vandelay/hy-AM.po
+786	464	build/i18n/po/webstaff/ar-JO.po
+803	469	build/i18n/po/webstaff/cs-CZ.po
+9446	0	build/i18n/po/webstaff/en-GB.po
+776	463	build/i18n/po/webstaff/es-ES.po
+764	460	build/i18n/po/webstaff/hy-AM.po
+759	458	build/i18n/po/webstaff/ru-RU.po
+ create mode 100644 build/i18n/po/FlattenerGrid.js/en-GB.po
+ create mode 100644 build/i18n/po/webstaff/en-GB.po
+
+commit 5e4eaca28ab2c60b7f1076d43f030abc9061a247
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Mon Mar 26 09:16:23 2018 -0400
+
+    Translation updates - newpot
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+2135	2122	build/i18n/po/db.seed/db.seed.pot
+164	128	build/i18n/po/webstaff/webstaff.pot
+
+commit 5a6636f53ad07c718c6ba207d3f9d543deec72db
+Author: Kathy Lussier <klussier at masslnc.org>
+Date:   Fri Mar 23 15:39:49 2018 -0400
+
+    LP#1699838: Stamping upgrade script for default pickup lib YAOUS
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+10	0	Open-ILS/src/sql/Pg/upgrade/1109.data.yaos-circ-holds-default-pickup-lib.sql
+0	10	Open-ILS/src/sql/Pg/upgrade/XXXX.data.yaos-circ-holds-default-pickup-lib.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1109.data.yaos-circ-holds-default-pickup-lib.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.yaos-circ-holds-default-pickup-lib.sql
+
+commit 5a39d42b640f26048cc7cf69b92fd4d90d9888a6
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Fri Mar 23 13:07:45 2018 -0400
+
+    LP#1699838 Scale back settings for staff-based hold placement
+    
+    For now, we will add just one new setting to optionally restore the old
+    behavior.  In the absence of a 'preferred pickup location', the staff
+    form will default to the staff workstation OU.
+    
+    Also, add setting to seed data.
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    
+    Conflicts:
+    	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+
+10	0	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+2	6	Open-ILS/src/sql/Pg/upgrade/XXXX.data.yaos-circ-holds-default-pickup-lib.sql
+5	23	Open-ILS/web/js/ui/default/opac/staff.js
+6	14	Open-ILS/web/js/ui/default/staff/services/eframe.js
+
+commit 1114b1d7b28563cfbc75d0f15f5cc7f8cb85ca4b
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Wed Feb 28 14:08:08 2018 -0500
+
+    LP1699838 - add YOUSes for defaulting hold pickup locs
+    
+    Add a YAOUS... err make that two, to control how staff-placed holds
+    default the pickup library.
+    
+    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+14	0	Open-ILS/src/sql/Pg/upgrade/XXXX.data.yaos-circ-holds-default-pickup-lib.sql
+40	9	Open-ILS/web/js/ui/default/opac/staff.js
+50	28	Open-ILS/web/js/ui/default/staff/services/eframe.js
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.yaos-circ-holds-default-pickup-lib.sql
+
+commit ef25453cd7e1f6b46728f8cfee17ba44a1b9955f
+Author: Remington Steed <rjs7 at calvin.edu>
+Date:   Fri Mar 23 10:46:32 2018 -0400
+
+    LP#1693036: Simplify template, cleanup preview data
+    
+    This commit corrects a few minor problems, and also attempts to simplify
+    and cleanup the template. The changes include:
+    
+      - Adding the missing "ident_type2" field to the template and JS
+      - Adding missing sample data for "county"
+      - Moving "postal code" closer to the standard location (at the end of
+        the address)
+      - Fixing typos, and making "Claims..." labels more consistent
+      - Minor cleanup of the sample data
+      - Removing template comments that list available variables, because
+        this template is simpler than most, intended to print everything
+    
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+6	20	Open-ILS/src/templates/staff/share/print_templates/t_patron_data.tt2
+9	7	Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
+
+commit 010eca09b936c1b774954d7f27122f6e1a70532b
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Mar 14 10:33:27 2018 -0400
+
+    LP#1693036: follow-up: fix printing of daytime phone number
+    
+    This patch corrects how the 'day_phone' field should be referred
+    to in the print template.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+2	2	Open-ILS/src/templates/staff/share/print_templates/t_patron_data.tt2
+1	1	Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
+
+commit 6b44a066e098aae251fa7496fe01fc6b0cbce8e7
+Author: Kyle Huckins <khuckins at catalyte.io>
+Date:   Thu Feb 15 23:03:20 2018 +0000
+
+    lp1693036 Patron Editor Print Data
+    
+    - Add Print button to Patron Editor.
+    - Add Patron Data print template.
+    - Add additional print template dummy data needed for Patron
+    Data template.
+    - Implement print functionality for Patron registration/edit
+    data.
+    
+    Signed-off-by: Kyle Huckins <khuckins at catalyte.io>/
+    Signed-off-by: Terran McCanna <tmccanna at georgialibraries.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+1	0	Open-ILS/src/templates/staff/admin/workstation/t_print_templates.tt2
+4	0	Open-ILS/src/templates/staff/circ/patron/reg_actions.tt2
+69	0	Open-ILS/src/templates/staff/share/print_templates/t_patron_data.tt2
+37	2	Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
+10	0	Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
+ create mode 100644 Open-ILS/src/templates/staff/share/print_templates/t_patron_data.tt2
+
+commit c31faa9080e5d71963300816678c5fd6e6ef0d12
+Author: Kathy Lussier <klussier at masslnc.org>
+Date:   Fri Mar 23 08:35:56 2018 -0400
+
+    LP#1758322: Fix  lp1731960_test_preserving_bookbag_entries test
+    
+    A typo inserted the incorrect record number for the
+     lp1731960_test_preserving_bookbag_entries. This patch fixes
+    the typo.
+    
+    Thanks to Jason Boyer for spotting the problem!
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+1	1	Open-ILS/src/sql/Pg/t/lp1731960_test_preserving_bookbag_entries.pg
+
+commit b6e360894850599f51d0b934253c02c77a7aff3e
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Fri Mar 23 10:23:19 2018 -0400
+
+    LP#1758347: ensure that upgrade includes latest asset.merge_record_assets()
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+277	0	Open-ILS/src/sql/Pg/upgrade/1108.schema.lp1758347_fix_merge_record_assets.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1108.schema.lp1758347_fix_merge_record_assets.sql
+
+commit 5e9c7d216dc58f24b16b383c88e27426933296c8
+Author: Kathy Lussier <klussier at masslnc.org>
+Date:   Thu Mar 22 19:36:19 2018 -0400
+
+    LP#1731960: Stamping upgrade script for preserve book bags on bib merge
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+269	0	Open-ILS/src/sql/Pg/upgrade/1107.schema.preserve_book_bags_on_bib_merge.sql
+0	269	Open-ILS/src/sql/Pg/upgrade/xxxx.schema.preserve_book_bags_on_bib_merge.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1107.schema.preserve_book_bags_on_bib_merge.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/xxxx.schema.preserve_book_bags_on_bib_merge.sql
+
+commit c2c48e6ccd50f309a7eb5031a15f6eb3d4d353fa
+Author: Rogan Hamby <rogan.hamby at gmail.com>
+Date:   Thu Mar 22 13:50:52 2018 -0400
+
+    LP#1731960: adding upgrade script for updating the function
+    
+    Signed-off-by: Rogan Hamby <rogan.hamby at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+269	0	Open-ILS/src/sql/Pg/upgrade/xxxx.schema.preserve_book_bags_on_bib_merge.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/xxxx.schema.preserve_book_bags_on_bib_merge.sql
+
+commit aa6fe112068668e33f39d7c714a69b1b8d46f193
+Author: Rogan Hamby <rogan.hamby at gmail.com>
+Date:   Tue Nov 21 18:50:34 2017 -0500
+
+    LP#1731960-preserving book bag entries with new values during bib merge
+    
+    The asset.merge_record_assets() removes bib records from containers when
+    merging and deleting the record as appropriate but bib containers with
+    the btype of 'bookbag' (used as reading lists) should instead be updated
+    to the new bib record. Includes Pgtap test.
+    
+    Signed-off-by: Rogan Hamby <rhamby at equinoxinitiative.org>
+    Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    
+    Conflicts:
+    	Open-ILS/src/sql/Pg/999.functions.global.sql
+
+6	0	Open-ILS/src/sql/Pg/999.functions.global.sql
+59	0	Open-ILS/src/sql/Pg/t/lp1731960_test_preserving_bookbag_entries.pg
+ create mode 100644 Open-ILS/src/sql/Pg/t/lp1731960_test_preserving_bookbag_entries.pg
+
+commit def685f1ed0f2628554e4aa9574368df3b9a31e0
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Thu Mar 22 15:36:50 2018 -0400
+
+    Forward port 2.12.11 upgrade script
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+5	0	Open-ILS/src/sql/Pg/version-upgrade/2.12.10-2.12.11-upgrade-db.sql
+ create mode 100644 Open-ILS/src/sql/Pg/version-upgrade/2.12.10-2.12.11-upgrade-db.sql
+
+commit dd5948e336cd7bcf2ef54d349287b7450a362523
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Thu Mar 22 14:39:14 2018 -0400
+
+    Forward port 3.0.5 upgrade script
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+5	0	Open-ILS/src/sql/Pg/version-upgrade/3.0.4-3.0.5-upgrade-db.sql
+ create mode 100644 Open-ILS/src/sql/Pg/version-upgrade/3.0.4-3.0.5-upgrade-db.sql
+
+commit 80d9f5faa04e87f5b5e90b85c0f8c3ab0d3ed30d
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Thu Mar 22 10:31:58 2018 -0400
+
+    LP#1755502 Fix hold user test
+    
+    Now that we are fleshing this field, we need to dig a little deeper
+    for the 'id' to test if we are the same user.
+    
+    To test
+    -------
+    [1] Set up a patron with a hold request and with a item
+        on the hold shelf that fills the hold.
+    [2] Check out the item to patron. Note that you
+        will get a ITEM_ON_HOLDS_SHELF alert, even though the
+        item is on hold for that patron. Cancel the alert.
+    [3] Apply the patch and repeat step 2. This time, the checkout
+        will proceed.
+    [4] Set up another patron with a hold request and an item
+        on the hold shelf, then checkout it at to a _different_ patron.
+        Verify that the ITEM_ON_HOLDS_SHELF alert appears.
+    
+    This patch also fixes test failures caught by the
+    19-lp1306666-abort-transit-copy-status.t live test.
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+1	1	Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+
+commit 2ffbacfc992eb0d49f5845e3c24ce0c185e93cb3
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Thu Mar 22 12:51:45 2018 -0400
+
+    LP#1728147: more tweaks to grid
+    
+    * Make paths to expire_time and cut_in_line more concise
+    * Add SMS Carrier column back
+    * Tweak labels of the patron first and last name columns
+    * Ensure that the "Call Number" column continues to be sortable
+      by normalized call number label. Note that due to a quirk of
+      egGrid, which doesn't currently have a way to specify that a column
+      always be retrieved by a fielder query but /not/ be directly
+      available as a displayable column, we also need a "Call Number Label"
+      column at the moment.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+19	7	Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2
+
+commit 6e7ec4bef9fcdbece1c2ff4758af87765d2ee396
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Thu Mar 22 12:14:17 2018 -0400
+
+    LP#1728147: correct fleshing of staff hold column
+    
+    This patch fixes the test (ahr.usr is fleshed, but not ahr.requestor)
+    and ensures that the value is cached correctly.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+5	5	Open-ILS/web/js/ui/default/staff/circ/holds/app.js
+
+commit f694179c66ea60411deed4dd4c5d90991a4c10da
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Fri Feb 16 14:40:17 2018 -0500
+
+    LP#1728147: Add patron's first/last name and Alias column
+    
+    These were also missing from the Holds Pull grid.
+    
+    This patch also corrects the determination of whether a hold
+    was staff-placed or not.
+    
+    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+3	0	Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2
+1	1	Open-ILS/web/js/ui/default/staff/circ/holds/app.js
+
+commit 7de434d7689ea0e4e1af12c43735c062e38c0de9
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Tue Jan 30 13:13:52 2018 -0500
+
+    LP#1728147 - fix some Holds Pull List grid columns
+    
+    This adds a few missing columns to the Holds Pull List grid,
+    and addresses a few display issues.
+    
+    New columns added are Hold Type, Circ Mod, Staff Hold,
+    Email/Phone/SMS Notify, Copy Status Change Time, ISBN,
+    Edition, Top of Queue, Total Holds, and Expire Date.
+    
+    Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+28	22	Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2
+5	0	Open-ILS/web/js/ui/default/staff/circ/holds/app.js
+
+commit 698fbdc4211870d5dd547ec8a0e7302afccb9a50
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Fri Mar 2 12:54:46 2018 -0500
+
+    LP#1738488 Optimize Flattener join logic
+    
+    The current Flattener.pm autogenerates necessary joins for sorting
+    and filtering, but in doing so, it gives every intermediate table a
+    unique alias, even if the path to that table is exactly the same as
+    another member in the map we are flattening.
+    
+    Instead, let's reuse joins whenever the path is identical, even for
+    intermediate tables.  We do so by tracking every path to each core
+    type, then reusing as much of that join path as we can.  In cases
+    where we have different paths to the same type, we still necessarily
+    provide a new unique alias.
+    
+    This problem was first noticed in the web staff billing history
+    interface, where the particular stacking of joins resulted (for one
+    specific library) in 17 joins and 44,575,740,147,225,592,344,870,912
+    potential rows.
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+41	13	Open-ILS/src/perlmods/lib/OpenILS/Application/Flattener.pm
+
+commit 870a7fa4cb080a7e4eac550694b4a656fc278a83
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Fri Jan 19 14:43:38 2018 -0500
+
+    LP#1702557-Make Acq MarcEditor Just Have Save Button
+    
+    Like the changes to the z3950 marceditor UI, and serials,
+    make the Acq marceditor have a simple Save button, instead
+    of the Modify + Save Edits buttons needed to save a change.
+    Same change as in 1710405, et al. Note this also fixes a
+    propagation issue that prevented changes from marceditor's
+    scope.marcXml from making it to the modal controller scope,
+    and being saved. Props to miker for helping me debug this!
+    
+    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+1	3	Open-ILS/src/templates/staff/acq/t_edit_marc_order_record.tt2
+1	1	Open-ILS/web/js/ui/default/staff/acq/app.js
+1	1	Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
+
+commit 1f5c30502a1c7923a8978d0f4e3d28618c5c07d4
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Mon Mar 19 15:22:44 2018 -0400
+
+    LP#1361258 Patron reg repair user settings saving/loading
+    
+    Avoid caching user setting values at the service (app) level in the user
+    editor.  In other words, always fetch a fresh copy of the current user's
+    setting with each instance of the editor page.
+    
+    This solves a number problems where stale versions of the cached data
+    were referenced and acted on, both when displaying an updating user
+    settings.
+    
+    Additionally, ensure that clone user and stage user data is refreshed
+    on all page instances as the URL params that affect these values can
+    change per instance.
+    
+    Other data that is common to all instances (e.g. the set of profile
+    groups) is still cached as before.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Terran McCanna <tmccanna at georgialibraries.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+42	28	Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
+
+commit 667bc1a5a3433b4cd936cd9d362668d23e6ad3b3
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Wed Jan 10 11:25:27 2018 -0500
+
+    LP#1742779: Distinguish between no statcat values and multiple values in copy editor to assist staff
+    
+    WRT stat cats, the copy editor in the web client will display the value of a
+    stat cat IFF all selected copies both use the stat cat AND use the same value
+    for that stat cat. Otherwise it displays <NONE>, which is confusing in the
+    case of some selected copies just not using the stat cat, or all selected
+    copies using it, but using different values.
+    
+    This commit provides tracking of the mixed-use stat, and displays <MULTIPLE>
+    for the value instead of <NONE> in that case.
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+3	1	Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2
+12	1	Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+
+commit 4f6849adb2eee8d5b31887775df297f29f2b7e47
+Author: Jane Sandberg <sandbej at linnbenton.edu>
+Date:   Thu Mar 22 07:05:21 2018 -0700
+
+    Docs: adding several bug fixes to 3.0.5
+    
+    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
+
+9	0	docs/RELEASE_NOTES_3_0.adoc
+
+commit 3c3c2a0d57c1982514c2f90ba9196e017181b6d2
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Sat Mar 17 13:38:01 2018 -0400
+
+    LP#1756572: accessibility tweaks to links in webstaff client
+    
+    This patch changes the default
+    text color of text inside egGrid cells to #000; changes the default text
+    color to #000 (but note that more work would be needed to do this
+    comprehensively); and adds underlines to links inside grid cells.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+13	4	Open-ILS/src/templates/staff/css/style.css.tt2
+
+commit 7016132e14609242a3c92146986f5de5b698d79c
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Thu Mar 15 11:13:27 2018 -0400
+
+    LP#1756110: fix egBasicComboBox drop-down functionality
+    
+    Somehow egBasicComboBox got missed when it became necessary to
+    switch to the newer way of specifying Bootstrap drop-downs. This
+    patch rectifies that and fixes the drop-down functionality.
+    
+    To test
+    -------
+    [1] Create a report template in the web staff report editor and
+        add a filter field.
+    [2] Attempt to change the filter operator. Note that nothing happens
+        when the drop-down button is clicked.
+    [3] Apply the patch and repeat step 2. This time, the drop-down
+        should work and display the list of available filter operators.
+    
+    Other places affected include:
+    
+    - The part selector in the volume/copy editor
+    - Template selector in the volume/copy editor
+    - Template selector in the labels interface
+    - Routing label selector in the subscription manager
+    - Call number prefix and suffix selectors in the serials batch receiving
+      interface
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+1	1	Open-ILS/web/js/ui/default/staff/services/ui.js
+
+commit af288445a609cae947e3346d25bd28bbca513b91
+Author: Jane Sandberg <sandbej at linnbenton.edu>
+Date:   Sun Mar 18 08:20:32 2018 -0700
+
+    Docs: Adding an affiliation; updating CW MARS name in 3.1 release notes
+    
+    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
+
+3	2	docs/RELEASE_NOTES_3_1.adoc
+
+commit 701d4ee17d9c0bc3b6277eed8c0ff98f07cd3a8e
+Author: Jane Sandberg <sandbej at linnbenton.edu>
+Date:   Sun Mar 18 08:15:29 2018 -0700
+
+    Docs: Adding affiliations and documenters to 3.1 release notes
+    
+    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
+
+17	1	docs/RELEASE_NOTES_3_1.adoc
+
+commit adf98e50e05f4f923d03e276b6608c56eff17708
+Author: Remington Steed <rjs7 at calvin.edu>
+Date:   Wed Mar 14 16:44:48 2018 -0400
+
+    LP#1755917: Fix Acq Admin menu order
+    
+    According to commit cac16285aca, the acq admin menu is supposed to be in
+    alphabetical order. However, one item remains out of place. This commit
+    fixes that.
+    
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+1	1	Open-ILS/src/templates/staff/admin/acq/t_splash.tt2
+
+commit 4d7851e38fc3cadd4d767e160c71dcc4a5cbfb06
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Fri Feb 23 15:20:48 2018 -0500
+
+    LP#1751318 Remove direct tablesort import
+    
+    Avoid attempts to directly import angular-tablesort.js from the offline
+    interface.  The script is already included in vendor.bundle.js and the
+    direct import, which refers to a nonexistant file, breaks the Perl live
+    test for offline dependency checking.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+
+0	1	Open-ILS/src/templates/staff/offline-interface.tt2
+
+commit c9faf115721c797b4024f1d91fa47bea85ce017a
+Author: Jane Sandberg <sandbej at linnbenton.edu>
+Date:   Mon Mar 12 13:41:39 2018 -0700
+
+    Docs: correcting funder names for 3.1 release notes
+    
+    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
+
+2	2	docs/RELEASE_NOTES_3_1.adoc
+
+commit ceca7435e53f8d08d68914f63b108615e68f7282
+Author: Jane Sandberg <sandbej at linnbenton.edu>
+Date:   Mon Mar 12 11:35:41 2018 -0700
+
+    Docs: adding more funders to 3.1 release notes
+    
+    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
+
+4	0	docs/RELEASE_NOTES_3_1.adoc
+
+commit daaa5defdbc85a6c93fb65c3927b952ff1d145dc
+Author: Jane Sandberg <sandbej at linnbenton.edu>
+Date:   Mon Mar 12 10:36:35 2018 -0700
+
+    Docs: adding translators to 3.1 release notes acknowledgements
+    
+    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
+
+4	0	docs/RELEASE_NOTES_3_1.adoc
+
+commit 86ab5a940b99a9745b723d37ead70beb07dea418
+Author: Jane Sandberg <sandbej at linnbenton.edu>
+Date:   Mon Mar 12 10:17:18 2018 -0700
+
+    Docs: adding code contributors to 3.1 release notes acknowledgements
+    
+    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
+
+14	1	docs/RELEASE_NOTES_3_1.adoc
+
+commit b44eb5859937788f6bc22735467f5d0a36c72510
+Author: Jane Sandberg <sandbej at linnbenton.edu>
+Date:   Mon Mar 12 09:47:33 2018 -0700
+
+    Docs: adding some funding orgs to release notes acknowledgements
+    
+    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
+
+7	1	docs/RELEASE_NOTES_3_1.adoc
+
+commit 3bdc0696f8e2b6ca6be04b27bab9551e404d135e
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Fri Mar 9 11:25:16 2018 -0500
+
+    Fix billing / negative balance test cases
+    
+    The test cases are set up manually via SQL, but were not taught about
+    the new data needed for billings.  This caused two tests to fail.
+    
+    Let's go ahead and update this whole block to have more realistic data
+    conforming to the new scheme.
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+69	69	Open-ILS/tests/datasets/sql/neg_bal_custom_transactions.sql
+
+commit dc7f2b8746697ab24d12469b962bf3f87835202f
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Mon Mar 5 11:50:19 2018 -0500
+
+    LP#1753008 Load iframeResizer via script tag
+    
+    iframeResizer does not currently play nicely with webpack.  Load it
+    directly via script tag for now.
+    
+    This resolves a problem where the iframe fails to fill the screen when
+    loading the reports UI in the browser client.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+6	0	Open-ILS/src/templates/staff/base_js.tt2
+3	2	Open-ILS/web/js/ui/default/staff/webpack.config.js
+
+commit 1935f39c1d21c24e1abdc92119319b17e4d153a9
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Fri Mar 2 17:13:52 2018 -0500
+
+    LP#1751520: add specify path to content-menu.js explicitly
+    
+    Otherwise, Webpack looks for a /module/ called context-menu, and
+    doesn't find it.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+1	1	Open-ILS/web/js/ui/default/staff/webpack.config.js
+
+commit 5cc3ce7a9e5f1b503edf439a7c3316ba4c053bbd
+Author: Jason Boyer <jboyer at library.in.gov>
+Date:   Tue Feb 27 09:08:21 2018 -0500
+
+    LP1751520: Add contextMenu Module to Vendor Bundle
+    
+    This patch adds the context-menu.js file to the vendor
+    bundle for use by angular-tree-control.js
+    
+    This branch is for master/rel_3_1; not rel_3_0
+    
+    Signed-off-by: Jason Boyer <jboyer at library.in.gov>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+1	0	Open-ILS/web/js/ui/default/staff/webpack.config.js
+
+commit 8e7e84fe5dac4ef4fdc5434f63b9f3c289287c1f
+Author: Remington Steed <rjs7 at calvin.edu>
+Date:   Fri Mar 2 16:26:46 2018 -0500
+
+    Compile release notes for 3.1 beta
+    
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+
+427	0	docs/RELEASE_NOTES_3_1.adoc
+0	14	docs/RELEASE_NOTES_NEXT/Administration/latency_tester_tool.adoc
+0	12	docs/RELEASE_NOTES_NEXT/Administration/marc_export_uris_option.adoc
+0	4	docs/RELEASE_NOTES_NEXT/Architecture/Sample_Data_Includes_Surveys.adoc
+0	154	docs/RELEASE_NOTES_NEXT/Architecture/search-display-infrastructure-improvements.adoc
+0	14	docs/RELEASE_NOTES_NEXT/Cataloging/record-merge-tracking.adoc
+0	23	docs/RELEASE_NOTES_NEXT/Circulation/Copy_Alerts_And_Suppresion_Matrix.adoc
+0	13	docs/RELEASE_NOTES_NEXT/Circulation/Notice_Columns_in_Items_out_Grid.adoc
+0	5	docs/RELEASE_NOTES_NEXT/Circulation/Patron_Email_Addresses_Now_Clickable.adoc
+0	21	docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc
+0	7	docs/RELEASE_NOTES_NEXT/Circulation/billing_statement_view.adoc
+0	15	docs/RELEASE_NOTES_NEXT/Circulation/billing_ts_now_reflect_billing_time.adoc
+0	20	docs/RELEASE_NOTES_NEXT/Circulation/multiple_hold_placement.adoc
+0	5	docs/RELEASE_NOTES_NEXT/OPAC/badge_display.adoc
+0	9	docs/RELEASE_NOTES_NEXT/OPAC/copy_location_filter_changes.adoc
+0	17	docs/RELEASE_NOTES_NEXT/OPAC/multilingual_search.adoc
+0	27	docs/RELEASE_NOTES_NEXT/patron_name_username_index_fixes.adoc
+ create mode 100644 docs/RELEASE_NOTES_3_1.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Administration/latency_tester_tool.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Administration/marc_export_uris_option.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Architecture/Sample_Data_Includes_Surveys.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Architecture/search-display-infrastructure-improvements.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Cataloging/record-merge-tracking.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/Copy_Alerts_And_Suppresion_Matrix.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/Notice_Columns_in_Items_out_Grid.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/Patron_Email_Addresses_Now_Clickable.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/billing_statement_view.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/billing_ts_now_reflect_billing_time.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/multiple_hold_placement.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/OPAC/badge_display.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/OPAC/copy_location_filter_changes.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/OPAC/multilingual_search.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/patron_name_username_index_fixes.adoc
+
+commit 5e2e8d2cdec76d4f3f822f92268c0c54a66ad497
+Author: Jeff Davis <jdavis at sitka.bclibraries.ca>
+Date:   Tue Dec 12 11:22:59 2017 -0800
+
+    LP#1738064: Optionally suppress display of badges in OPAC
+    
+    Signed-off-by: Jeff Davis <jdavis at sitka.bclibraries.ca>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+5	0	Open-ILS/src/templates/opac/parts/config.tt2
+1	1	Open-ILS/src/templates/opac/parts/record/summary.tt2
+1	1	Open-ILS/src/templates/opac/parts/result/table.tt2
+5	0	docs/RELEASE_NOTES_NEXT/OPAC/badge_display.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/OPAC/badge_display.adoc
+
+commit 7a4ca90534dfc2583a9dae685c2ac6153673d38d
+Author: Remington Steed <rjs7 at calvin.edu>
+Date:   Wed Feb 28 15:24:49 2018 -0500
+
+    Docs: Add missing header underline
+    
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+
+1	0	docs/admin/floating_groups.adoc
+
+commit 65c555a4e8708b548f7adbca7402a41dbed95c4b
+Author: Remington Steed <rjs7 at calvin.edu>
+Date:   Thu Feb 22 14:28:38 2018 -0500
+
+    Docs: Fix/improve web client keyboard shortcuts
+    
+    One keyboard shortcut needed correcting:
+      - Re-opening a closed tab is "CTRL-Shift-T", not "CTRL-Shift-Tab"
+    
+    And let's add "CTRL-Shift-Tab" where it does belong -- in the "Navigate"
+    bullet point.
+    
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+
+2	2	docs/admin/web-client-browser-best-practices.adoc
+
+commit c0c229a7666e12938fbbf54b0d2823a3b6c332e8
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Fri Mar 2 14:39:22 2018 -0500
+
+    Translation updates - po files
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+6	6	build/i18n/po/AutoFieldWidget.js/cs-CZ.po
+4	4	build/i18n/po/FlattenerGrid.js/cs-CZ.po
+6	6	build/i18n/po/PCrudFilterPane.js/cs-CZ.po
+8	8	build/i18n/po/Searcher.js/cs-CZ.po
+4	4	build/i18n/po/TranslatorPopup.js/cs-CZ.po
+4	4	build/i18n/po/URLVerify.js/cs-CZ.po
+7	7	build/i18n/po/acq.js/cs-CZ.po
+8	6	build/i18n/po/acq/ar-JO.po
+14	14	build/i18n/po/acq/cs-CZ.po
+5	5	build/i18n/po/actor/cs-CZ.po
+17	17	build/i18n/po/admin.properties/ar-JO.po
+7	7	build/i18n/po/admin.properties/cs-CZ.po
+4	4	build/i18n/po/authority.js/cs-CZ.po
+4	4	build/i18n/po/booking/cs-CZ.po
+5	5	build/i18n/po/capture.js/cs-CZ.po
+4	4	build/i18n/po/cat.properties/ar-JO.po
+16	16	build/i18n/po/cat.properties/cs-CZ.po
+7	5	build/i18n/po/cat.properties/en-GB.po
+7	7	build/i18n/po/circ.properties/ar-JO.po
+45	45	build/i18n/po/circ.properties/cs-CZ.po
+9	9	build/i18n/po/circ/cs-CZ.po
+25	25	build/i18n/po/common.properties/cs-CZ.po
+5	5	build/i18n/po/common.properties/en-GB.po
+8	8	build/i18n/po/conify.dtd/cs-CZ.po
+9	9	build/i18n/po/conify.js/cs-CZ.po
+7	5	build/i18n/po/conify.js/en-GB.po
+4	4	build/i18n/po/conify/ar-JO.po
+14	14	build/i18n/po/conify/cs-CZ.po
+3206	3185	build/i18n/po/db.seed/ar-JO.po
+3175	3174	build/i18n/po/db.seed/cs-CZ.po
+2606	2540	build/i18n/po/fm_IDL.dtd/ar-JO.po
+2644	2572	build/i18n/po/fm_IDL.dtd/cs-CZ.po
+1221	1199	build/i18n/po/fm_IDL.dtd/de-DE.po
+1224	1202	build/i18n/po/fm_IDL.dtd/en-CA.po
+1224	1202	build/i18n/po/fm_IDL.dtd/en-GB.po
+1225	1203	build/i18n/po/fm_IDL.dtd/es-ES.po
+1225	1203	build/i18n/po/fm_IDL.dtd/fi-FI.po
+1221	1199	build/i18n/po/fm_IDL.dtd/fr-CA.po
+1221	1199	build/i18n/po/fm_IDL.dtd/he-IL.po
+1221	1199	build/i18n/po/fm_IDL.dtd/hu-HU.po
+1225	1203	build/i18n/po/fm_IDL.dtd/hy-AM.po
+1221	1199	build/i18n/po/fm_IDL.dtd/oc-FR.po
+1223	1201	build/i18n/po/fm_IDL.dtd/pt-BR.po
+1223	1201	build/i18n/po/fm_IDL.dtd/ru-RU.po
+1221	1199	build/i18n/po/fm_IDL.dtd/sv-SE.po
+1221	1199	build/i18n/po/fm_IDL.dtd/tr-TR.po
+6	6	build/i18n/po/ils_events.xml/ar-JO.po
+5	5	build/i18n/po/ils_events.xml/cs-CZ.po
+5	5	build/i18n/po/kpac/cs-CZ.po
+5	5	build/i18n/po/lang.dtd/ar-JO.po
+198	199	build/i18n/po/lang.dtd/cs-CZ.po
+4	4	build/i18n/po/match_set.js/en-GB.po
+8	8	build/i18n/po/offline.properties/ar-JO.po
+22	22	build/i18n/po/offline.properties/cs-CZ.po
+23	23	build/i18n/po/opac.dtd/ar-JO.po
+57	57	build/i18n/po/opac.dtd/cs-CZ.po
+8	8	build/i18n/po/opac.js/cs-CZ.po
+4	4	build/i18n/po/patron.properties/ar-JO.po
+32	32	build/i18n/po/patron.properties/cs-CZ.po
+11	7	build/i18n/po/patron.properties/en-GB.po
+5	5	build/i18n/po/pickup_and_return.js/cs-CZ.po
+5	5	build/i18n/po/pull_list.js/cs-CZ.po
+5	5	build/i18n/po/reports.dtd/ar-JO.po
+10	10	build/i18n/po/reports.dtd/cs-CZ.po
+13	13	build/i18n/po/reports.dtd/en-GB.po
+11	11	build/i18n/po/reports.js/cs-CZ.po
+4	4	build/i18n/po/selfcheck.js/cs-CZ.po
+5	4	build/i18n/po/serial.properties/ar-JO.po
+10	10	build/i18n/po/serial.properties/cs-CZ.po
+4	4	build/i18n/po/serial/ar-JO.po
+4	4	build/i18n/po/serial/cs-CZ.po
+266	264	build/i18n/po/tpac/ar-JO.po
+233	232	build/i18n/po/tpac/cs-CZ.po
+217	217	build/i18n/po/tpac/es-ES.po
+4	4	build/i18n/po/urlverify/cs-CZ.po
+6	6	build/i18n/po/vandelay.dtd/ar-JO.po
+9	9	build/i18n/po/vandelay.dtd/cs-CZ.po
+5	5	build/i18n/po/vandelay/ar-JO.po
+10	10	build/i18n/po/vandelay/cs-CZ.po
+1193	952	build/i18n/po/webstaff/ar-JO.po
+971	741	build/i18n/po/webstaff/cs-CZ.po
+870	657	build/i18n/po/webstaff/es-ES.po
+858	654	build/i18n/po/webstaff/hy-AM.po
+855	654	build/i18n/po/webstaff/ru-RU.po
+
+commit 2c9489fd07353018fc0ecbd2e8caab2ec410710a
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Fri Mar 2 14:19:39 2018 -0500
+
+    Translation updates - newpot
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+4	0	build/i18n/po/acq/acq.pot
+3	3	build/i18n/po/cat.properties/cat.properties.pot
+3	3	build/i18n/po/common.properties/common.properties.pot
+17	9	build/i18n/po/conify/conify.pot
+3545	3431	build/i18n/po/db.seed/db.seed.pot
+2455	2298	build/i18n/po/fm_IDL.dtd/fm_IDL.dtd.pot
+7	7	build/i18n/po/ils_events.xml/ils_events.xml.pot
+25	24	build/i18n/po/lang.dtd/lang.dtd.pot
+78	58	build/i18n/po/tpac/tpac.pot
+2	2	build/i18n/po/vandelay/vandelay.pot
+736	437	build/i18n/po/webstaff/webstaff.pot
+
+commit 425bc5e41e99e2eaf1c87f8fc2e94103574316e4
+Author: Jeff Godin <jgodin at tadl.org>
+Date:   Thu Mar 1 14:06:06 2018 -0500
+
+    LP#1748924 Stamping upgrade script
+    
+    Stamping upgrade script for expanding billing timestamps
+    
+    Signed-off-by: Jeff Godin <jgodin at tadl.org>
+
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+53	0	Open-ILS/src/sql/Pg/upgrade/1106.data.expand_billing_timestamps.sql
+0	53	Open-ILS/src/sql/Pg/upgrade/XXXX.data.expand_billing_timestamps.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1106.data.expand_billing_timestamps.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.expand_billing_timestamps.sql
+
+commit 2eb265e1e1c4a64d65c8045da82539633e45b6e8
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Thu Mar 1 13:41:06 2018 -0500
+
+    LP#1748924 Disable materialized summary updates in upgrade script
+    
+    We are not touching billing_ts, so this trigger eats up a lot of
+    time for nothing.  Disable it during the upgrade process.
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+    Signed-off-by: Jeff Godin <jgodin at tadl.org>
+
+8	0	Open-ILS/src/sql/Pg/upgrade/XXXX.data.expand_billing_timestamps.sql
+
+commit 341ac34fd85fb85a2cd050f498925fbe422a3478
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Fri Nov 6 14:38:37 2015 -0500
+
+    LP#1748924 Add release notes
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+    Signed-off-by: Jeff Godin <jgodin at tadl.org>
+
+15	0	docs/RELEASE_NOTES_NEXT/Circulation/billing_ts_now_reflect_billing_time.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/billing_ts_now_reflect_billing_time.adoc
+
+commit ec2cb1a293749522772f1bf967d3d2e0acb0920d
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Mon Feb 12 10:48:14 2018 -0500
+
+    LP#1748924 Upgrade script for expanding billing timestamps
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+    Signed-off-by: Jeff Godin <jgodin at tadl.org>
+
+45	0	Open-ILS/src/sql/Pg/upgrade/XXXX.data.expand_billing_timestamps.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.expand_billing_timestamps.sql
+
+commit 73a8eaaf265b992bc37b7930c1a4c0a5f75e6a57
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Mon Feb 12 10:11:33 2018 -0500
+
+    LP#1748924 Enhanced Billing Timestamp Support
+    
+    As discussed at Hack-a-way 2016, rather than continue to try to cram
+    multiple meanings into one timestamp, let's create a complete set of
+    all the useful timestamps for a typical billing.
+    
+    In this new config, every billing will have a 'create_date', then most
+    (overdues) will also describe when they start and end.
+    
+    billing_ts is now deprecated, but will continue to exist for backwards
+    compatibility.  It will be managed by trigger to approximate its
+    current definition; equal to 'period_end' for overdues, equal to
+    'create_date' for other billings.
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+    Signed-off-by: Jeff Godin <jgodin at tadl.org>
+
+4	1	Open-ILS/examples/fm_IDL.xml
+14	11	Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm
+2	1	Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+2	1	Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
+16	2	Open-ILS/src/sql/Pg/080.schema.money.sql
+
+commit 7d7736e4910b416bb61d9387c908427960dfe2f5
+Author: Kathy Lussier <klussier at masslnc.org>
+Date:   Thu Mar 1 10:16:24 2018 -0500
+
+    Docs: minor file name change for release notes entry
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+0	9	docs/RELEASE_NOTES_NEXT/Acquisitions/RELEASE_NOTE_TEMPLATE.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Acquisitions/RELEASE_NOTE_TEMPLATE.adoc
+
+commit 81ff48ea26278df389d6855ac5e128e071506045
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Wed Dec 20 18:38:28 2017 -0500
+
+    LP#1739504 - create prototype of latency test tool in webstaff
+    
+    Basic websocket latency tester. Just pings opensrf.system.echo.
+    Initial first test runs 10 pings, calculates average each time.
+    
+    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    
+    Conflicts:
+    	Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
+    
+    Add missing pieces for latency tester (commits got out of order,
+    sorry!).
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+9	0	Open-ILS/src/templates/staff/admin/workstation/t_splash.tt2
+41	0	Open-ILS/src/templates/staff/admin/workstation/t_tests.tt2
+6	0	Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
+ create mode 100644 Open-ILS/src/templates/staff/admin/workstation/t_tests.tt2
+
+commit 2b3c5f1e9c0801e896ea0f2b2bda6373598b2a18
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Wed Feb 28 14:34:10 2018 -0500
+
+    LP#1739504 - add release notes for Latency Tester
+    
+    A word about the Latency Tester.
+    
+    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+14	0	docs/RELEASE_NOTES_NEXT/Administration/latency_tester_tool.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Administration/latency_tester_tool.adoc
+
+commit b529835718c0572ccd94cb37f2a8b3bd4e7302fe
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Thu Jan 4 12:56:12 2018 -0500
+
+    LP#1739504 - Fire off each ping sequentially
+    
+    As suggested by berick, tweaking latency tester
+    to sequentially fire off pings.
+    
+    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    
+    Conflicts:
+    	Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+80	0	Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
+
+commit 13be0c3e4bd80a5f899b8d7723b9e6b64efe738e
+Author: Kathy Lussier <klussier at masslnc.org>
+Date:   Wed Feb 28 20:16:44 2018 -0500
+
+    LP#1732275: Stamping upgrade script for items out notice count setting
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+9	0	Open-ILS/src/sql/Pg/upgrade/1105.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
+0	9	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1105.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
+
+commit 496cbae93a52657d2ae615044faef32b9a4229ba
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 28 17:15:21 2018 -0500
+
+    LP#1732275: add release notes entry
+    
+    To test the page series:
+    
+    [1] Create a patron that has at least two loans, one that is
+        overdue by 7 days and one that will be due in 3 days.
+    [2] Activate the '3 Day Courtesy Notice' and '7 Day Overdue Email Notification'
+        action trigger events, then generate events for those two loans
+        by running something like this:
+    
+        action_trigger_runner.pl --hooks=checkout.due --process-hooks
+        action_trigger_runner.pl --run-pending
+    
+        Note that --run-pending is needed to ensure that the events are
+        complete, as the new columns include only checkout.due events
+        that are complete. (Pending ones don't count because no notification
+        would have yet made its way to the patron.)
+    [3] Apply the patch.
+    [4] Verify that the patron Items Out grid in the web staff client
+        now has Total Notices and Last Notice columns respectively
+        including the count of notices and the date of the last one.
+    [5] Turn on the webstaff.circ.itemsout_notice_count_excludes_courtesies
+        library setting and refresh the grid. This time, the courtesy notice
+        event should not be reflected by those two columns.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+13	0	docs/RELEASE_NOTES_NEXT/Circulation/Notice_Columns_in_Items_out_Grid.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/Notice_Columns_in_Items_out_Grid.adoc
+
+commit 99fc86c8cff8a3db0566e6769c0c4cfff0b84906
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Mon Dec 18 16:10:10 2017 -0500
+
+    LP#1732275 - Add Notices Data to Patron Itemsout
+    
+    Prep upgrade script for new YAOUS:
+    'webstaff.circ.itemsout_notice_count_excludes_courtesies'
+    
+    Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    
+    Conflicts:
+    	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+14	0	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+9	0	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.webstaff.circ.itemsout_notice_count_excludes_courtesies.sql
+
+commit 805c8bee83fb1b384e6f8625f21aa0686da0368e
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Fri Dec 8 13:50:38 2017 -0500
+
+    LP#1732275: Patron Itemsout Notices - Add YAOUS for pre-due notices
+    
+    Adding library permission 'webstaff.circ.itemsout_notice_count_excludes_courtesies'
+    so that pre-due/courtesy events aren't included in the notices count.
+    
+    Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+6	0	Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
+
+commit 726a3efe800bead97eaf7b71d78272dbb3dc3354
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Mon Nov 13 18:25:05 2017 -0500
+
+    LP#1732275: add open-ils.actor.user.itemsout.notices api
+    
+    Add a method to Actor.pm to count completed action
+    trigger events for a given circ and return the latest
+    notice date. Uses the json_query for performance.
+    
+    Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+59	0	Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
+
+commit 60826097e4bf8692297c09efc666978e3786ccec
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Fri Nov 10 16:01:41 2017 -0500
+
+    LP#1732275: Add a Last Notice date and a Notices count column
+    
+    This adds the above 2 columns to Patron Items Out grid,
+    and preps the frontend for using the new service method.
+    
+    Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    
+    Conflicts:
+    	Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+2	0	Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2
+15	6	Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+
+commit 88a86373120a024dc361c365ccbad303d601ed8e
+Author: Jason Stephenson <jason at sigio.com>
+Date:   Mon Nov 27 15:48:06 2017 -0500
+
+    Lp 1350916: marc_export --uris option release notes.
+    
+    Add release notes for the new --uris option on marc_export.
+    
+    To test the new option, run marc_export to export records with
+    holdings for a given library using the --library and --items options.
+    If that library also has electronic resources, do another export with
+    the same options but add the --uris option and direct this output to a
+    different file.  Compare the file sizes.  The second file should be
+    larger than the first.
+    
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+12	0	docs/RELEASE_NOTES_NEXT/Administration/marc_export_uris_option.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Administration/marc_export_uris_option.adoc
+
+commit 82c91c0e35c2e60a3f7315613612c87df68ffad2
+Author: Jason Stephenson <jason at sigio.com>
+Date:   Tue Nov 14 14:21:45 2017 -0500
+
+    Lp 1350916: Add located URI option to marc_export.
+    
+    Add code to marc_export to support exporting records with located
+    URIs.
+    
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+33	0	Open-ILS/src/support-scripts/marc_export.in
+
+commit af3545816d23502107d426a3e3d70e3cf4a96934
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 28 16:50:14 2018 -0500
+
+    LP#1661688: tweak schema update
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+19	0	Open-ILS/src/sql/Pg/upgrade/1104.data.hold_checkout_ou.sql
+0	19	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1104.data.hold_checkout_ou.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
+
+commit a5e0c10845437717d44e01496cef5fbac081c179
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 28 16:30:46 2018 -0500
+
+    LP#1661688: tweaks to release notes
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+5	4	docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc
+
+commit 9183f2503a358cd73b520ebb61e93bf0dc1c7a6c
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 28 16:28:01 2018 -0500
+
+    LP#1661688: tweak code for style and whitespace
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+24	29	Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+
+commit c97b4ddb75823e4f5df14ec74a9d1ead95bc9c06
+Author: Kathy Lussier <klussier at masslnc.org>
+Date:   Wed Feb 21 15:19:34 2018 -0500
+
+    LP#1661688: Add a link and other tweaks to alternate hold pickup feature
+    
+    Adding a couple of tweaks to the alternate hold pickup feature:
+      * Created a link for the hold patron so that staff can easily retrieve the record and potentially verify that the user allows the alternate patron to pick
+    up their holds.
+      * Tweaked the language in the event dialog.
+      * Removed the new OU setting from actor.org_unit_setting so that a default value is not set.
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+1	1	Open-ILS/src/extras/ils_events.xml
+1	0	Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+0	8	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+0	8	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
+2	2	Open-ILS/src/templates/staff/circ/share/t_event_override_dialog.tt2
+1	0	Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+
+commit 102eaa97e108c6479d02c8d6e1cb4536e776f714
+Author: Jason Stephenson <jason at sigio.com>
+Date:   Mon Dec 18 10:32:08 2017 -0500
+
+    Lp 1661688: Change new setting description.
+    
+    Alter the circ.clear_hold_on_checkout description to be more clear
+    about what it does.
+    
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Dan Pearl <dpearl at cwmars.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+1	3	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+1	3	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
+
+commit 3e9885804533b9cfea07efd0eee0ec9f889e8b37
+Author: Jason Stephenson <jason at sigio.com>
+Date:   Fri Dec 15 11:21:43 2017 -0500
+
+    Lp 1661688: Fix undefined value error in Circulate.pm.
+    
+    We needed to check that there was a hold before picking out the hold
+    usr.
+    
+    Also, fix an error in the flesh code added by this branch.  We don't
+    need to flesh text fields from actor.usr.
+    
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Dan Pearl <dpearl at cwmars.org>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+14	15	Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+
+commit 3e081d1ee518cbfa3b53b1d261aa773831ecd365
+Author: Dan Pearl <dpearl at cwmars.org>
+Date:   Tue Jan 24 13:59:01 2017 -0500
+
+    LP##1661688 - Want easy way to clear a hold when picked up by other patron.
+    
+    This common action was handled previously as
+        1) item is scanned - The system detects that this items is for a different
+           patron, and an error message is displayed.
+    
+        2) Force Override was selected - If the librarian had the appropriate
+           privileges, the Force Override could allow the checkout to occur.
+    
+        3) librarian cancels original hold - This independent operation would
+           be needed to cancel the original hold, otherwise the hold would be
+           targeted again.
+    
+    This feature provides the option to cancel the hold in step #2. An error
+    message will be displayed as before, but within that message will be a checkbox to allow cancelling of the original hold which, if checked, will mean that step #3 will be automatically done.
+    
+    The checked/non-checked state of the checkbox is initialized with an
+    organizational unit setting. The default is false (to preserve default
+    prior behavior).
+    
+    Note: This change only affects the "web client".
+    
+    TO TEST THIS
+    
+    A. Before the Patch
+    
+    Hold an item for patron "A".  Attempt to check it out for patron "B".
+    Observe the choices to Force Override (to allow the checkout) or to cancel.
+    Do a Force Override and observe that the original hold is still active.
+    
+    B. After the Patch
+    
+    Repeat the above scenario, and observe the (blank) checkbox.  Perform the
+    Force Override and observe that the original hold is still active.
+    
+    Repeat the scenario, except this time check the checkbox.  Observe after the checheckout is done that original hold is gone.
+    
+    Adjust the organizational setting (see the Release Notes) to change the default
+    appearance of the checkbox.
+    
+    For completeness, you can verify that if you cancel out the message pop-up that the checkout is cancelled and and that the hold status is unchanged, regardless of the state of the checkbox.
+    
+    Signed-off-by: Dan Pearl <dpearl at cwmars.org>
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+17	2	Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+23	0	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+29	0	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
+8	0	Open-ILS/src/templates/staff/circ/share/t_event_override_dialog.tt2
+46	2	Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+20	0	docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.hold_checkout.sql
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/alternate_patron_hold_pickup.adoc
+
+commit b0a1c725e2b97e5108ad7071c8c9bd96e2ad4ef5
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Wed Feb 28 16:30:26 2018 -0500
+
+    LP#1744385: Stamping upgrade scripts for search and display infrastructure improvements
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+260	0	Open-ILS/src/sql/Pg/upgrade/1100.data.display-field-seed-data.sql
+575	0	Open-ILS/src/sql/Pg/upgrade/1101.schema.highlight_search.sql
+6897	0	Open-ILS/src/sql/Pg/upgrade/1102.data.mods-title-punctuation-change.sql
+73	0	Open-ILS/src/sql/Pg/upgrade/1103.data.virtual_index_defs.sql
+0	260	Open-ILS/src/sql/Pg/upgrade/WWWW.data.display-field-seed-data.sql
+0	573	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.highlight_search.sql
+0	6895	Open-ILS/src/sql/Pg/upgrade/YYYY.data.mods-title-punctuation-change.sql
+0	71	Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1100.data.display-field-seed-data.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1101.schema.highlight_search.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1102.data.mods-title-punctuation-change.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1103.data.virtual_index_defs.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/WWWW.data.display-field-seed-data.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.highlight_search.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/YYYY.data.mods-title-punctuation-change.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql
+
+commit 180e3329fcce010b58b9e9ca826f9c1757e091e3
+Author: Kathy Lussier <klussier at masslnc.org>
+Date:   Mon Feb 26 15:04:30 2018 -0500
+
+    LP#1744385: Additions and edits to release note entry
+    
+    Minor edits to the release notes entry. Also, I highlighted the increased
+    use of Display Fields in the client since I thought it would be of
+    interest to some users. I also incorporated information regarding
+    default weights, which were added after Mike wrote up his release
+    note for this feature.
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+27	8	docs/RELEASE_NOTES_NEXT/Architecture/search-display-infrastructure-improvements.adoc
+
+commit 33fe8e6a0824dfa6fc1884b1485f1a7ceb5b7b68
+Author: Kathy Lussier <klussier at masslnc.org>
+Date:   Mon Feb 26 14:26:42 2018 -0500
+
+    LP#1744385: Adding Mike's commit message as a starter release note entry
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+135	0	docs/RELEASE_NOTES_NEXT/Architecture/search-display-infrastructure-improvements.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Architecture/search-display-infrastructure-improvements.adoc
+
+commit 5b311a2525e500e86f9cb60aaceb0cd414f6c821
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Mon Feb 26 11:52:27 2018 -0500
+
+    LP#1744385: Remove debug timing display
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+1	1	Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
+
+commit 867cc29335d15c5c30a8311c12b150320a0f2f4f
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Fri Feb 23 10:32:19 2018 -0500
+
+    LP#1744385: Final seed data fixups
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+5	5	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+43	3	Open-ILS/src/sql/Pg/953.data.MODS32-xsl.sql
+43	1	Open-ILS/src/sql/Pg/954.data.MODS33-xsl.sql
+4	4	Open-ILS/src/sql/Pg/upgrade/WWWW.data.display-field-seed-data.sql
+1	1	Open-ILS/src/sql/Pg/upgrade/YYYY.data.mods-title-punctuation-change.sql
+1	1	Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql
+
+commit dc8348576b4e523e9f89d32f967b2c80996c4be9
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Mon Feb 26 12:05:37 2018 -0500
+
+    LP#1744385: Treat phrase terms the same as non-phrase terms WRT dictionaries
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+5	10	Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
+
+commit 3d1fcf23bcdf2cf473efa34336c11bbab5af5f6b
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Thu Feb 22 15:19:14 2018 -0500
+
+    LP#1744385: Adjust function for a change in PLPgSQL in PG 9.4.16
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+1	1	Open-ILS/src/sql/Pg/300.schema.staged_search.sql
+1	1	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.highlight_search.sql
+
+commit 5d3b69c77c92f21308d7df6fae340a6f5acc2e33
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Thu Feb 22 13:08:51 2018 -0500
+
+    LP#1744385: Add "Main Title" index definition and set reasonable defaults for virtual weighting
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+21	0	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+21	0	Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql
+
+commit 024ec4c056c9f536b6f9e018b760c9e19bdebe8a
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Thu Feb 22 10:47:16 2018 -0500
+
+    LP#1744385: Add genre stemming to baseline schema
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+2	0	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+
+commit 767e7caa07d9281730b52b5ba6d7ff78ba77fc89
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Wed Feb 21 16:39:21 2018 -0500
+
+    LP#1744385: Update seed data with more Display Field mappings
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+6	0	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+6	0	Open-ILS/src/sql/Pg/upgrade/WWWW.data.display-field-seed-data.sql
+
+commit 952c1af10ad6501603199ebe8ea9e1568beffc84
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Wed Feb 21 15:08:35 2018 -0500
+
+    LP#1744385: Make use of short-term unAPI cache and parallelize metarecord constituent retrieval
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+17	7	Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
+75	72	Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
+
+commit fd45adb4bd298031dff98d31b571394db3a5397a
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Tue Feb 20 16:39:54 2018 -0500
+
+    LP#1744385: Fix typo and allow stemmed search and highlighting of Genre
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+1	1	Open-ILS/src/sql/Pg/300.schema.staged_search.sql
+1	1	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.highlight_search.sql
+7	0	Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql
+
+commit 57166723680ed2cbd5cb130d5a0c4d71e2ced7bc
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Mon Feb 19 17:50:15 2018 -0500
+
+    LP#1744385: Limit UNIONs and fields therein to those that have different weights for the virtual map
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+15	10	Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
+
+commit 3817746d6c53f74f74451d53f018e73db6ca6bb6
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Mon Feb 19 16:48:33 2018 -0500
+
+    LP#1744385: Parallelize highlight gathering with XML feed retrieval
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+2	1	Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
+13	1	Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
+16	1	Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
+0	2	Open-ILS/src/templates/opac/parts/misc_util.tt2
+
+commit 194cc82b3192c5af15ec2dd51db9ae7e9560382e
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Mon Feb 19 16:46:59 2018 -0500
+
+    LP#1744385: Add highlighting for ISBN and ISSN
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+10	2	Open-ILS/src/templates/opac/parts/record/summary.tt2
+
+commit 0df4f2951febd2db9c3eb3450690cf3a273c5a6d
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Fri Feb 16 12:35:41 2018 -0500
+
+    LP#1744385: Speed up highlighting
+    
+    This commit removes a layer of opensrf-perl indirection and uses cstore
+    instead of storage for retrieval.  This trims seconds off the render time
+    of results and a bit off record detail.
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+28	12	Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
+0	43	Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm
+6	3	Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
+15	8	Open-ILS/src/sql/Pg/300.schema.staged_search.sql
+1	1	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+1	1	Open-ILS/src/sql/Pg/upgrade/WWWW.data.display-field-seed-data.sql
+16	8	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.highlight_search.sql
+5	0	Open-ILS/src/templates/opac/parts/misc_util.tt2
+
+commit 7edd82750b408c8f1eb5ebcb66a2de16d71cd46e
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Fri Feb 16 12:27:24 2018 -0500
+
+    LP#1744385: Use series_title highlighting in OPAC
+    
+    Here we replace the series title link generation based directly on the MARCXML
+    with the Display Field equivalent.  Note, the previous method created broken
+    links in many cases, because it included more in the search terms than were
+    being indexed by the stock series title definition.
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    
+    Starting #	../../../../multi-source-attrs.sql
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+41	29	Open-ILS/src/templates/opac/parts/record/series.tt2
+
+commit a985c99897d9f2d53609be17c5abef67234a3635
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Wed Feb 14 12:52:21 2018 -0500
+
+    LP#1744385: Optimize real-field additions to virtual field searches
+    
+    Now we only add on UNION query for each class providing real fields to a
+    virtual field, rather than a UNION per real field.  This should reduce
+    core-query run time.
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+10	2	Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
+
+commit 78fd5304ed7bc7c04c1fec24e6c5cd26b503d73f
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Wed Feb 14 12:25:25 2018 -0500
+
+    LP#1744385: Adjust virtual-combined-class real-field search
+    
+    Instead of searching by combined field within the rank-addition real fields,
+    we'll just search on the fields itself.  This preserves the ranking additions
+    provided by the real-virtual mapping.
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+15	20	Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
+
+commit 5f1247385514bda1ce2b9bce06612b311bd71f11
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Fri Feb 9 15:19:31 2018 -0500
+
+    LP#1744385: Various improvements based on testing
+    
+     * Improve author and publisher display fields
+     * Reimplement Simple Record Extracts using Display Fields
+     * Address potential failure in combined search collection
+     * Provide useful helper function for inspecting transformed records
+     * Implement MODS transforms specified by LoC documentation but not
+       actually included in the stylesheet
+     * Expand highlighting use to publisher, edition, and physical description
+     * Reifying schema from updates
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+21	19	Open-ILS/src/sql/Pg/030.schema.metabib.sql
+22	2	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+4	0	Open-ILS/src/sql/Pg/999.functions.global.sql
+9	26	Open-ILS/src/sql/Pg/reporter-schema.sql
+64	21	Open-ILS/src/sql/Pg/upgrade/WWWW.data.display-field-seed-data.sql
+6	0	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.highlight_search.sql
+80	2	Open-ILS/src/sql/Pg/upgrade/YYYY.data.mods-title-punctuation-change.sql
+17	3	Open-ILS/src/templates/opac/parts/record/summary.tt2
+
+commit 9e3f4dc75f8636c430d4a144bd62396e5a825350
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Fri Jan 26 16:52:09 2018 -0500
+
+    LP#1744385: Set best order for upgrade scripts
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+211	0	Open-ILS/src/sql/Pg/upgrade/WWWW.data.display-field-seed-data.sql
+0	211	Open-ILS/src/sql/Pg/upgrade/XXXX.data.display-field-seed-data.sql
+0	43	Open-ILS/src/sql/Pg/upgrade/YYYY.data.virtual_index_defs.sql
+43	0	Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/WWWW.data.display-field-seed-data.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.display-field-seed-data.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/YYYY.data.virtual_index_defs.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql
+
+commit f5c6bffd3645e538d6908d5967004b5648b5478f
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Wed Jan 10 14:44:48 2018 -0500
+
+    LP#1744385: Allow highlight disabling globally via config.tt2
+    
+    Also, add CC0 highlighter icon from https://pixabay.com/en/highlight-highlighter-highlighting-2022407/
+    and provide highlight en/dis-able.
+    
+    Signed-off-by: Mike Rylander <miker at esilibrary.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+3	0	Open-ILS/src/templates/opac/parts/config.tt2
+1	1	Open-ILS/src/templates/opac/parts/misc_util.tt2
+12	0	Open-ILS/src/templates/opac/parts/record/summary.tt2
+10	2	Open-ILS/src/templates/opac/parts/searchbar.tt2
+-	-	Open-ILS/web/images/highlight.png
+ create mode 100644 Open-ILS/web/images/highlight.png
+
+commit f96108efd162213e0728b1286c3b5e5fbd86683a
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Fri Jan 12 15:24:12 2018 -0500
+
+    LP#1744385: Additional seed data and display field use in the OPAC
+    
+    ... and teach subjects.tt2 how to search with a facet in HL mode (for genre)
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+32	0	Open-ILS/src/sql/Pg/upgrade/XXXX.data.display-field-seed-data.sql
+2	1	Open-ILS/src/sql/Pg/upgrade/YYYY.data.virtual_index_defs.sql
+6	1	Open-ILS/src/templates/opac/parts/record/contents.tt2
+9	2	Open-ILS/src/templates/opac/parts/record/subjects.tt2
+
+commit dafb624be8bc31b83e8b503d248f7131fed4c580
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Mon Sep 11 15:24:55 2017 -0400
+
+    LP#1744385: Search and Result Display improvements
+    
+    == Virtual Index Definitions
+    
+    The practical purpose of Virtual Index Definitions is to supply an Evergreen administrator with
+    the ability to control the weighting and field inclusion of values in the general keyword index,
+    commonly referred to as "the blob," without requiring tricky configuration that has subtle semantics, an
+    over-abundance of index definitions which can slow search generally, or the need to reingest all
+    records on a regular basis as experiments are performed and the configuration refined. Significant
+    results of recasting keyword indexes as a set of one or more Virtual Index Definitions will be simpler
+    search configuration management, faster search speed overall, and more practical reconfiguration and
+    adjustment as needed.
+    
+    Previous to this commit, in order to provide field-specific weighting to keyword matches against titles or authors, an
+    administrator must duplicate many other index definitions and supply overriding weights to those
+    duplicates. This not only complicates configuration, but slows down record ingest as well as search. It
+    is also fairly ineffective at achieving the goal of weighted keyword fields. Virtual Index Definitions will
+    substantially alleviate the need for these workarounds and their consequences.
+    
+      * A Virtual Index Definition is not required supply any configuration for extracting bibliographic
+        data from records, but instead can become a sink for data collected by other index definitions
+        which is then colocated together to supply a search target made up of the separately extracted
+        data. Virtual Index Definitions are effectively treated as aggregate definitions, matching across
+        all values extracted from constituent non-virtual index definitions.  They can further make use
+        of the Combined class functionality to colocate all values in a class together for matching even
+        across virtual fields.
+    
+      * Configuration allows for weighting of constituent index definitions that participate in a
+        Virtual Index Definition. This weighting is separate from the weighting supplied when the index
+        definition itself is a search target.
+    
+      * The Evergreen QueryParser driver returns the list of fields actually searched using every
+        user-supplied term set, including constituent expansion when a Virtual Index Definition is
+        searched. In particular, this will facilitate Search Term Highlighting described below.
+    
+      * Stock configuration changes make use of pre-existing, non-virtual index definitions mapped
+        to new a Virtual Index Definition that implements the functionality provided by the
+        keyword|keyword index definition. The keyword|keyword definition is left in place for the time
+        being, until more data can be gathered about the real-world effect of removing it entirely and
+        replacing it with Virtual Index Definition mappings.
+    
+      * New system administration functions will be created to facilitate modification of Virtual Index
+        Definition mapping, avoiding the need for a full reingest when existing index definitions are
+        added or removed from a virtual field.
+    
+    == Increased use of Metabib Display Fields
+    
+    In extention of changes proposed in other available branches, we here use Metabib Display Fields
+    to render catalog search results, intermediate metarecord results, and record detail pages.
+    This will requires the addition of several new Metabib Display Field definitions, as well as Perl
+    services to gather and render the data.
+    
+    == Search Term Highlighting
+    
+    This commit enables Search Term Highlighting in the OPAC on the main search results page, the record
+    detail page, and intermediate pages such as metarecord grouped results page. Highlighting
+    search terms will help the user determine why a particular record (or set of records) was retrieved.
+    
+    Highlighting of matched terms uses the same stemming used to accomplish the search, as configured
+    per field and class.
+    
+    This feature will help the user more quickly determine the relevance of a particular record by calling their
+    attention to search terms in context. Lastly, it will help familiarize the user with how records are
+    searched, including which fields are searched as well as exposing concepts like stemming.
+    
+    == Interfaces
+    
+    A new AngularJS "MARC Search/Facet Fields" interface has been created to replace the Dojo version, and
+    both have been extended to support Virtual Index Definition data supplier mapping and weighting.
+    
+    == Settings & Permissions
+    
+    The new Virtual Index Definition data supplier mapping table, config.metabib_field_virtual_map, requires
+    the same permissions as the MARC Search/Facet Fields interface: CREATE_METABIB_FIELD, UPDATE_METABIB_FIELD,
+    DELETE_METABIB_FIELD, or ADMIN_METABIB_FIELD for all actions
+    
+    There is a new template-level global configuration variable in config.tt2 called search.no_highlight
+    which disables highlighting for users of that config.tt2 instance.
+    
+    == Public Catalog
+    
+    The public and staff catalog will make use of new APIs to identify and display highlight-augmented
+    values for those Display Fields used to render the search result pages, intermediate metarecord
+    constituent pages, and record detail pages.  Highlighting of terms will be performed using the
+    application of Template::Toolkit-driven CSS. A generic CSS class identifying a highlighted term,
+    along with CSS classes identifying the search class and each search field will be available for
+    use for customization of the highlighting. A stock CSS
+    template is provided as a baseline upon which sites may expand.
+    
+    When highlighting is generally enabled, it may be turned on or off on a per-page basis through the use of
+    a UI component which will request the page again without highlighting.
+    
+    == Backend
+    
+    There now exist several new database tables and functions primarily in support of search highlighting.
+    Additionally, the QueryParser driver for Evergreen has been augmented to be able to return a data structure
+    describing how the search was performed, in a way that allows a separate support API to gather a highlighted
+    version of the Display Field data for a given record.
+    
+    == Re-ingest or Indexing Dependencies
+    
+    With the addition and modification of many Index Definitions, a full reingest is recommended.  However, search
+    will continue to work as it did before the changes in this commit for those records that have not yet been
+    reingested during that process.  Therefore a slow, rolling reingest is recommended.
+    
+    == Performance Implications or Concerns
+    
+    Because the Metabib Display Fields infrastructure will eventually replace functionality that is significantly more
+    CPU-intensive in the various forms of XML parsing, XSLT transformation, XPath calculation, and
+    Metabib Virtual Record construction, it is expected that the overall CPU load will be reduced by this
+    development, and ideally the overall time required to perform and render a search will likewise drop. It
+    is unlikely that the speed increase will be visible to users on a per-search basis, but that search in
+    aggregate will become a smaller consumer of resources.
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+36	8	Open-ILS/examples/fm_IDL.xml
+24	0	Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
+7	0	Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm
+194	31	Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
+48	0	Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm
+20	1	Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm
+10	0	Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
+23	2	Open-ILS/src/sql/Pg/002.schema.config.sql
+116	20	Open-ILS/src/sql/Pg/030.schema.metabib.sql
+133	0	Open-ILS/src/sql/Pg/300.schema.staged_search.sql
+134	2	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+10	41	Open-ILS/src/sql/Pg/upgrade/XXXX.data.display-field-seed-data.sql
+559	0	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.highlight_search.sql
+6817	0	Open-ILS/src/sql/Pg/upgrade/YYYY.data.mods-title-punctuation-change.sql
+42	0	Open-ILS/src/sql/Pg/upgrade/YYYY.data.virtual_index_defs.sql
+9	3	Open-ILS/src/support-scripts/test-scripts/query_parser.pl
+23	1	Open-ILS/src/templates/conify/global/config/metabib_field.tt2
+77	0	Open-ILS/src/templates/conify/global/config/metabib_field_virtual_map.tt2
+10	0	Open-ILS/src/templates/opac/css/style.css.tt2
+41	7	Open-ILS/src/templates/opac/parts/misc_util.tt2
+28	4	Open-ILS/src/templates/opac/parts/record/authors.tt2
+12	4	Open-ILS/src/templates/opac/parts/record/contents.tt2
+34	3	Open-ILS/src/templates/opac/parts/record/subjects.tt2
+1	1	Open-ILS/src/templates/opac/parts/record/summary.tt2
+2	2	Open-ILS/src/templates/opac/parts/result/table.tt2
+64	0	Open-ILS/src/templates/staff/admin/server/config/metabib_field.tt2
+41	0	Open-ILS/src/templates/staff/admin/server/config/metabib_field_virtual_map.tt2
+93	0	Open-ILS/web/js/ui/default/staff/admin/server/config/metabib_field.js
+98	0	Open-ILS/web/js/ui/default/staff/admin/server/config/metabib_field_virtual_map.js
+5	14	Open-ILS/web/js/ui/default/staff/services/fm_record_editor.js
+3	1	Open-ILS/web/js/ui/default/staff/services/grid.js
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.highlight_search.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/YYYY.data.mods-title-punctuation-change.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/YYYY.data.virtual_index_defs.sql
+ create mode 100644 Open-ILS/src/templates/conify/global/config/metabib_field_virtual_map.tt2
+ create mode 100644 Open-ILS/src/templates/staff/admin/server/config/metabib_field.tt2
+ create mode 100644 Open-ILS/src/templates/staff/admin/server/config/metabib_field_virtual_map.tt2
+ create mode 100644 Open-ILS/web/js/ui/default/staff/admin/server/config/metabib_field.js
+ create mode 100644 Open-ILS/web/js/ui/default/staff/admin/server/config/metabib_field_virtual_map.js
+
+commit 4d4a1c92c29061a7fbef649b0b1ab65c544a32f3
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Thu Oct 26 16:24:30 2017 -0400
+
+    LP#1727487 Display field JS utils more docs
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+21	10	Open-ILS/web/js/ui/default/staff/cat/services/record.js
+
+commit da1bc239fdefd358173e82b2c13d76a5aa6fd701
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Thu Oct 26 15:55:46 2017 -0400
+
+    LP#1727487 Webstaff record summary uses display fields
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+7	7	Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2
+5	10	Open-ILS/web/js/ui/default/staff/cat/services/record.js
+
+commit 2fcd2d03891dba2474fb137e40aa1c8964311d10
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Thu Oct 26 15:17:45 2017 -0400
+
+    LP#1727487 Webstaff In-House-Use uses display fields
+    
+    Replace reporter.simple_record data with metabib display fields.
+    
+    Use flat_display_entries instead of wide_display_entry partially as an
+    example, but also because it requires slightly less data munging on the
+    DB side.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    
+    Conflicts:
+    	Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+1	0	Open-ILS/src/templates/staff/circ/in_house_use/index.tt2
+14	4	Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js
+
+commit b5abea61bc73cc092e415bd0d2ab3c805d25a1c7
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Thu Oct 26 15:14:15 2017 -0400
+
+    LP#1727487 Items out display uses collapsed display fields
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+3	3	Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+
+commit d58bbd561aef5b2b48f28b2c84423dd233c78264
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Thu Oct 26 15:10:17 2017 -0400
+
+    LP#1727487 Webstaff display fields collapseMulti option
+    
+    Support an option in the webstaff-side display field munging code to
+    collapse array/multi values down to a single comma-separated string.
+    
+    This is useful for buidling displays (grids especially) where you have a
+    single spot to put a field's value (e.g. a list of ISBN's) and don't want
+    to munge the data by hand in each UI.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+28	6	Open-ILS/web/js/ui/default/staff/cat/services/record.js
+
+commit 526584fa959bf9f03ae6adfb5ef2446d5b9b1d0b
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Thu Oct 26 12:25:51 2017 -0400
+
+    LP#1727487 Webstaff Items Out uses display fields
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    
+    Conflicts:
+    	Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+2	2	Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2
+16	9	Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+
+commit c12daecfc0bc0cf0303837a0d97f1c9e6589d61e
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Wed Oct 25 18:07:53 2017 -0400
+
+    LP#1727487 Display field seed data WIP
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+15	2	Open-ILS/examples/fm_IDL.xml
+210	0	Open-ILS/src/sql/Pg/upgrade/XXXX.data.display-field-seed-data.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.display-field-seed-data.sql
+
+commit 8ec458c85b49fb5014ba9e7264d41fd3a55a30d1
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 28 11:41:30 2018 -0500
+
+    LP#1676608: avoid constraint creation that requires a TARDIS
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+4	4	Open-ILS/src/sql/Pg/upgrade/1095.schema.copy_alerts.sql
+
+commit e1e36e133d81248245630efd633810ea6493b792
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 28 11:39:58 2018 -0500
+
+    set correct file extension for 1093 schema update script
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+0	8	Open-ILS/src/sql/Pg/upgrade/1093.data.multiple_language_search
+8	0	Open-ILS/src/sql/Pg/upgrade/1093.data.multiple_language_search.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/1093.data.multiple_language_search
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1093.data.multiple_language_search.sql
+
+commit 8df62c2dda66962b180ac4e5160c15ac910e64a3
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Wed Feb 28 11:28:48 2018 -0500
+
+    Stamping follow-up upgrade script for copy alerts
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+17	0	Open-ILS/src/sql/Pg/upgrade/1099.data.more-copy-alerts-active-by-default.sql
+0	17	Open-ILS/src/sql/Pg/upgrade/ZZZB.data.more-copy-alerts-active-by-default.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1099.data.more-copy-alerts-active-by-default.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/ZZZB.data.more-copy-alerts-active-by-default.sql
+
+commit a7099251502bda890ea4a8c2cf104333d8949950
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 28 11:27:52 2018 -0500
+
+    LP#1676608: activate more copy alert types by default
+    
+    Since users of 3.1 should be using the web staff client unless
+    they absolutely cannot switch from the XUL client yet, the copy
+    alert types for exceptional checkin and checkout statuses are now
+    active by default.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+20	20	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+17	0	Open-ILS/src/sql/Pg/upgrade/ZZZB.data.more-copy-alerts-active-by-default.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/ZZZB.data.more-copy-alerts-active-by-default.sql
+
+commit 16b661149701d8125fb626ff39a3292ba0cbe711
+Author: Remington Steed <rjs7 at calvin.edu>
+Date:   Tue Feb 27 16:10:15 2018 -0500
+
+    LP#1748986 Release notes
+    
+    Release notes for the new Billing Statement View.
+    
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+7	0	docs/RELEASE_NOTES_NEXT/Circulation/billing_statement_view.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/billing_statement_view.adoc
+
+commit a94a102b12cf27e2a827811ae6c20415cf6d5877
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Tue Feb 20 17:39:17 2018 -0500
+
+    LP#1748986 Broaden billing interface labels
+    
+    In a few places we use the word "Paid", but there are quite a few
+    things in that bucket (forgiveness, adjustments, etc.) which don't fit
+    well under the term "Paid".
+    
+    Though we have some deep structural causes for this, we can take a baby
+    step in the right direction by sprinkling the term "Credited" in a few
+    key places.
+    
+    Also, correct an mislabeled "Balance" field.
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+2	2	Open-ILS/src/templates/staff/circ/patron/t_bills.tt2
+2	2	Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2
+
+commit b649140060793a2bed8ff9dbedc7c25851c2fe06
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Mon Feb 12 14:47:21 2018 -0500
+
+    LP#1748986 Billing Statement View
+    
+    Over time, Evergreen has developed a rich set of features to support
+    various billing scenarios.  Unfortunately, our interface has not kept up
+    in some ways, and this leads to some confusion at times, particularly
+    for front line staff.
+    
+    One way to bring clarity is to apply better grouping, labeling, and
+    ordering of the various transactional events.  By doing so, we can
+    generate a billing "statement" with similarities to the statements we
+    regularly encounter when dealing with other financial institutions.
+    
+    This branch does so for the staff client view, but it also seems viable
+    to carry over the same idea to an eventual patron (or print) view as
+    well.
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+136	0	Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
+14	57	Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2
+59	0	Open-ILS/src/templates/staff/circ/patron/t_xact_details_details.tt2
+72	0	Open-ILS/src/templates/staff/circ/patron/t_xact_details_statement.tt2
+1	1	Open-ILS/web/js/ui/default/staff/circ/patron/app.js
+22	3	Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
+ create mode 100644 Open-ILS/src/templates/staff/circ/patron/t_xact_details_details.tt2
+ create mode 100644 Open-ILS/src/templates/staff/circ/patron/t_xact_details_statement.tt2
+
+commit f9159c9de6c2e90c8983d02854c0a3831daf9b1a
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Wed Feb 28 10:33:50 2018 -0500
+
+    Stamping upgrade scripts for new copy alerts
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+114	0	Open-ILS/src/sql/Pg/upgrade/1095.schema.copy_alerts.sql
+64	0	Open-ILS/src/sql/Pg/upgrade/1096.data.stock_copy_alert_types.sql
+35	0	Open-ILS/src/sql/Pg/upgrade/1097.data.yaous_for_open_circ_exists_fine_handling.sql
+23	0	Open-ILS/src/sql/Pg/upgrade/1098.data.move_legacy_copy_alerts.sql
+0	112	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql
+0	62	Open-ILS/src/sql/Pg/upgrade/YYYY.data.stock_copy_alert_types.sql
+0	23	Open-ILS/src/sql/Pg/upgrade/ZZZA.data.move_legacy_copy_alerts.sql
+0	35	Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.yaous_for_open_circ_exists_fine_handling.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1095.schema.copy_alerts.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1096.data.stock_copy_alert_types.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1097.data.yaous_for_open_circ_exists_fine_handling.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1098.data.move_legacy_copy_alerts.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/YYYY.data.stock_copy_alert_types.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/ZZZA.data.move_legacy_copy_alerts.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.yaous_for_open_circ_exists_fine_handling.sql
+
+commit 452448300f976b5230691e3eeac4127decf9f0e7
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Wed Feb 28 10:17:10 2018 -0500
+
+    LP#1676608: Stop hold capture when an alert-force copy status change is requested
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+1	0	Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+
+commit f736176ddae994baefa62c8427f3f441f585e39e
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Tue Feb 27 17:23:22 2018 -0500
+
+    LP#1676608: don't sound the klaxon for unusual copy statuses during checkin
+    
+    During a successful checkin, play the success sound if an
+    unexpected copy status is noted in the success message -- it
+    may have been set via a copy alert.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+2	2	Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+
+commit 8eea84211b439453b6423c0415a7ea099ddbcdce
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Fri Feb 23 16:54:51 2018 -0500
+
+    LP#1676608: inject copy alert dialog in two more places
+    
+    The copy alert dialog (if an item has relevant copy alerts)
+    is now injected into the dialog box series when handling
+    checkouts of items that are in transit or where the patron
+    record has overridable conditions that would block the checkout.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+27	2	Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+
+commit 290a336fde9810cfd1be0df364634d629c77dc67
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Thu Feb 22 17:02:11 2018 -0500
+
+    LP#1676608: provide DB update script to convert legacy copy alert messages
+    
+    Legacy copy alert messages are moved to new normal checkout and
+    normal checkin copy alerts. This patch also converts the foreign
+    key relationship from asset.copy_alert to asset.copy to a "fake"
+    one using a constraint trigger.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+1	1	Open-ILS/src/sql/Pg/040.schema.asset.sql
+16	0	Open-ILS/src/sql/Pg/800.fkeys.sql
+2	2	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+17	1	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql
+2	2	Open-ILS/src/sql/Pg/upgrade/YYYY.data.stock_copy_alert_types.sql
+23	0	Open-ILS/src/sql/Pg/upgrade/ZZZA.data.move_legacy_copy_alerts.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/ZZZA.data.move_legacy_copy_alerts.sql
+
+commit 3724a2cf6b8ba4e6191ed19b48102b22d2766c2a
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Thu Feb 22 16:34:15 2018 -0500
+
+    LP#1676608: tweak defaults for alerts in vol/copy editor
+    
+    Changed the defaults key for new-style copy alerts to be the same
+    as what was used for legacy copy alert messages; this means that
+    users who set editor defaults prior to upgrading are more likely
+    to have the Copy Alerts button be active out of the box.
+    
+    Also moved the location of Add/Edit Copy Alerts in the defaults
+    tab.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+1	1	Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2
+1	9	Open-ILS/src/templates/staff/cat/volcopy/t_defaults.tt2
+2	2	Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+
+commit a6185f08b2598080bbd164c3b2f0107ab622804a
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Thu Feb 22 16:17:43 2018 -0500
+
+    LP#1676608: remove legacy copy alerts field from vol/copy editor
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+6	28	Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2
+2	3	Open-ILS/src/templates/staff/cat/volcopy/t_defaults.tt2
+1	4	Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+
+commit c0dcdd11ce6402ac35d7b561164acd58b28beb83
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Thu Feb 22 16:07:44 2018 -0500
+
+    LP#1676608: tweak copy alert type manager
+    
+    The "Next Status" selector is now disabled unless the event type is
+    'Checkin'.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+2	1	Open-ILS/src/templates/staff/admin/local/autoGridEditor/ccat.tt2
+
+commit c9fb95e59db76815e05ad124a4290439df6f8819
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Thu Feb 22 15:44:52 2018 -0500
+
+    LP#1676608: allow focus-me to accept constant
+    
+    A handfull of cases have arisen, including but not limited to
+    the copy alerts feature, where focus-me is set to simply "true"
+    rather than being bound to to a scope variable. This patch formalizes
+    this and gets rid of the following console warning:
+    
+    angular.min.js:119 TypeError: model.assign is not a function
+        at ui.js:23
+        at angular.min.js:160
+        at f (angular.min.js:45)
+        at angular.min.js:48
+    (anonymous) @ angular.min.js:119
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+2	1	Open-ILS/web/js/ui/default/staff/services/ui.js
+
+commit 5b75e9b01c94c861a5ede9e76f34ac10ec3a4a8f
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Thu Feb 22 15:25:10 2018 -0500
+
+    LP#1676608: properly auto-override during missing checkout
+    
+    This patch ensures that suppressing the checkout of missing copy alert
+    does, in fact, suppress the alert.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+1	1	Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+
+commit 619e9059cd6980a7cac987cc33a8618540f7ea4c
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Thu Feb 22 14:25:19 2018 -0500
+
+    LP#1676608: update seed data for new installations
+    
+    Prior to this patch, only the DB update scripts new about the
+    stock copy alert types and new OU settings.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+93	0	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+
+commit 3784351aed2356b70dc82116d2c1dfff0c6894b7
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 7 16:52:20 2018 -0500
+
+    LP#1676608: tweak labeling at circ/at owning library fields
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+4	4	Open-ILS/src/templates/staff/admin/local/autoGridEditor/ccat.tt2
+
+commit 85b5d3af913839515a4f20bc732cbbb23ae2d963
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 7 16:41:55 2018 -0500
+
+    LP#1676608: add some sorting to copy alert dialogs
+    
+    Copy alert types in drop-downs are now sorted by name
+    and copy alerts themselves are now consistently sorted
+    by ID (which will have the affected of putting the most
+    recent alert at the bottom in the copy alert manager dialog).
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+1	1	Open-ILS/src/templates/staff/admin/local/autoGridEditor/acas.tt2
+3	3	Open-ILS/src/templates/staff/cat/volcopy/t_copy_alerts.tt2
+1	1	Open-ILS/src/templates/staff/share/t_add_copy_alert_dialog.tt2
+2	2	Open-ILS/src/templates/staff/share/t_copy_alert_editor_dialog.tt2
+
+commit 56679c9b7b96c818935b9004c41a76587e679db9
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 7 16:30:04 2018 -0500
+
+    LP#1676608: conditionally enable manage copy alerts button on item status details
+    
+    The 'Manage' button for copy alerts on the Item Status Detail view
+    is now enabled only if there is at least one active copy alert. This
+    patch also tweaks how the copy alert dialogs sequence record update
+    and modal-closing so that the caller can be sure that the transaction
+    has committed.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+1	1	Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
+14	2	Open-ILS/web/js/ui/default/staff/cat/item/app.js
+17	8	Open-ILS/web/js/ui/default/staff/services/ui.js
+
+commit 3e548a2893f8521278f6bdf331d35f14e1c17a75
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 7 12:20:47 2018 -0500
+
+    LP#1676608: fix glitch with egCore.pcrud.apply()
+    
+    pcrud.apply() is supposed to skip any entries in the list
+    of CUD actions that don't explicitly mark themselves as
+    being a creation, update, or deletion, but didn't manage
+    to fully skip them. As a consequence, the browser console
+    would note complaints that open-ils.pcrud.apply.$IDLCLASS
+    methods do not exist.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+1	0	Open-ILS/web/js/ui/default/staff/services/pcrud.js
+
+commit ae68e4ff7d79d78b45a4c164305b7994982758f5
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 7 11:59:43 2018 -0500
+
+    LP#1676608: fix positioning of copy alert buttons on Item Status Detail view
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+8	1	Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
+
+commit d29a5ffb17974e881db93caf1960c6fce37e1284
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Feb 7 11:48:29 2018 -0500
+
+    LP#1676608: add release notes
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+23	0	docs/RELEASE_NOTES_NEXT/Circulation/Copy_Alerts_And_Suppresion_Matrix.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/Copy_Alerts_And_Suppresion_Matrix.adoc
+
+commit 6f1f2a4faf180bd7861bfd0ac349c85d774d4562
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Tue Oct 20 10:10:28 2015 -0400
+
+    LP#1676608: copy alert and suppression matrix
+    
+    The Copy Alerts feature allows library staff to add customized alert
+    messages to copies. The copy alerts will appear when a specific event
+    takes place, such as when the copy is checked in, checked out, or
+    renewed. Alerts can be temporary or persistent: temporary alerts will be
+    disabled after the initial alert and acknowledgement from staff, while
+    persistent alerts will display each time the alert event takes place.
+    Copy Alerts can be configured to display at the circulating or owning
+    library only or, alternatively, when the library at which the alert
+    event takes place is not the circulating or owning library.  Copy Alerts
+    can also be configured to provide options for the next copy status that
+    should be applied to an item.  Library administrators will have the
+    ability to create and customize Copy Alert Types and to suppress copy
+    alerts at specific org units.
+    
+    Copy alerts can be added via the volume/creator and the check in,
+    check out, and renew pages.  Copy alerts can also be managed at the
+    item status page.
+    
+    Copy alert types can be managed via the Copy Alert Types page in
+    Local Administration, and suppression of them can be adminstered
+    via the Copy Alert Suppression page under Local Administration.
+    
+    Co-authored-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+105	0	Open-ILS/examples/fm_IDL.xml
+8	0	Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
+40	2	Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm
+287	11	Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+92	0	Open-ILS/src/sql/Pg/040.schema.asset.sql
+11	0	Open-ILS/src/sql/Pg/live_t/copy_state.pg
+96	0	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql
+62	0	Open-ILS/src/sql/Pg/upgrade/YYYY.data.stock_copy_alert_types.sql
+35	0	Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.yaous_for_open_circ_exists_fine_handling.sql
+30	0	Open-ILS/src/templates/staff/admin/local/autoGridEditor/acas.tt2
+92	0	Open-ILS/src/templates/staff/admin/local/autoGridEditor/ccat.tt2
+6	0	Open-ILS/src/templates/staff/admin/local/index.tt2
+12	0	Open-ILS/src/templates/staff/admin/local/t_grid_editor.tt2
+2	0	Open-ILS/src/templates/staff/admin/local/t_splash.tt2
+8	0	Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2
+9	2	Open-ILS/src/templates/staff/cat/item/t_list.tt2
+5	2	Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
+7	0	Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2
+94	0	Open-ILS/src/templates/staff/cat/volcopy/t_copy_alerts.tt2
+9	0	Open-ILS/src/templates/staff/cat/volcopy/t_defaults.tt2
+9	2	Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2
+14	2	Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
+9	3	Open-ILS/src/templates/staff/circ/renew/t_renew.tt2
+23	1	Open-ILS/src/templates/staff/circ/share/circ_strings.tt2
+4	0	Open-ILS/src/templates/staff/css/style.css.tt2
+40	0	Open-ILS/src/templates/staff/share/t_add_copy_alert_dialog.tt2
+6	2	Open-ILS/src/templates/staff/share/t_autogrid.tt2
+55	0	Open-ILS/src/templates/staff/share/t_copy_alert_editor_dialog.tt2
+49	0	Open-ILS/src/templates/staff/share/t_copy_alert_manager_dialog.tt2
+159	1	Open-ILS/web/js/ui/default/staff/admin/local/app.js
+18	0	Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
+40	2	Open-ILS/web/js/ui/default/staff/cat/item/app.js
+6	1	Open-ILS/web/js/ui/default/staff/cat/services/holdings.js
+287	4	Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+21	0	Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
+38	0	Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
+20	0	Open-ILS/web/js/ui/default/staff/circ/renew/app.js
+65	20	Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+5	1	Open-ILS/web/js/ui/default/staff/circ/services/item.js
+34	1	Open-ILS/web/js/ui/default/staff/services/grid.js
+253	3	Open-ILS/web/js/ui/default/staff/services/ui.js
+ create mode 100644 Open-ILS/src/sql/Pg/live_t/copy_state.pg
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/YYYY.data.stock_copy_alert_types.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.yaous_for_open_circ_exists_fine_handling.sql
+ create mode 100644 Open-ILS/src/templates/staff/admin/local/autoGridEditor/acas.tt2
+ create mode 100644 Open-ILS/src/templates/staff/admin/local/autoGridEditor/ccat.tt2
+ create mode 100644 Open-ILS/src/templates/staff/admin/local/t_grid_editor.tt2
+ create mode 100644 Open-ILS/src/templates/staff/cat/volcopy/t_copy_alerts.tt2
+ create mode 100644 Open-ILS/src/templates/staff/share/t_add_copy_alert_dialog.tt2
+ create mode 100644 Open-ILS/src/templates/staff/share/t_copy_alert_editor_dialog.tt2
+ create mode 100644 Open-ILS/src/templates/staff/share/t_copy_alert_manager_dialog.tt2
+
+commit 87846cfc29f7aa3de474ee31db41eafd7918fad0
+Author: Kathy Lussier <klussier at masslnc.org>
+Date:   Tue Feb 27 16:29:51 2018 -0500
+
+    LP#1733695: Stamping upgrade scripts for multilingual search
+    
+    Also, fixed a small typo in the 1094 upgrade script.
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+242	0	Open-ILS/src/sql/Pg/upgrade/1092.schema.ingest_multiple_sources.sql
+8	0	Open-ILS/src/sql/Pg/upgrade/1093.data.multiple_language_search
+13	0	Open-ILS/src/sql/Pg/upgrade/1094.reingest.multiple_language_search.sql
+0	242	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.ingest_multiple_sources.sql
+0	8	Open-ILS/src/sql/Pg/upgrade/YYYY.data.multiple_language_search.sql
+0	13	Open-ILS/src/sql/Pg/upgrade/ZZZZ.reingest.multiple_language_search.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1092.schema.ingest_multiple_sources.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1093.data.multiple_language_search
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1094.reingest.multiple_language_search.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.ingest_multiple_sources.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/YYYY.data.multiple_language_search.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/ZZZZ.reingest.multiple_language_search.sql
+
+commit a820163ae3a3cd55a4e79f1260ddf28b4358cfe2
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Tue Feb 27 15:48:01 2018 -0500
+
+    Add release note for multilingual search
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+17	0	docs/RELEASE_NOTES_NEXT/OPAC/multilingual_search.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/OPAC/multilingual_search.adoc
+
+commit a8759bad5eb58a226a9b6957d9acb1cd4630f10c
+Author: Mike Rylander <mrylander at gmail.com>
+Date:   Wed Nov 8 16:26:10 2017 -0500
+
+    LP#1733695: Pull record attribute values from multiple sources
+    
+    Previously, a multi-valued record attribute could only be extracted using
+    one strategy (XPath, tag+subfield, fixed field, etc).  For multi-valued
+    attributes, though, there's no reason to restrict this as long as the values
+    from various sources would, after normalization, have the same shape.  So
+    now we allow that, and we update the item_lang definition in order to allow
+    searching for records with multiple languages in various boolean ways.
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+21	9	Open-ILS/src/sql/Pg/030.schema.metabib.sql
+1	1	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+242	0	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.ingest_multiple_sources.sql
+8	0	Open-ILS/src/sql/Pg/upgrade/YYYY.data.multiple_language_search.sql
+13	0	Open-ILS/src/sql/Pg/upgrade/ZZZZ.reingest.multiple_language_search.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.ingest_multiple_sources.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/YYYY.data.multiple_language_search.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/ZZZZ.reingest.multiple_language_search.sql
+
+commit 3c1b6d0a129a45e6073e78cdeaaf2c59515b83cd
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Tue Feb 27 16:08:46 2018 -0500
+
+    LP#1737016 Stamping upgrade script for easing constraints on afs.code
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+9	0	Open-ILS/src/sql/Pg/upgrade/1091.schema.lp1737016_afs_code.sql
+0	9	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lp1737016_afs_code.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1091.schema.lp1737016_afs_code.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lp1737016_afs_code.sql
+
+commit 5d80c0b64e4a6db818a321c0509f0149a696c4d2
+Author: Jason Boyer <JBoyer at library.in.gov>
+Date:   Thu Dec 7 14:45:21 2017 -0500
+
+    LP1737016: Ease Constraints on afs.code
+    
+    acq.funding_source.code currently has a UNIQUE
+    constraint applied, which can be confusing to
+    users. This branch only requires that a code be
+    unique to the funding source's owner, simplifying
+    the management of funding sources.
+    
+    Signed-off-by: Jason Boyer <JBoyer at library.in.gov>
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+2	1	Open-ILS/src/sql/Pg/200.schema.acq.sql
+9	0	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lp1737016_afs_code.sql
+9	0	docs/RELEASE_NOTES_NEXT/Acquisitions/RELEASE_NOTE_TEMPLATE.adoc
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lp1737016_afs_code.sql
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Acquisitions/RELEASE_NOTE_TEMPLATE.adoc
+
+commit 6aaa85c4d7ed649c1b8a64f81ac45bb3a2889820
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Tue Feb 27 13:27:16 2018 -0500
+
+    Forward-port 2.12.10 upgrade script
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+5	0	Open-ILS/src/sql/Pg/version-upgrade/2.12.9-2.12.10-upgrade-db.sql
+ create mode 100644 Open-ILS/src/sql/Pg/version-upgrade/2.12.9-2.12.10-upgrade-db.sql
+
+commit 77d0110b32f1a77bfc3affad158209e0162a88ce
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Tue Feb 27 12:58:39 2018 -0500
+
+    LP#1744996 Stamping upgrade script for record merge tracking
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+277	0	Open-ILS/src/sql/Pg/upgrade/1090.schema.record-merge-tracking.sql
+0	277	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.record-merge-tracking.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1090.schema.record-merge-tracking.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.record-merge-tracking.sql
+
+commit 22489de26ef87f724e4151931c53976d994877d1
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Thu Jan 25 11:28:47 2018 -0500
+
+    LP#1744996 Record merge tracking release notes
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+14	0	docs/RELEASE_NOTES_NEXT/Cataloging/record-merge-tracking.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Cataloging/record-merge-tracking.adoc
+
+commit cee1775def1e4e347671a18d7c81614d860e0528
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Thu Jan 25 11:10:45 2018 -0500
+
+    LP#1744996 Webstaff bib rec merged to link
+    
+    Display a message in the web staff bib record display indicating when a
+    bib record has been merged to another record.  The message includes the
+    merge date and target record and is rendered as a link to the target
+    record.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+8	1	Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2
+
+commit 4eb351f85e897dc45c69a0d57c300d6ea95af933
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Thu Jan 25 11:05:23 2018 -0500
+
+    LP#1744996 Track bib record merges
+    
+    Adds "merge_date" and "merged_to" fields for bib records.  Merge date
+    is applied to all records involved in a record merge at merge time.
+    merged_to is applied to all subordinate (merged) records and points to
+    the target record.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+3	0	Open-ILS/examples/fm_IDL.xml
+3	1	Open-ILS/src/sql/Pg/010.schema.biblio.sql
+8	0	Open-ILS/src/sql/Pg/999.functions.global.sql
+277	0	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.record-merge-tracking.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.record-merge-tracking.sql
+
+commit 986a2d011726f254e6a73f06382a76d91ce88018
+Author: Kathy Lussier <klussier at masslnc.org>
+Date:   Wed Feb 21 21:01:22 2018 -0500
+
+    LP#1694058: Stamping upgrade script for duplicate holds coust
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+20	0	Open-ILS/src/sql/Pg/upgrade/1089.data.max_duplicate_holds_coust.sql
+0	20	Open-ILS/src/sql/Pg/upgrade/XXXX.data.max_duplicate_holds_coust.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/1089.data.max_duplicate_holds_coust.sql
+ delete mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.max_duplicate_holds_coust.sql
+
+commit 6dbb6c76aa5277c7acc397ca7d02451465e86996
+Author: Kathy Lussier <klussier at masslnc.org>
+Date:   Wed Feb 21 20:55:31 2018 -0500
+
+    LP# 1694058: Release notes entry for placing multiple holds
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+20	0	docs/RELEASE_NOTES_NEXT/Circulation/multiple_hold_placement.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/multiple_hold_placement.adoc
+
+commit 04bf77f7feace19817dc7c1e0efa75c6112558a8
+Author: Jason Stephenson <jason at sigio.com>
+Date:   Sun Oct 29 15:14:41 2017 -0400
+
+    Lp 1694058: Fix Issue With Place Holds Reported in Testing
+    
+    When staff did have to override in order to place the hold, and the
+    "Place another hold for this title" link was subsequnetly used, the
+    inputs for the patron barcodes and some other fields on the place
+    holds page were duplicated.  To avoid this, we now use uniq from the
+    List::MoreUtils library when retrieving the hold targets list from the
+    CGI parameters.
+    
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+2	1	Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+
+commit 7e76706a0b34f87797f09b9b3218bce476c067dc
+Author: Jason Stephenson <jason at sigio.com>
+Date:   Sun Oct 1 12:03:26 2017 -0400
+
+    LP 1694058: Final OPAC Changes for Multiple Hold Placement
+    
+    Add JavaScript code to disable the number of copies selection when a
+    part is chosen for a record that has both parts and non parts holds
+    available.  If a part is chosen, the number of copies select should be
+    disabled and reset to 1.  It should be enabled again if the All Parts
+    option is chosen.  It does not appear if the hold requires a part.
+    
+    Test Plan for the OPAC changes:
+    
+    1. Set circ.holds.max_duplicate_holds to 5 for BR1.
+    
+    2. Login to the OPAC as any patron from BR1.
+    
+    3. Perform any search.
+    
+    4. Select a title and click Place Hold.
+    
+    5. See that the selection box for placing multiple holds does not appear on the place holds screen.
+    
+    6. Place the hold to see that hold placement still works as expected.
+    
+    8. Go to the patron’s list of holds in My Opac to see that the hold appears.
+    
+    9. Cancel the hold so it doesn’t interfere with later testing.
+    
+    10. Logout.
+    
+    11. Login to the OPAC as any patron from BR2 or any branch other than BR1.
+    
+    12. Perform any search.
+    
+    13. Select a title and click Place Hold.
+    
+    14. See that the selection box for placing multiple holds does not appear on the place holds screen.
+    
+    15. Place the hold to see that hold placement still works as expected.
+    
+    16. Go to the patron’s list of holds in My Opac to see that the hold appears.
+    
+    17. Cancel the hold so it doesn’t interfere with later testing.
+    
+    18. Logout.
+    
+    19. Login to the web staff client as a circulator for BR1 at BR1.
+    
+    20. Select a patron barcode for any BR1 patron.
+    
+    21. Perform any search.
+    
+    22. Choose a title without parts and click place holds.
+    
+    23. See that the selection box for placing multiple holds appears with 1 as the default.
+    
+    24. Click the selection box to see that the values go from 1 to 5.
+    
+    25. Place any number of holds for the patron whose barcode was chosen in step 15.
+    
+    26. Open the patron in the staff client and check the patron’s holds list to see that they have the correct number of holds for this title listed.
+    
+    27. Repeat steps 21 – 26 with metarecord holds on one of the metarecord titles.
+    
+    28. Perform a search and select a title.
+    
+    29. Choose an item to place a copy hold for the same patron.
+    
+    30. Notice that the multiple hold number selection box does not appear.
+    
+    31. Place the hold as normal (if you like) to test that copy hold placement still works.
+    
+    32. Search for a title with parts.
+    
+    33. Select a part in the parts drop down or radio button.
+    
+    34. Notice that the number of copies select box is reset to 1 and disabled when a part is selected.
+    
+    35. Repeat the above steps for a BR2 circulation account logged in at BR2 (or any other branch staff).
+    
+    36. Notice that the selection box never appears when placing holds where the org. unit setting does not apply.
+    
+    37. Clear the org. unit setting for BR1 and repeat the above steps, if desired.
+    
+    The web staff client tests should work in the XUL staff client as well.
+    
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+25	3	Open-ILS/src/templates/opac/parts/place_hold.tt2
+
+commit cac2694533baae42cf5bad1434287ca69c72116b
+Author: Jason Stephenson <jason at sigio.com>
+Date:   Sat Sep 30 15:30:22 2017 -0400
+
+    LP 1694058: Add confirmation dialog for multiple title holds.
+    
+    Add a dialog to confirm that the user really wants to place the
+    requested number of title or metarecord holds to the
+    validateHoldForm() function.
+    
+    Along the way, we add a format() function to the JS String prototype
+    in the i18n_strings.tt2 so that we can have translated strings with
+    placeholders in JavaScript.
+    
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+14	0	Open-ILS/src/templates/opac/i18n_strings.tt2
+14	3	Open-ILS/web/js/ui/default/opac/holds-validation.js
+
+commit 89eb96b8eaae3f0074c1bf69c1408a2dc9fa9073
+Author: Jason Stephenson <jason at sigio.com>
+Date:   Sat Sep 23 14:45:41 2017 -0400
+
+    LP 1694058: OPAC changes for multiple title and metarecord holds.
+    
+    We add the num_copies select box to the place_holds.tt2 whe appropriate.
+    
+    The new select list generator has its own tt2 file:
+    Open-ILS/src/templates/opac/parts/multi_hold_select.tt2
+    
+    Modify WWW/EGCatLoader/Account.pm to properly process multiple hold
+    requests for the same title or metarecord.
+    
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+35	9	Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+15	0	Open-ILS/src/templates/opac/parts/multi_hold_select.tt2
+1	0	Open-ILS/src/templates/opac/parts/place_hold.tt2
+ create mode 100644 Open-ILS/src/templates/opac/parts/multi_hold_select.tt2
+
+commit a61f5bb7dc7606c758cc2a91cb46db7fd654a720
+Author: Jason Stephenson <jason at sigio.com>
+Date:   Sun Aug 13 09:42:34 2017 -0400
+
+    LP 1694058: Perl tests for backend multiple hold placement changes.
+    
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+545	0	Open-ILS/src/perlmods/live_t/25-lp1694058-multiple-hold-placement.t
+ create mode 100644 Open-ILS/src/perlmods/live_t/25-lp1694058-multiple-hold-placement.t
+
+commit 1438791250621e5f089b2b1ed9292862d6c4fbcd
+Author: Jason Stephenson <jason at sigio.com>
+Date:   Tue Aug 8 21:23:44 2017 -0400
+
+    LP 1694058: Add backend code to allow multiple hold placement.
+    
+    We add a constant for the circ.holds.max_duplicate_holds setting.
+    
+    We modify Holds.pm to check if we're placing a title or metarecord
+    hold, that we have the CREATE_DUPLICATE_HOLDS permission, and that we
+    haven't placed more than the maximum allowed number of duplicate holds
+    before returning the HOLD_EXISTS event.
+    
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+9	1	Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
+1	0	Open-ILS/src/perlmods/lib/OpenILS/Const.pm
+
+commit e70d5917f50e195b2f3b456c9d420a8c06e94823
+Author: Jason Stephenson <jason at sigio.com>
+Date:   Sun Jul 30 15:52:25 2017 -0400
+
+    LP 1694058: Add org. unit setting for multiple hold placement.
+    
+    Add config.org_unit_setting_type circ.hold.max_duplicate_holds to set
+    the maximum duplicate title or metarecord holds allowed per patron.
+    
+    Add pgtap test to make sure the new setting exists.
+    
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+10	0	Open-ILS/src/sql/Pg/950.data.seed-values.sql
+13	0	Open-ILS/src/sql/Pg/t/lp1694058_multiple_hold_placement.pg
+20	0	Open-ILS/src/sql/Pg/upgrade/XXXX.data.max_duplicate_holds_coust.sql
+ create mode 100644 Open-ILS/src/sql/Pg/t/lp1694058_multiple_hold_placement.pg
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.max_duplicate_holds_coust.sql
+
+commit 0a81e0d2bf2b107a46307e7ab9164f54355bff66
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Tue Feb 20 16:55:28 2018 -0500
+
+    LP#1739803: add angular tablesport to vendor bundle
+    
+    Otherwise, offline breaks.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+2	1	Open-ILS/web/js/ui/default/staff/webpack.config.js
+
+commit cb2486340409b05357b0b3a03479998ffd645243
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Wed Feb 14 13:25:54 2018 -0500
+
+    LP#1739803 Add newly required dependency for jasmine-core
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+1	0	Open-ILS/web/js/ui/default/staff/package.json
+
+commit 5c6e280e147b127dd196e4f1a3c49237afa95865
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Wed Dec 20 11:13:10 2017 -0500
+
+    LP#1739803 Webstaff: Replace Grunt with Webpack
+    
+    * Remove grunt devDependencies
+    * Add Webpack devDepenencies
+    * Copy and minify operations are now handled by Webpack via 'npm run
+      build' for dev builds and 'npm run build-prod' for
+      production/minified builds.
+    * Running 'npm run build-watch' executes webpack in --watch mode to
+      watch for affected file changes and automatically rebuild.  Useful for
+      development.
+    * Karma unit tests are now invoked directly from node via 'npm run
+      test'.
+    * Docs and release installer updated to match.
+    * Removed long-outdated inline installer readme.
+    
+    Webpack is configured to create bundles from sets of JS files.  As it
+    stands, there are 2 sets: core.bundle.js and vendor.bundle.js.  Core has
+    all of the EG core services that are loaded on every page.  Vendor
+    contains all of the 3rd-party dependencies (angular, etc.).  These 2
+    bundles are loaded on every web staff page (via base_js.tt2).
+    
+    All other <script/> tags remain as they were.
+    
+    When building in dev mode ('npm run build'), core service JS files are
+    bunded un-minified with an inline source map for debugging.  Vendor
+    files (angularjs, etc.) are always minified because they are quite
+    large.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+13	84	Open-ILS/src/templates/staff/base_js.tt2
+0	1	Open-ILS/src/templates/staff/index.tt2
+0	250	Open-ILS/web/js/ui/default/staff/Gruntfile.js
+0	113	Open-ILS/web/js/ui/default/staff/README.install
+11	11	Open-ILS/web/js/ui/default/staff/package.json
+3	27	Open-ILS/web/js/ui/default/staff/test/karma.conf.js
+158	0	Open-ILS/web/js/ui/default/staff/webpack.config.js
+2	2	build/tools/make_release
+2	9	docs/installation/server_installation.adoc
+ delete mode 100644 Open-ILS/web/js/ui/default/staff/Gruntfile.js
+ delete mode 100644 Open-ILS/web/js/ui/default/staff/README.install
+ create mode 100644 Open-ILS/web/js/ui/default/staff/webpack.config.js
+
+commit 76f56e0f027f79ad6b387047bcfdc2a400d6d253
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Fri Dec 22 12:19:43 2017 -0500
+
+    LP#1739803 Quiet some repetitive console messages for unit tests
+    
+    These console logs repeat during unit test runs and add clutter (ditto
+    the browser console log).  I commented them out instead of removing them
+    since they may still be useful for debugging in the future.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+1	1	Open-ILS/web/js/ui/default/staff/services/env.js
+1	1	Open-ILS/web/js/ui/default/staff/services/grid.js
+1	1	Open-ILS/web/js/ui/default/staff/services/hatch.js
+1	1	Open-ILS/web/js/ui/default/staff/services/lovefield.js
+
+commit 5eadd3febbe007d44833b6a209728e5a700452c0
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Thu Dec 21 14:14:18 2017 -0500
+
+    LP#1739803 Remove superseded 'extern' directory
+    
+    angular-location-update.js is now managed via npm.  No need to retain a
+    copy in the repo.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+0	31	Open-ILS/web/js/ui/default/staff/extern/angular-location-update/.bower.json
+0	22	Open-ILS/web/js/ui/default/staff/extern/angular-location-update/LICENSE
+0	52	Open-ILS/web/js/ui/default/staff/extern/angular-location-update/README.md
+0	22	Open-ILS/web/js/ui/default/staff/extern/angular-location-update/angular-location-update.js
+0	1	Open-ILS/web/js/ui/default/staff/extern/angular-location-update/angular-location-update.min.js
+0	22	Open-ILS/web/js/ui/default/staff/extern/angular-location-update/bower.json
+0	25	Open-ILS/web/js/ui/default/staff/extern/angular-location-update/package.json
+ delete mode 100644 Open-ILS/web/js/ui/default/staff/extern/angular-location-update/.bower.json
+ delete mode 100644 Open-ILS/web/js/ui/default/staff/extern/angular-location-update/LICENSE
+ delete mode 100644 Open-ILS/web/js/ui/default/staff/extern/angular-location-update/README.md
+ delete mode 100644 Open-ILS/web/js/ui/default/staff/extern/angular-location-update/angular-location-update.js
+ delete mode 100644 Open-ILS/web/js/ui/default/staff/extern/angular-location-update/angular-location-update.min.js
+ delete mode 100644 Open-ILS/web/js/ui/default/staff/extern/angular-location-update/bower.json
+ delete mode 100644 Open-ILS/web/js/ui/default/staff/extern/angular-location-update/package.json
+
+commit a63bae0c57e81831e2eec08640004a7b49369311
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Fri Jun 2 17:01:32 2017 -0400
+
+    LP#1739803 Angular 1.6 + dependency updates
+    
+    Rebuild package.json starting with Angular 1.6.  This resulted in a
+    number of dependency updates and small changes required to keep the
+    dependencies happy.
+    
+    * Teach print.js to use promise-style $http responses, instead of
+      .success() and .error()
+    * Remove unused '$http' dependency in hatch.js
+    * Fix egDate custom test matcher to work with newer version of
+      karma-jasmine.
+    * Build IDL for test scripts using Grunt/exec "cwd" since Grunt fails to
+      understand "&&" commands, like 'cd foo && bar'.
+    * For correctness, move dev-only depenencies into the package.json
+      devDependencies section.
+    
+    See also
+    https://docs.angularjs.org/guide/migration#migrating-from-1-5-to-1-6
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+2	1	Open-ILS/web/js/ui/default/staff/Gruntfile.js
+38	36	Open-ILS/web/js/ui/default/staff/package.json
+2	2	Open-ILS/web/js/ui/default/staff/services/hatch.js
+7	6	Open-ILS/web/js/ui/default/staff/services/print.js
+19	15	Open-ILS/web/js/ui/default/staff/test/unit/egDate.js
+
+commit 044c42dd1deefe387181ea4810d3d6b597ff24ad
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Fri Jan 26 16:42:08 2018 -0500
+
+    LP#1745499 De-Parallelify Item Status file upload
+    
+    Fetch copies in a series instead of in parallel when loading copy
+    barcodes from a file in the Item Status interface.  This helps avoid
+    excessive pcrud process count.
+    
+    Since this causes the action to take a little longer, the commit also
+    includes a progress dialog indicating copy retrieve progress.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+
+24	13	Open-ILS/web/js/ui/default/staff/cat/item/app.js
+
+commit 1f630f2189842cec8949596edd3c2fada4a9c8fc
+Author: Remington Steed <rjs7 at calvin.edu>
+Date:   Thu Feb 8 08:28:53 2018 -0500
+
+    LP#1730752 Fix minor bug with move-to-last
+    
+    If you click "Make last visible" on the column that is already the last
+    visible, it bumps it down one position when it should not move. This
+    commit adjusts the logic so that columns that are before or already in
+    the last-visible slot (thus, '<' or '=') will end up in the last-visible
+    slot, and columns only go after the last-visible slot if they are
+    already after it.
+    
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+
+1	1	Open-ILS/web/js/ui/default/staff/services/grid.js
+
+commit b2262e225f8ffe21f607b39869e46e37c10af268
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Tue Feb 6 14:35:30 2018 -0500
+
+    LP#1730752 Grid column move-to-last fix
+    
+    Grid column manager "move to last visible" now moves the column
+    correctly to the last visible slot instead of one slot after the last
+    visible slot.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
+
+8	1	Open-ILS/web/js/ui/default/staff/services/grid.js
+
+commit 1be3d75f9fd8429b84f0b14df8ed08aa473addc7
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Thu Nov 9 11:21:40 2017 -0500
+
+    LP#1730752 Grid colum 'sort visible to top' option
+    
+    Adds a new button to the grid configuration dialog to sort visible
+    columns to the top of the dialog (i.e. the left of the grid).
+    
+    Fix issue where last modified column remained styled after the dialog
+    closes.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+5	0	Open-ILS/src/templates/staff/share/t_grid_columns.tt2
+19	0	Open-ILS/web/js/ui/default/staff/services/grid.js
+
+commit eb7cd332c344b2ed6ef7679d86c9e2f1fd1e427a
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Tue Nov 7 15:32:33 2017 -0500
+
+    LP#1730752 Webstaff grid column batch config dialog
+    
+    Adds a new "Manage Columns" grid action which opens a batch grid column
+    configuration dialog.  In the dialog, users can show/hide multiple
+    columns at once.  The column position actions
+    (left/right/far-left/far-right) and sort priority settings have also
+    been moved to this new UI.
+    
+    The existing 'Configure Columns' action has been renamed to 'Managed
+    Column Widths' and now only supports making columns wider and narrower.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+17	0	Open-ILS/src/templates/staff/css/style.css.tt2
+8	37	Open-ILS/src/templates/staff/share/t_autogrid.tt2
+64	0	Open-ILS/src/templates/staff/share/t_grid_columns.tt2
+23	2	Open-ILS/web/js/ui/default/staff/services/grid.js
+ create mode 100644 Open-ILS/src/templates/staff/share/t_grid_columns.tt2
+
+commit bd3a71ec20d9e775ff9ee2b11c2484e38047241b
+Author: Jane Sandberg <sandbej at linnbenton.edu>
+Date:   Thu Jan 11 18:08:17 2018 -0800
+
+    LP1735572: replacing placeholder title attribute with something more meaningful
+    
+    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+1	1	Open-ILS/src/templates/acq/common/li_table.tt2
+
+commit d9a71de9fa7f139f219303667adec4c8fc9bc77a
+Author: Jason Etheridge <jason at EquinoxInitiative.org>
+Date:   Tue Jan 23 11:52:59 2018 -0500
+
+    adjust 20-hold-targeter.t to the "new normal"
+    
+    First failure happened here:
+    http://testing.evergreen-ils.org/~live/archive/2018-01/2018-01-11_04:00:02/
+    
+    Long term we need a better way to distribute concerto test assets
+    
+    Signed-off-by: Jason Etheridge <jason at EquinoxInitiative.org>
+
+1	1	Open-ILS/src/perlmods/live_t/20-hold-targeter.t
+
+commit 4808f1ad1a40f90139676963044c6f8c25b8aa75
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Wed Jan 17 18:02:00 2018 -0500
+
+    Forward port 2.12.9 upgrade script
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+5	0	Open-ILS/src/sql/Pg/version-upgrade/2.12.8-2.12.9-upgrade-db.sql
+ create mode 100644 Open-ILS/src/sql/Pg/version-upgrade/2.12.8-2.12.9-upgrade-db.sql
+
+commit bfd5b2f43a0d603972440d727310c7f03a5583e1
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Thu Nov 30 15:36:35 2017 -0500
+
+    LP#1710405 - remove Modify + Use Edits buttons in z3950 overlay
+    
+    The workflow for using a z3950 record to overlay a marked bib
+    was confusing since it requires first saving the z3950 marc edits
+    via the Modify button at the top, and only then hitting Use Edits,
+    at the bottom of the modals. User often miss the click Modify part,
+     thus this simplifies that, having just a "Save" button and a Cancel.
+    
+    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    
+    Signed-off-by: Jason Etheridge <jason at EquinoxInitiative.org>
+
+1	3	Open-ILS/src/templates/staff/cat/z3950/t_edit_overlay_record.tt2
+3	2	Open-ILS/web/js/ui/default/staff/cat/z3950/app.js
+
+commit fe30a5ea50a78b17e46bbab632e4fd11ca9abf85
+Author: Bill Erickson <berickxx at gmail.com>
+Date:   Fri Dec 1 14:20:57 2017 -0500
+
+    LP#1735807 Webstaff holdings owning lib shortname
+    
+    Display org unit shortnames in the web staff bib record Holdings View
+    -> Owning Library column, since displaying the full names requires
+    significant horizontal space.
+    
+    Signed-off-by: Bill Erickson <berickxx at gmail.com>
+    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
+    Signed-off-by: Jason Etheridge <jason at EquinoxInitiative.org>
+
+1	1	Open-ILS/web/js/ui/default/staff/cat/services/holdings.js
+
+commit d6e6519437daaa95de8a15a5b3d7e0dee2412126
+Author: blake <blake at mobiusconsortium.org>
+Date:   Thu Nov 9 15:35:07 2017 +0000
+
+    lp#1724321 Web Client -- existence of record with duplicate TCN does not prevent import
+    
+    This routes the MARC import execution back to the z39.50 code instead of using the generic
+    MARC editor. This will make use of open-ils.cat.biblio.record.xml.import instead of pcrud.
+    
+    Test
+    1. Edit global flag variable "Cat: Use Internal ID for TCN Value" = false
+    2. Perform a z39.50 search, click a result and click "import"
+    3. Step two should be successful, now import it again and you should get an error
+    4. Click the same result but use "Edit then import"
+    5. From the MARC editor, make no changes and click "Import"
+    6. It won't complain about duplicate TCNs
+    7. Apply the patch
+    8. Perform steps 4 and 5
+    9. Notice that the editor does not allow you to import the record
+    
+    Signed-off-by: blake <blake at mobiusconsortium.org>
+    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
+    Signed-off-by: Jason Etheridge <jason at EquinoxInitiative.org>
+
+1	1	Open-ILS/src/templates/staff/cat/z3950/t_marc_edit.tt2
+8	1	Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
+26	6	Open-ILS/web/js/ui/default/staff/cat/z3950/app.js
+
+commit 1e111dede283983bed2f031cb9ed86db0d2e100e
+Author: Cesar Velez <Cesar.Velez at equinoxinitiative.org>
+Date:   Thu Sep 21 15:45:23 2017 +0100
+
+    LP#1378383-WebStaff Fix Item circ history to obey max setting
+    
+    The circ.item_checkout_history.max lib setting should be respected
+    in both Circ History tabs, and also check for the permission to
+    VIEW_COPY_CHECKOUT_HISTORY for the current user.
+    
+    Also, There was ambiguity for the user to tell the difference
+    (from the displayed message) if an item truly has no circulations,
+    or if they see no circs due to the relevant permission setting
+    being set to 0 (Maximum previous checkouts.) This changes the templates
+    a bit to make that clearer.
+    
+    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    
+    Signed-off-by: Jason Etheridge <jason at EquinoxInitiative.org>
+
+8	3	Open-ILS/src/templates/staff/cat/item/t_circ_list_pane.tt2
+7	2	Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2
+80	52	Open-ILS/web/js/ui/default/staff/cat/item/app.js
+
+commit f17a075efcd721a7a76568b9caf5b1f875e0b26b
+Author: Dan Wells <dbw2 at calvin.edu>
+Date:   Fri Dec 1 16:05:02 2017 -0500
+
+    Forward-port 2.12.8 upgrade script
+    
+    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
+
+295	0	Open-ILS/src/sql/Pg/version-upgrade/2.12.7-2.12.8-upgrade-db.sql
+ create mode 100644 Open-ILS/src/sql/Pg/version-upgrade/2.12.7-2.12.8-upgrade-db.sql
+
+commit 50ac305c9824119483236f551b074ed50a1aa52c
+Author: Jeff Godin <jgodin at tadl.org>
+Date:   Fri Nov 17 12:07:42 2017 -0500
+
+    Docs: fix broken image reference
+    
+    Fix broken image reference in copy tags documentation: file on disk
+    has lowercase png extension, reference in document was uppercase PNG
+    extension.
+    
+    Signed-off-by: Jeff Godin <jgodin at tadl.org>
+
+1	1	docs/cataloging/copy_tags_cataloging.adoc
+
+commit 98deff54108cd1b07b66679d2e0872c88969e26c
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Thu Nov 9 09:46:35 2017 -0500
+
+    LP#1728677: add release notes entry
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+4	0	docs/RELEASE_NOTES_NEXT/Architecture/Sample_Data_Includes_Surveys.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Architecture/Sample_Data_Includes_Surveys.adoc
+
+commit 3937b2389ee75a365f2167699a9650a951add829
+Author: Chris Sharp <csharp at georgialibraries.org>
+Date:   Mon Oct 30 12:29:20 2017 -0400
+
+    LP#1728677 - Add survey data to concerto test dataset.
+    
+    To more closely approximate a realistic test environment,
+    this branch adds data to the concerto test dataset.  Most users
+    are given a randomized response to a simple 3-question survey.
+    
+    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+3	0	Open-ILS/tests/datasets/sql/load_all.sql
+52	0	Open-ILS/tests/datasets/sql/surveys.sql
+ create mode 100644 Open-ILS/tests/datasets/sql/surveys.sql
+
+commit dd825128fadea4be0f59ee3ffba22aafbf6804b8
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Nov 8 17:21:08 2017 -0500
+
+    LP#1717351: tweak release notes
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+5	0	docs/RELEASE_NOTES_NEXT/Circulation/Patron_Email_Addresses_Now_Clickable.adoc
+0	1	docs/RELEASE_NOTES_NEXT/Circulation/release_notes.txt
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/Patron_Email_Addresses_Now_Clickable.adoc
+ delete mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/release_notes.txt
+
+commit 7e1439509669337e7f52f3980ea38ee9bbaf1a7d
+Author: Sam Link <slink at LIBPC002>
+Date:   Tue Nov 7 08:27:18 2017 -0500
+
+    Added Release Notes
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+1	0	docs/RELEASE_NOTES_NEXT/Circulation/release_notes.txt
+ create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/release_notes.txt
+
+commit c9453e5aa263f3ccb349e563835ceb69af28dccf
+Author: Sam Link <slink at columbiacountyga.gov>
+Date:   Fri Oct 6 11:40:47 2017 -0400
+
+    Web Client: Make Patron Email Clickable
+    
+    The patch is twofold. First, "mailto" has been added to
+    $compileProvider.aHrefSanitizationWhitelist() throughout the project.
+    Second, the patron email in the patron summary has been wrapped in an
+    anchor with ng-href="mailto:{{patron().emaio()}}" to enable the desired
+    functionality.
+    
+    Signed-off-by: Sam Link <slink at columbiacountyga.gov>
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+2	1	Open-ILS/src/templates/staff/circ/patron/t_summary.tt2
+1	1	Open-ILS/web/js/ui/default/staff/acq/app.js
+1	1	Open-ILS/web/js/ui/default/staff/admin/acq/app.js
+1	1	Open-ILS/web/js/ui/default/staff/admin/actor/app.js
+2	2	Open-ILS/web/js/ui/default/staff/admin/actor/org_unit/app.js
+2	1	Open-ILS/web/js/ui/default/staff/admin/local/app.js
+1	1	Open-ILS/web/js/ui/default/staff/admin/serials/app.js
+1	1	Open-ILS/web/js/ui/default/staff/admin/server/app.js
+1	1	Open-ILS/web/js/ui/default/staff/admin/user_perms.js
+1	1	Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
+2	2	Open-ILS/web/js/ui/default/staff/admin/workstation/log.js
+2	2	Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js
+2	2	Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js
+2	2	Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
+2	2	Open-ILS/web/js/ui/default/staff/cat/item/app.js
+2	2	Open-ILS/web/js/ui/default/staff/cat/printlabels/app.js
+2	2	Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+2	2	Open-ILS/web/js/ui/default/staff/cat/z3950/app.js
+2	2	Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
+1	2	Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js
+2	2	Open-ILS/web/js/ui/default/staff/circ/patron/app.js
+2	2	Open-ILS/web/js/ui/default/staff/circ/patron/bucket/app.js
+2	2	Open-ILS/web/js/ui/default/staff/circ/patron/pending.js
+2	2	Open-ILS/web/js/ui/default/staff/circ/patron/register.js
+3	2	Open-ILS/web/js/ui/default/staff/circ/renew/app.js
+2	2	Open-ILS/web/js/ui/default/staff/circ/transits/list.js
+1	1	Open-ILS/web/js/ui/default/staff/offline.js
+2	2	Open-ILS/web/js/ui/default/staff/reporter/template/app.js
+2	2	Open-ILS/web/js/ui/default/staff/serials/app.js
+1	1	Open-ILS/web/js/ui/default/staff/services/startup.js
+
+commit faac33f3479f41157d6b2816cb1bbd4c1b4cb4f6
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Wed Nov 8 10:17:15 2017 -0500
+
+    LP#1721304: POT sync
+    
+    Done because, per LP#1686832, changes to strings in fm_IDL.xml
+    require one lest users of translations experience breakage.
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+1219	1197	build/i18n/po/fm_IDL.dtd/fm_IDL.dtd.pot
+283	208	build/i18n/po/webstaff/webstaff.pot
+
+commit cfb7979c77c1d5184fc2b3660580022c8cbdd98d
+Author: Kathy Lussier <klussier at masslnc.org>
+Date:   Tue Nov 7 16:41:02 2017 -0500
+
+    LP#1346381: Release notes for new shelving location limiter behavior
+    
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+9	0	docs/RELEASE_NOTES_NEXT/OPAC/copy_location_filter_changes.adoc
+ create mode 100644 docs/RELEASE_NOTES_NEXT/OPAC/copy_location_filter_changes.adoc
+
+commit 0e326b361a89a194fdd48aedca7f7f32d9bcff44
+Author: Rogan Hamby <rogan.hamby at gmail.com>
+Date:   Mon Jun 12 13:41:02 2017 -0400
+
+    LP#1346381: remove searching child org units, requirement to have volumes and adds existing org unit
+    
+    Signed-off-by: Rogan Hamby <rogan.hamby at gmail.com>
+    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
+
+1	6	Open-ILS/web/js/ui/default/opac/copyloc.js
+
+commit 73a18745da1e0a6340e84233d57f4bb42ec66d37
+Author: Ben Shum <ben at evergreener.net>
+Date:   Tue Nov 7 15:09:47 2017 -0500
+
+    LP#1730721: future proof build-db.sh (followup)
+    
+    For PostgreSQL 10+, the versioning scheme has changed. We only want
+    the top number for those versions and up.
+    
+    So, grab only the first two numbers for the variable...
+    
+    9.6.5 = 96
+    10.0 = 10, etc.
+    
+    Signed-off-by: Ben Shum <ben at evergreener.net>
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+
+1	1	Open-ILS/src/sql/Pg/build-db.sh
+
+commit b59863ee1af8c67e1c16361113cdfa58f5d0b97b
+Author: Ben Shum <ben at evergreener.net>
+Date:   Tue Nov 7 13:41:56 2017 -0500
+
+    LP#1730721: future proof build-db.sh
+    
+    Use the same logic we've got in eg_db_config for build-db.sh to determine
+    PostgreSQL version installed on server.
+    
+    Signed-off-by: Ben Shum <ben at evergreener.net>
+    Signed-off-by: Jason Stephenson <jason at sigio.com>
+
+1	1	Open-ILS/src/sql/Pg/build-db.sh
+
+commit 871e6d898396a59e014ac34fd6cf8c8990ce7594
+Author: Galen Charlton <gmc at equinoxinitiative.org>
+Date:   Thu Oct 19 21:06:50 2017 -0400
+
+    forward-port 2.12.7 upgrade script
+    
+    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
+
+25	0	Open-ILS/src/sql/Pg/version-upgrade/2.12.6-2.12.7-upgrade-db.sql
+ create mode 100644 Open-ILS/src/sql/Pg/version-upgrade/2.12.6-2.12.7-upgrade-db.sql
+
+commit 8c594593d39b9671cd9ab15f3a05e65314672c74
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Tue Oct 3 16:42:43 2017 -0400
+
+    LP#1714566 - enable hold notes to display on dialogs
+    
+    Also display all notes in the hold shelf dialog and other dialogs
+    so that staff is aware of any public notes that will
+    print.
+    
+    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+1	1	Open-ILS/src/templates/staff/circ/share/t_hold_shelf_dialog.tt2
+6	0	Open-ILS/src/templates/staff/circ/share/t_transit_dialog.tt2
+3	3	Open-ILS/src/templates/staff/share/print_templates/t_hold_shelf_slip.tt2
+2	4	Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+
+commit a5a4d91d84add7de18b07dd2f5404666ce176754
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Mon Oct 2 17:57:39 2017 -0400
+
+    LP#1714566 - enable hold notes set to print on slip to be shown
+    
+    Adds a bit of code and edits the realted templates in order
+    to be able to see any hold notes set to print on the slip.
+    
+    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+4	0	Open-ILS/src/templates/staff/circ/share/t_hold_shelf_dialog.tt2
+6	1	Open-ILS/src/templates/staff/share/print_templates/t_hold_shelf_slip.tt2
+9	0	Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+
+commit 81015a3628da39853b77bb3a0630bdd92abc7bcf
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Wed Oct 11 15:52:59 2017 -0400
+
+    LP#1689325 - correct typo repeated templateUrl modal
+    
+    Patron items out renew with date modal had a repeated templateURl.
+    Probably just a copy-pasta typo.
+    
+    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+0	1	Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+
+commit a769724694d0b7e2b841280e5281dbc02d5deb46
+Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
+Date:   Tue Oct 10 13:55:59 2017 -0400
+
+    LP#1689325 - require most modals have explicit 'exit' or 'cancel' action inside the modal
+    
+    Disable the default bahavior of bootstrap modals that lets
+    the user click outside the modal to dismiss or cancel it.
+    Similar behavior is not in the XUL, and this will make
+    unintentional clicks outside the modal less prone to losing
+    work in said modal.
+    
+    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
+    
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+1	0	Open-ILS/web/js/ui/default/staff/acq/app.js
+1	0	Open-ILS/web/js/ui/default/staff/admin/local/asset/copy_tag.js
+1	0	Open-ILS/web/js/ui/default/staff/admin/local/rating/badge.js
+1	0	Open-ILS/web/js/ui/default/staff/admin/serials/app.js
+1	0	Open-ILS/web/js/ui/default/staff/admin/serials/pattern_template.js
+1	0	Open-ILS/web/js/ui/default/staff/admin/server/authority/heading_field.js
+1	0	Open-ILS/web/js/ui/default/staff/admin/server/config/copy_tag_type.js
+1	0	Open-ILS/web/js/ui/default/staff/admin/server/config/marc_field.js
+6	0	Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js
+8	0	Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js
+11	0	Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
+1	0	Open-ILS/web/js/ui/default/staff/cat/services/holdings.js
+1	0	Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
+2	0	Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+5	0	Open-ILS/web/js/ui/default/staff/cat/z3950/app.js
+3	0	Open-ILS/web/js/ui/default/staff/circ/patron/app.js
+1	0	Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
+8	0	Open-ILS/web/js/ui/default/staff/circ/patron/bucket/app.js
+2	0	Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+2	0	Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
+1	0	Open-ILS/web/js/ui/default/staff/circ/services/billing.js
+14	0	Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+8	0	Open-ILS/web/js/ui/default/staff/circ/services/holds.js
+6	0	Open-ILS/web/js/ui/default/staff/circ/services/item.js
+1	0	Open-ILS/web/js/ui/default/staff/circ/services/patrons.js
+1	0	Open-ILS/web/js/ui/default/staff/circ/services/transits.js
+1	0	Open-ILS/web/js/ui/default/staff/circ/transits/list.js
+2	0	Open-ILS/web/js/ui/default/staff/offline.js
+1	0	Open-ILS/web/js/ui/default/staff/serials/directives/mfhd_manager.js
+2	1	Open-ILS/web/js/ui/default/staff/serials/directives/prediction_manager.js
+1	0	Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js
+1	0	Open-ILS/web/js/ui/default/staff/serials/services/core.js
+1	0	Open-ILS/web/js/ui/default/staff/services/mfhd.js
+1	0	Open-ILS/web/js/ui/default/staff/services/op_change.js
+5	0	Open-ILS/web/js/ui/default/staff/services/ui.js
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application.pm
index d750216..05287eb 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application.pm
@@ -7,7 +7,7 @@ use OpenILS::Utils::Fieldmapper;
 sub ils_version {
     # version format is "x-y-z", for example "2-0-0" for Evergreen 2.0.0
     # For branches, format is "x-y"
-    return "HEAD";
+    return "3-1-0";
 }
 
 __PACKAGE__->register_method(
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index c05350e..cbd6ff3 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -93,6 +93,7 @@ CREATE TRIGGER no_overlapping_deps
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
 INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1109', :eg_version); --dbwells/kmlussier
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('3.1.0', :eg_version);
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/version-upgrade/3.0.5-3.1.0-upgrade-db.sql b/Open-ILS/src/sql/Pg/version-upgrade/3.0.5-3.1.0-upgrade-db.sql
new file mode 100644
index 0000000..dee6250
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/version-upgrade/3.0.5-3.1.0-upgrade-db.sql
@@ -0,0 +1,9226 @@
+--Upgrade Script for 3.0.5 to 3.1.0
+\set eg_version '''3.1.0'''
+BEGIN;
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('3.1.0', :eg_version);
+
+SELECT evergreen.upgrade_deps_block_check('1089', :eg_version);
+
+-- Add the circ.holds.max_duplicate_holds org. unit setting type.
+INSERT into config.org_unit_setting_type
+( name, grp, label, description, datatype, fm_class )
+VALUES
+( 'circ.holds.max_duplicate_holds', 'holds',
+   oils_i18n_gettext(
+     'circ.holds.max_duplicate_holds',
+     'Maximum number of duplicate holds allowed.',
+     'coust', 'label'),
+   oils_i18n_gettext(
+     'circ.holds.max_duplicate_holds',
+     'Maximum number of duplicate title or metarecord holds allowed per patron.',
+     'coust', 'description'),
+   'integer', null );
+
+
+
+SELECT evergreen.upgrade_deps_block_check('1090', :eg_version);
+
+ALTER TABLE biblio.record_entry
+    ADD COLUMN merge_date TIMESTAMP WITH TIME ZONE,
+    ADD COLUMN merged_to BIGINT REFERENCES biblio.record_entry(id);
+
+CREATE OR REPLACE FUNCTION asset.merge_record_assets( target_record BIGINT, source_record BIGINT ) RETURNS INT AS $func$
+DECLARE
+    moved_objects INT := 0;
+    source_cn     asset.call_number%ROWTYPE;
+    target_cn     asset.call_number%ROWTYPE;
+    metarec       metabib.metarecord%ROWTYPE;
+    hold          action.hold_request%ROWTYPE;
+    ser_rec       serial.record_entry%ROWTYPE;
+    ser_sub       serial.subscription%ROWTYPE;
+    acq_lineitem  acq.lineitem%ROWTYPE;
+    acq_request   acq.user_request%ROWTYPE;
+    booking       booking.resource_type%ROWTYPE;
+    source_part   biblio.monograph_part%ROWTYPE;
+    target_part   biblio.monograph_part%ROWTYPE;
+    multi_home    biblio.peer_bib_copy_map%ROWTYPE;
+    uri_count     INT := 0;
+    counter       INT := 0;
+    uri_datafield TEXT;
+    uri_text      TEXT := '';
+BEGIN
+
+    -- move any 856 entries on records that have at least one MARC-mapped URI entry
+    SELECT  INTO uri_count COUNT(*)
+      FROM  asset.uri_call_number_map m
+            JOIN asset.call_number cn ON (m.call_number = cn.id)
+      WHERE cn.record = source_record;
+
+    IF uri_count > 0 THEN
+        
+        -- This returns more nodes than you might expect:
+        -- 7 instead of 1 for an 856 with $u $y $9
+        SELECT  COUNT(*) INTO counter
+          FROM  oils_xpath_table(
+                    'id',
+                    'marc',
+                    'biblio.record_entry',
+                    '//*[@tag="856"]',
+                    'id=' || source_record
+                ) as t(i int,c text);
+    
+        FOR i IN 1 .. counter LOOP
+            SELECT  '<datafield xmlns="http://www.loc.gov/MARC21/slim"' || 
+			' tag="856"' ||
+			' ind1="' || FIRST(ind1) || '"'  ||
+			' ind2="' || FIRST(ind2) || '">' ||
+                        STRING_AGG(
+                            '<subfield code="' || subfield || '">' ||
+                            regexp_replace(
+                                regexp_replace(
+                                    regexp_replace(data,'&','&','g'),
+                                    '>', '>', 'g'
+                                ),
+                                '<', '<', 'g'
+                            ) || '</subfield>', ''
+                        ) || '</datafield>' INTO uri_datafield
+              FROM  oils_xpath_table(
+                        'id',
+                        'marc',
+                        'biblio.record_entry',
+                        '//*[@tag="856"][position()=' || i || ']/@ind1|' ||
+                        '//*[@tag="856"][position()=' || i || ']/@ind2|' ||
+                        '//*[@tag="856"][position()=' || i || ']/*/@code|' ||
+                        '//*[@tag="856"][position()=' || i || ']/*[@code]',
+                        'id=' || source_record
+                    ) as t(id int,ind1 text, ind2 text,subfield text,data text);
+
+            -- As most of the results will be NULL, protect against NULLifying
+            -- the valid content that we do generate
+            uri_text := uri_text || COALESCE(uri_datafield, '');
+        END LOOP;
+
+        IF uri_text <> '' THEN
+            UPDATE  biblio.record_entry
+              SET   marc = regexp_replace(marc,'(</[^>]*record>)', uri_text || E'\\1')
+              WHERE id = target_record;
+        END IF;
+
+    END IF;
+
+	-- Find and move metarecords to the target record
+	SELECT	INTO metarec *
+	  FROM	metabib.metarecord
+	  WHERE	master_record = source_record;
+
+	IF FOUND THEN
+		UPDATE	metabib.metarecord
+		  SET	master_record = target_record,
+			mods = NULL
+		  WHERE	id = metarec.id;
+
+		moved_objects := moved_objects + 1;
+	END IF;
+
+	-- Find call numbers attached to the source ...
+	FOR source_cn IN SELECT * FROM asset.call_number WHERE record = source_record LOOP
+
+		SELECT	INTO target_cn *
+		  FROM	asset.call_number
+		  WHERE	label = source_cn.label
+            AND prefix = source_cn.prefix
+            AND suffix = source_cn.suffix
+			AND owning_lib = source_cn.owning_lib
+			AND record = target_record
+			AND NOT deleted;
+
+		-- ... and if there's a conflicting one on the target ...
+		IF FOUND THEN
+
+			-- ... move the copies to that, and ...
+			UPDATE	asset.copy
+			  SET	call_number = target_cn.id
+			  WHERE	call_number = source_cn.id;
+
+			-- ... move V holds to the move-target call number
+			FOR hold IN SELECT * FROM action.hold_request WHERE target = source_cn.id AND hold_type = 'V' LOOP
+		
+				UPDATE	action.hold_request
+				  SET	target = target_cn.id
+				  WHERE	id = hold.id;
+		
+				moved_objects := moved_objects + 1;
+			END LOOP;
+        
+            UPDATE asset.call_number SET deleted = TRUE WHERE id = source_cn.id;
+
+		-- ... if not ...
+		ELSE
+			-- ... just move the call number to the target record
+			UPDATE	asset.call_number
+			  SET	record = target_record
+			  WHERE	id = source_cn.id;
+		END IF;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find T holds targeting the source record ...
+	FOR hold IN SELECT * FROM action.hold_request WHERE target = source_record AND hold_type = 'T' LOOP
+
+		-- ... and move them to the target record
+		UPDATE	action.hold_request
+		  SET	target = target_record
+		  WHERE	id = hold.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find serial records targeting the source record ...
+	FOR ser_rec IN SELECT * FROM serial.record_entry WHERE record = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	serial.record_entry
+		  SET	record = target_record
+		  WHERE	id = ser_rec.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find serial subscriptions targeting the source record ...
+	FOR ser_sub IN SELECT * FROM serial.subscription WHERE record_entry = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	serial.subscription
+		  SET	record_entry = target_record
+		  WHERE	id = ser_sub.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find booking resource types targeting the source record ...
+	FOR booking IN SELECT * FROM booking.resource_type WHERE record = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	booking.resource_type
+		  SET	record = target_record
+		  WHERE	id = booking.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find acq lineitems targeting the source record ...
+	FOR acq_lineitem IN SELECT * FROM acq.lineitem WHERE eg_bib_id = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	acq.lineitem
+		  SET	eg_bib_id = target_record
+		  WHERE	id = acq_lineitem.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find acq user purchase requests targeting the source record ...
+	FOR acq_request IN SELECT * FROM acq.user_request WHERE eg_bib = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	acq.user_request
+		  SET	eg_bib = target_record
+		  WHERE	id = acq_request.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find parts attached to the source ...
+	FOR source_part IN SELECT * FROM biblio.monograph_part WHERE record = source_record LOOP
+
+		SELECT	INTO target_part *
+		  FROM	biblio.monograph_part
+		  WHERE	label = source_part.label
+			AND record = target_record;
+
+		-- ... and if there's a conflicting one on the target ...
+		IF FOUND THEN
+
+			-- ... move the copy-part maps to that, and ...
+			UPDATE	asset.copy_part_map
+			  SET	part = target_part.id
+			  WHERE	part = source_part.id;
+
+			-- ... move P holds to the move-target part
+			FOR hold IN SELECT * FROM action.hold_request WHERE target = source_part.id AND hold_type = 'P' LOOP
+		
+				UPDATE	action.hold_request
+				  SET	target = target_part.id
+				  WHERE	id = hold.id;
+		
+				moved_objects := moved_objects + 1;
+			END LOOP;
+
+		-- ... if not ...
+		ELSE
+			-- ... just move the part to the target record
+			UPDATE	biblio.monograph_part
+			  SET	record = target_record
+			  WHERE	id = source_part.id;
+		END IF;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find multi_home items attached to the source ...
+	FOR multi_home IN SELECT * FROM biblio.peer_bib_copy_map WHERE peer_record = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	biblio.peer_bib_copy_map
+		  SET	peer_record = target_record
+		  WHERE	id = multi_home.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- And delete mappings where the item's home bib was merged with the peer bib
+	DELETE FROM biblio.peer_bib_copy_map WHERE peer_record = (
+		SELECT (SELECT record FROM asset.call_number WHERE id = call_number)
+		FROM asset.copy WHERE id = target_copy
+	);
+
+    -- Apply merge tracking
+    UPDATE biblio.record_entry 
+        SET merge_date = NOW() WHERE id = target_record;
+
+    UPDATE biblio.record_entry
+        SET merge_date = NOW(), merged_to = target_record
+        WHERE id = source_record;
+
+    -- Finally, "delete" the source record
+    DELETE FROM biblio.record_entry WHERE id = source_record;
+
+	-- That's all, folks!
+	RETURN moved_objects;
+END;
+$func$ LANGUAGE plpgsql;
+
+
+
+SELECT evergreen.upgrade_deps_block_check('1091', :eg_version);
+
+ALTER TABLE acq.funding_source DROP CONSTRAINT funding_source_code_key;
+ALTER TABLE acq.funding_source ALTER COLUMN code SET NOT NULL;
+ALTER TABLE acq.funding_source ADD CONSTRAINT funding_source_code_once_per_owner UNIQUE (code,owner);
+
+
+SELECT evergreen.upgrade_deps_block_check('1092', :eg_version);
+
+CREATE OR REPLACE FUNCTION metabib.reingest_record_attributes (rid BIGINT, pattr_list TEXT[] DEFAULT NULL, prmarc TEXT DEFAULT NULL, rdeleted BOOL DEFAULT TRUE) RETURNS VOID AS $func$
+DECLARE
+    transformed_xml TEXT;
+    rmarc           TEXT := prmarc;
+    tmp_val         TEXT;
+    prev_xfrm       TEXT;
+    normalizer      RECORD;
+    xfrm            config.xml_transform%ROWTYPE;
+    attr_vector     INT[] := '{}'::INT[];
+    attr_vector_tmp INT[];
+    attr_list       TEXT[] := pattr_list;
+    attr_value      TEXT[];
+    norm_attr_value TEXT[];
+    tmp_xml         TEXT;
+    tmp_array       TEXT[];
+    attr_def        config.record_attr_definition%ROWTYPE;
+    ccvm_row        config.coded_value_map%ROWTYPE;
+    jump_past       BOOL;
+BEGIN
+
+    IF attr_list IS NULL OR rdeleted THEN -- need to do the full dance on INSERT or undelete
+        SELECT ARRAY_AGG(name) INTO attr_list FROM config.record_attr_definition
+        WHERE (
+            tag IS NOT NULL OR
+            fixed_field IS NOT NULL OR
+            xpath IS NOT NULL OR
+            phys_char_sf IS NOT NULL OR
+            composite
+        ) AND (
+            filter OR sorter
+        );
+    END IF;
+
+    IF rmarc IS NULL THEN
+        SELECT marc INTO rmarc FROM biblio.record_entry WHERE id = rid;
+    END IF;
+
+    FOR attr_def IN SELECT * FROM config.record_attr_definition WHERE NOT composite AND name = ANY( attr_list ) ORDER BY format LOOP
+
+        jump_past := FALSE; -- This gets set when we are non-multi and have found something
+        attr_value := '{}'::TEXT[];
+        norm_attr_value := '{}'::TEXT[];
+        attr_vector_tmp := '{}'::INT[];
+
+        SELECT * INTO ccvm_row FROM config.coded_value_map c WHERE c.ctype = attr_def.name LIMIT 1; 
+
+        IF attr_def.tag IS NOT NULL THEN -- tag (and optional subfield list) selection
+            SELECT  ARRAY_AGG(value) INTO attr_value
+              FROM  (SELECT * FROM metabib.full_rec ORDER BY tag, subfield) AS x
+              WHERE record = rid
+                    AND tag LIKE attr_def.tag
+                    AND CASE
+                        WHEN attr_def.sf_list IS NOT NULL 
+                            THEN POSITION(subfield IN attr_def.sf_list) > 0
+                        ELSE TRUE
+                    END
+              GROUP BY tag
+              ORDER BY tag;
+
+            IF NOT attr_def.multi THEN
+                attr_value := ARRAY[ARRAY_TO_STRING(attr_value, COALESCE(attr_def.joiner,' '))];
+                jump_past := TRUE;
+            END IF;
+        END IF;
+
+        IF NOT jump_past AND attr_def.fixed_field IS NOT NULL THEN -- a named fixed field, see config.marc21_ff_pos_map.fixed_field
+            attr_value := attr_value || vandelay.marc21_extract_fixed_field_list(rmarc, attr_def.fixed_field);
+
+            IF NOT attr_def.multi THEN
+                attr_value := ARRAY[attr_value[1]];
+                jump_past := TRUE;
+            END IF;
+        END IF;
+
+        IF NOT jump_past AND attr_def.xpath IS NOT NULL THEN -- and xpath expression
+
+            SELECT INTO xfrm * FROM config.xml_transform WHERE name = attr_def.format;
+        
+            -- See if we can skip the XSLT ... it's expensive
+            IF prev_xfrm IS NULL OR prev_xfrm <> xfrm.name THEN
+                -- Can't skip the transform
+                IF xfrm.xslt <> '---' THEN
+                    transformed_xml := oils_xslt_process(rmarc,xfrm.xslt);
+                ELSE
+                    transformed_xml := rmarc;
+                END IF;
+    
+                prev_xfrm := xfrm.name;
+            END IF;
+
+            IF xfrm.name IS NULL THEN
+                -- just grab the marcxml (empty) transform
+                SELECT INTO xfrm * FROM config.xml_transform WHERE xslt = '---' LIMIT 1;
+                prev_xfrm := xfrm.name;
+            END IF;
+
+            FOR tmp_xml IN SELECT UNNEST(oils_xpath(attr_def.xpath, transformed_xml, ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]])) LOOP
+                tmp_val := oils_xpath_string(
+                                '//*',
+                                tmp_xml,
+                                COALESCE(attr_def.joiner,' '),
+                                ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]]
+                            );
+                IF tmp_val IS NOT NULL AND BTRIM(tmp_val) <> '' THEN
+                    attr_value := attr_value || tmp_val;
+                    EXIT WHEN NOT attr_def.multi;
+                END IF;
+            END LOOP;
+        END IF;
+
+        IF NOT jump_past AND attr_def.phys_char_sf IS NOT NULL THEN -- a named Physical Characteristic, see config.marc21_physical_characteristic_*_map
+            SELECT  ARRAY_AGG(m.value) INTO tmp_array
+              FROM  vandelay.marc21_physical_characteristics(rmarc) v
+                    LEFT JOIN config.marc21_physical_characteristic_value_map m ON (m.id = v.value)
+              WHERE v.subfield = attr_def.phys_char_sf AND (m.value IS NOT NULL AND BTRIM(m.value) <> '')
+                    AND ( ccvm_row.id IS NULL OR ( ccvm_row.id IS NOT NULL AND v.id IS NOT NULL) );
+
+            attr_value := attr_value || tmp_array;
+
+            IF NOT attr_def.multi THEN
+                attr_value := ARRAY[attr_value[1]];
+            END IF;
+
+        END IF;
+
+                -- apply index normalizers to attr_value
+        FOR tmp_val IN SELECT value FROM UNNEST(attr_value) x(value) LOOP
+            FOR normalizer IN
+                SELECT  n.func AS func,
+                        n.param_count AS param_count,
+                        m.params AS params
+                  FROM  config.index_normalizer n
+                        JOIN config.record_attr_index_norm_map m ON (m.norm = n.id)
+                  WHERE attr = attr_def.name
+                  ORDER BY m.pos LOOP
+                    EXECUTE 'SELECT ' || normalizer.func || '(' ||
+                    COALESCE( quote_literal( tmp_val ), 'NULL' ) ||
+                        CASE
+                            WHEN normalizer.param_count > 0
+                                THEN ',' || REPLACE(REPLACE(BTRIM(normalizer.params,'[]'),E'\'',E'\\\''),E'"',E'\'')
+                                ELSE ''
+                            END ||
+                    ')' INTO tmp_val;
+
+            END LOOP;
+            IF tmp_val IS NOT NULL AND tmp_val <> '' THEN
+                -- note that a string that contains only blanks
+                -- is a valid value for some attributes
+                norm_attr_value := norm_attr_value || tmp_val;
+            END IF;
+        END LOOP;
+        
+        IF attr_def.filter THEN
+            -- Create unknown uncontrolled values and find the IDs of the values
+            IF ccvm_row.id IS NULL THEN
+                FOR tmp_val IN SELECT value FROM UNNEST(norm_attr_value) x(value) LOOP
+                    IF tmp_val IS NOT NULL AND BTRIM(tmp_val) <> '' THEN
+                        BEGIN -- use subtransaction to isolate unique constraint violations
+                            INSERT INTO metabib.uncontrolled_record_attr_value ( attr, value ) VALUES ( attr_def.name, tmp_val );
+                        EXCEPTION WHEN unique_violation THEN END;
+                    END IF;
+                END LOOP;
+
+                SELECT ARRAY_AGG(id) INTO attr_vector_tmp FROM metabib.uncontrolled_record_attr_value WHERE attr = attr_def.name AND value = ANY( norm_attr_value );
+            ELSE
+                SELECT ARRAY_AGG(id) INTO attr_vector_tmp FROM config.coded_value_map WHERE ctype = attr_def.name AND code = ANY( norm_attr_value );
+            END IF;
+
+            -- Add the new value to the vector
+            attr_vector := attr_vector || attr_vector_tmp;
+        END IF;
+
+        IF attr_def.sorter THEN
+            DELETE FROM metabib.record_sorter WHERE source = rid AND attr = attr_def.name;
+            IF norm_attr_value[1] IS NOT NULL THEN
+                INSERT INTO metabib.record_sorter (source, attr, value) VALUES (rid, attr_def.name, norm_attr_value[1]);
+            END IF;
+        END IF;
+
+    END LOOP;
+
+/* We may need to rewrite the vlist to contain
+   the intersection of new values for requested
+   attrs and old values for ignored attrs. To
+   do this, we take the old attr vlist and
+   subtract any values that are valid for the
+   requested attrs, and then add back the new
+   set of attr values. */
+
+    IF ARRAY_LENGTH(pattr_list, 1) > 0 THEN 
+        SELECT vlist INTO attr_vector_tmp FROM metabib.record_attr_vector_list WHERE source = rid;
+        SELECT attr_vector_tmp - ARRAY_AGG(id::INT) INTO attr_vector_tmp FROM metabib.full_attr_id_map WHERE attr = ANY (pattr_list);
+        attr_vector := attr_vector || attr_vector_tmp;
+    END IF;
+
+    -- On to composite attributes, now that the record attrs have been pulled.  Processed in name order, so later composite
+    -- attributes can depend on earlier ones.
+    PERFORM metabib.compile_composite_attr_cache_init();
+    FOR attr_def IN SELECT * FROM config.record_attr_definition WHERE composite AND name = ANY( attr_list ) ORDER BY name LOOP
+
+        FOR ccvm_row IN SELECT * FROM config.coded_value_map c WHERE c.ctype = attr_def.name ORDER BY value LOOP
+
+            tmp_val := metabib.compile_composite_attr( ccvm_row.id );
+            CONTINUE WHEN tmp_val IS NULL OR tmp_val = ''; -- nothing to do
+
+            IF attr_def.filter THEN
+                IF attr_vector @@ tmp_val::query_int THEN
+                    attr_vector = attr_vector + intset(ccvm_row.id);
+                    EXIT WHEN NOT attr_def.multi;
+                END IF;
+            END IF;
+
+            IF attr_def.sorter THEN
+                IF attr_vector @@ tmp_val THEN
+                    DELETE FROM metabib.record_sorter WHERE source = rid AND attr = attr_def.name;
+                    INSERT INTO metabib.record_sorter (source, attr, value) VALUES (rid, attr_def.name, ccvm_row.code);
+                END IF;
+            END IF;
+
+        END LOOP;
+
+    END LOOP;
+
+    IF ARRAY_LENGTH(attr_vector, 1) > 0 THEN
+        IF rdeleted THEN -- initial insert OR revivication
+            DELETE FROM metabib.record_attr_vector_list WHERE source = rid;
+            INSERT INTO metabib.record_attr_vector_list (source, vlist) VALUES (rid, attr_vector);
+        ELSE
+            UPDATE metabib.record_attr_vector_list SET vlist = attr_vector WHERE source = rid;
+        END IF;
+    END IF;
+
+END;
+
+$func$ LANGUAGE PLPGSQL;
+
+
+
+SELECT evergreen.upgrade_deps_block_check('1093', :eg_version);
+
+UPDATE config.record_attr_definition SET tag = '041', sf_list = 'abdefgm' where name = 'item_lang';
+
+
+
+SELECT evergreen.upgrade_deps_block_check('1094', :eg_version);
+
+SELECT metabib.reingest_record_attributes (record, '{item_lang}'::TEXT[])
+  FROM (SELECT  DISTINCT record
+          FROM  metabib.real_full_rec
+           WHERE tag = '041'
+                  AND subfield IN ('a','b','d','e','f','g','m')
+       ) x;
+
+
+
+SELECT evergreen.upgrade_deps_block_check('1095', :eg_version);
+
+CREATE OR REPLACE FUNCTION asset.copy_state (cid BIGINT) RETURNS TEXT AS $$
+DECLARE
+    last_circ_stop	TEXT;
+    the_copy	    asset.copy%ROWTYPE;
+BEGIN
+
+    SELECT * INTO the_copy FROM asset.copy WHERE id = cid;
+    IF NOT FOUND THEN RETURN NULL; END IF;
+
+    IF the_copy.status = 3 THEN -- Lost
+        RETURN 'LOST';
+    ELSIF the_copy.status = 4 THEN -- Missing
+        RETURN 'MISSING';
+    ELSIF the_copy.status = 14 THEN -- Damaged
+        RETURN 'DAMAGED';
+    ELSIF the_copy.status = 17 THEN -- Lost and paid
+        RETURN 'LOST_AND_PAID';
+    END IF;
+
+    SELECT stop_fines INTO last_circ_stop
+      FROM  action.circulation
+      WHERE target_copy = cid
+      ORDER BY xact_start DESC LIMIT 1;
+
+    IF FOUND THEN
+        IF last_circ_stop IN (
+            'CLAIMSNEVERCHECKEDOUT',
+            'CLAIMSRETURNED',
+            'LONGOVERDUE'
+        ) THEN
+            RETURN last_circ_stop;
+        END IF;
+    END IF;
+
+    RETURN 'NORMAL';
+END;
+$$ LANGUAGE PLPGSQL;
+
+CREATE TYPE config.copy_alert_type_state AS ENUM (
+    'NORMAL',
+    'LOST',
+    'LOST_AND_PAID',
+    'MISSING',
+    'DAMAGED',
+    'CLAIMSRETURNED',
+    'LONGOVERDUE',
+    'CLAIMSNEVERCHECKEDOUT'
+);
+
+CREATE TYPE config.copy_alert_type_event AS ENUM (
+    'CHECKIN',
+    'CHECKOUT'
+);
+
+CREATE TABLE config.copy_alert_type (
+    id      	serial  primary key, -- reserve 1-100 for system
+    scope_org   int not null references actor.org_unit (id) on delete cascade,
+    active      bool    not null default true,
+    name        text    not null unique,
+    state       config.copy_alert_type_state,
+    event       config.copy_alert_type_event,
+    in_renew    bool,
+    invert_location bool    not null default false,
+    at_circ     bool,
+    at_owning   bool,
+    next_status int[]
+);
+SELECT SETVAL('config.copy_alert_type_id_seq'::TEXT, 100);
+
+CREATE OR REPLACE FUNCTION evergreen.asset_copy_alert_copy_inh_fkey() RETURNS TRIGGER AS $f$
+BEGIN
+        PERFORM 1 FROM asset.copy WHERE id = NEW.copy;
+        IF NOT FOUND THEN
+                RAISE foreign_key_violation USING MESSAGE = FORMAT(
+                        $$Referenced asset.copy id not found, copy:%s$$, NEW.copy
+                );
+        END IF;
+        RETURN NEW;
+END;
+$f$ LANGUAGE PLPGSQL VOLATILE COST 50;
+
+CREATE TABLE actor.copy_alert_suppress (
+    id          serial primary key,
+    org         int not null references actor.org_unit (id) on delete cascade,
+    alert_type  int not null references config.copy_alert_type (id) on delete cascade
+);
+
+CREATE TABLE asset.copy_alert (
+    id      bigserial   primary key,
+    alert_type  int     not null references config.copy_alert_type (id) on delete cascade,
+    copy        bigint  not null,
+    temp        bool    not null default false,
+    create_time timestamptz not null default now(),
+    create_staff    bigint  not null references actor.usr (id) on delete set null,
+    note        text,
+    ack_time    timestamptz,
+    ack_staff   bigint references actor.usr (id) on delete set null
+);
+
+CREATE CONSTRAINT TRIGGER inherit_asset_copy_alert_copy_fkey
+        AFTER UPDATE OR INSERT ON asset.copy_alert
+        DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_copy_alert_copy_inh_fkey();
+
+CREATE VIEW asset.active_copy_alert AS
+    SELECT  *
+      FROM  asset.copy_alert
+      WHERE ack_time IS NULL;
+
+
+
+SELECT evergreen.upgrade_deps_block_check('1096', :eg_version);
+
+-- staff-usable alert types with no location awareness
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew)
+VALUES (1, 1, TRUE, 'Normal checkout', 'NORMAL', 'CHECKOUT', FALSE);
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew)
+VALUES (2, 1, TRUE, 'Normal checkin', 'NORMAL', 'CHECKIN', FALSE);
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew)
+VALUES (3, 1, FALSE, 'Normal renewal', 'NORMAL', 'CHECKIN', TRUE);
+
+-- copy alerts upon checkin or renewal of exceptional copy statuses are not active by
+-- default; they're meant to be turned once a site is ready to fully
+-- commit to using the webstaff client for circulation
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (4, 1, FALSE, 'Checkin of lost copy', 'LOST', 'CHECKIN');
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (5, 1, FALSE, 'Checkin of missing copy', 'MISSING', 'CHECKIN');
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (6, 1, FALSE, 'Checkin of lost-and-paid copy', 'LOST_AND_PAID', 'CHECKIN');
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (7, 1, FALSE, 'Checkin of damaged copy', 'DAMAGED', 'CHECKIN');
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (8, 1, FALSE, 'Checkin of claims-returned copy', 'CLAIMSRETURNED', 'CHECKIN');
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (9, 1, FALSE, 'Checkin of long overdue copy', 'LONGOVERDUE', 'CHECKIN');
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (10, 1, FALSE, 'Checkin of claims-never-checked-out copy', 'CLAIMSNEVERCHECKEDOUT', 'CHECKIN');
+
+-- copy alerts upon checkout of exceptional copy statuses are not active by
+-- default; they're meant to be turned once a site is ready to fully
+-- commit to using the webstaff client for circulation
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (11, 1, FALSE, 'Checkout of lost copy', 'LOST', 'CHECKOUT');
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (12, 1, FALSE, 'Checkout of missing copy', 'MISSING', 'CHECKOUT');
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (13, 1, FALSE, 'Checkout of lost-and-paid copy', 'LOST_AND_PAID', 'CHECKOUT');
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (14, 1, FALSE, 'Checkout of damaged copy', 'DAMAGED', 'CHECKOUT');
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (15, 1, FALSE, 'Checkout of claims-returned copy', 'CLAIMSRETURNED', 'CHECKOUT');
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (16, 1, FALSE, 'Checkout of long overdue copy', 'LONGOVERDUE', 'CHECKOUT');
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event)
+VALUES (17, 1, FALSE, 'Checkout of claims-never-checked-out copy', 'CLAIMSNEVERCHECKEDOUT', 'CHECKOUT');
+
+-- staff-usable alert types based on location
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_circ)
+VALUES (18, 1, FALSE, 'Normal checkout at circ lib', 'NORMAL', 'CHECKOUT', FALSE, TRUE);
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_circ)
+VALUES (19, 1, FALSE, 'Normal checkin at circ lib', 'NORMAL', 'CHECKIN', FALSE, TRUE);
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_circ)
+VALUES (20, 1, FALSE, 'Normal renewal at circ lib', 'NORMAL', 'CHECKIN', TRUE, TRUE);
+
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_owning)
+VALUES (21, 1, FALSE, 'Normal checkout at owning lib', 'NORMAL', 'CHECKOUT', FALSE, TRUE);
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_owning)
+VALUES (22, 1, FALSE, 'Normal checkin at owning lib', 'NORMAL', 'CHECKIN', FALSE, TRUE);
+INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_owning)
+VALUES (23, 1, FALSE, 'Normal renewal at owning lib', 'NORMAL', 'CHECKIN', TRUE, TRUE);
+
+
+SELECT evergreen.upgrade_deps_block_check('1097', :eg_version);
+
+INSERT INTO config.org_unit_setting_type
+    (name, grp, label, description, datatype)
+    VALUES
+        ('circ.copy_alerts.forgive_fines_on_lost_checkin',
+         'circ',
+         oils_i18n_gettext('circ.copy_alerts.forgive_fines_on_lost_checkin',
+            'Forgive fines when checking out a lost item and copy alert is suppressed?',
+            'coust', 'label'),
+         oils_i18n_gettext('circ.copy_alerts.forgive_fines_on_lost_checkin',
+            'Controls whether fines are automatically forgiven when checking out an '||
+            'item that has been marked as lost, and the corresponding copy alert has been '||
+            'suppressed.',
+            'coust', 'description'),
+        'bool');
+
+INSERT INTO config.org_unit_setting_type
+    (name, grp, label, description, datatype)
+    VALUES
+        ('circ.copy_alerts.forgive_fines_on_long_overdue_checkin',
+         'circ',
+         oils_i18n_gettext('circ.copy_alerts.forgive_fines_on_long_overdue_checkin',
+            'Forgive fines when checking out a long-overdue item and copy alert is suppressed?',
+            'coust', 'label'),
+         oils_i18n_gettext('circ.copy_alerts.forgive_fines_on_lost_checkin',
+            'Controls whether fines are automatically forgiven when checking out an '||
+            'item that has been marked as lost, and the corresponding copy alert has been '||
+            'suppressed.',
+            'coust', 'description'),
+        'bool');
+
+
+SELECT evergreen.upgrade_deps_block_check('1098', :eg_version);
+
+\qecho Copying copy alert messages to normal checkout copy alerts...
+INSERT INTO asset.copy_alert (alert_type, copy, note, create_staff)
+SELECT 1, id, alert_message, 1
+FROM asset.copy
+WHERE alert_message IS NOT NULL
+AND   alert_message <> '';
+
+\qecho Copying copy alert messages to normal checkin copy alerts...
+INSERT INTO asset.copy_alert (alert_type, copy, note, create_staff)
+SELECT 2, id, alert_message, 1
+FROM asset.copy
+WHERE alert_message IS NOT NULL
+AND   alert_message <> '';
+
+\qecho Clearing legacy copy alert field; this may take a while
+UPDATE asset.copy SET alert_message = NULL
+WHERE alert_message IS NOT NULL;
+
+
+SELECT evergreen.upgrade_deps_block_check('1099', :eg_version);
+
+\qecho Making the following copy alert types active by default; if you
+\qecho are not using the web staff client yet, you may want to disable
+\qecho them.
+\qecho  - Checkin of lost, missing, lost-and-paid, damaged, claims returned,
+\qecho    long overdue, and claims never checked out items.
+\qecho  - Checkout of lost, missing, lost-and-paid, damaged, claims returned,
+\qecho    long overdue, and claims never checked out items.
+
+UPDATE config.copy_alert_type
+SET active = TRUE
+WHERE id IN (4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17);
+
+
+SELECT evergreen.upgrade_deps_block_check('1100', :eg_version);
+
+-- NEW config.metabib_field entries
+
+UPDATE config.metabib_field SET display_xpath = facet_xpath, display_field = TRUE WHERE id = 33;
+
+INSERT INTO config.metabib_field (id, field_class, name, 
+    label, xpath, display_field, search_field, browse_field)
+VALUES (
+    38, 'identifier', 'edition', 
+    oils_i18n_gettext(38, 'Edition', 'cmf', 'label'),
+    $$//mods33:mods/mods33:originInfo//mods33:edition[1]$$,
+    TRUE, TRUE, FALSE
+);
+
+INSERT INTO config.metabib_field (id, field_class, name, 
+    label, xpath, display_field, search_field, browse_field)
+VALUES (
+    39, 'keyword', 'physical_description', 
+    oils_i18n_gettext(39, 'Physical Descrption', 'cmf', 'label'),
+    $$(//mods33:mods/mods33:physicalDescription/mods33:form|//mods33:mods/mods33:physicalDescription/mods33:extent|//mods33:mods/mods33:physicalDescription/mods33:reformattingQuality|//mods33:mods/mods33:physicalDescription/mods33:internetMediaType|//mods33:mods/mods33:physicalDescription/mods33:digitalOrigin)$$,
+    TRUE, TRUE, FALSE
+);
+
+INSERT INTO config.metabib_field (id, field_class, name, 
+    label, xpath, display_field, search_field, browse_field)
+VALUES (
+    40, 'identifier', 'publisher', 
+    oils_i18n_gettext(40, 'Publisher', 'cmf', 'label'),
+    $$//mods33:mods/mods33:originInfo//mods33:publisher[1]$$,
+    TRUE, TRUE, FALSE
+);
+
+INSERT INTO config.metabib_field (id, field_class, name, 
+    label, xpath, display_field, search_field, browse_field)
+VALUES (
+    41, 'keyword', 'abstract', 
+    oils_i18n_gettext(41, 'Abstract', 'cmf', 'label'),
+    $$//mods33:mods/mods33:abstract$$,
+    TRUE, TRUE, FALSE
+);
+
+INSERT INTO config.metabib_field (id, field_class, name, 
+    label, xpath, display_field, search_field, browse_field)
+VALUES (
+    42, 'keyword', 'toc', 
+    oils_i18n_gettext(42, 'Table of Contents', 'cmf', 'label'),
+    $$//mods33:tableOfContents$$,
+    TRUE, TRUE, FALSE
+);
+
+INSERT INTO config.metabib_field (id, field_class, name, 
+    label, xpath, display_field, search_field, browse_field)
+VALUES (
+    43, 'identifier', 'type_of_resource', 
+    oils_i18n_gettext(43, 'Type of Resource', 'cmf', 'label'),
+    $$//mods33:mods/mods33:typeOfResource$$,
+    TRUE, FALSE, FALSE
+);
+
+INSERT INTO config.metabib_field (id, field_class, name, 
+    label, xpath, display_field, search_field, browse_field)
+VALUES (
+    44, 'identifier', 'pubdate', 
+    oils_i18n_gettext(44, 'Publication Date', 'cmf', 'label'),
+    $$//mods33:mods/mods33:originInfo//mods33:dateIssued[@encoding="marc"]|//mods33:mods/mods33:originInfo//mods33:dateIssued[1]$$,
+    TRUE, FALSE, FALSE
+);
+
+INSERT INTO config.metabib_field (id, field_class, name, 
+    label, xpath, display_field, search_field, browse_field)
+VALUES (
+    46, 'keyword', 'bibliography', 
+    oils_i18n_gettext(46, 'Bibliography', 'cmf', 'label'),
+    $$//mods33:note[@type='bibliography']$$,
+    TRUE, TRUE, FALSE
+),(
+    47, 'keyword', 'thesis', 
+    oils_i18n_gettext(47, 'Thesis', 'cmf', 'label'),
+    $$//mods33:note[@type='thesis']$$,
+    TRUE, TRUE, FALSE
+),(
+    48, 'keyword', 'production_credits', 
+    oils_i18n_gettext(48, 'Creation/Production Credits', 'cmf', 'label'),
+    $$//mods33:note[@type='creation/production credits']$$,
+    TRUE, TRUE, FALSE
+),(
+    49, 'keyword', 'performers', 
+    oils_i18n_gettext(49, 'Performers', 'cmf', 'label'),
+    $$//mods33:note[@type='performers']$$,
+    TRUE, TRUE, FALSE
+),(
+    50, 'keyword', 'general_note', 
+    oils_i18n_gettext(50, 'General Note', 'cmf', 'label'),
+    $$//mods33:note[not(@type)]$$,
+    TRUE, TRUE, FALSE
+)
+;
+
+INSERT INTO config.metabib_field (id, field_class, name, format,
+    label, xpath, display_xpath, display_field, search_field, browse_field)
+VALUES (
+    51, 'author', 'first_author', 'mods32',
+    oils_i18n_gettext(51, 'Author', 'cmf', 'label'),
+    $$//mods32:mods/mods32:name[mods32:role/mods32:roleTerm[text()='creator']][1]$$,
+    $$//*[local-name()='namePart']$$,
+    TRUE, TRUE, FALSE
+);
+
+INSERT INTO config.metabib_field (id, field_class, name, format,
+    label, xpath, display_xpath, display_field, search_field, browse_field)
+VALUES (
+    52, 'identifier', 'origin_info', 'marcxml',
+    oils_i18n_gettext(52, 'Origin Info', 'cmf', 'label'),
+    $$//*[@tag='260']$$,
+    $$//*[local-name()='subfield' and contains('abc', at code)]$$,
+    TRUE, FALSE, FALSE
+);
+
+
+-- Modify existing config.metabib_field entries
+
+UPDATE config.metabib_field SET display_field = TRUE WHERE id IN (
+    1,  -- seriestitle
+    11, -- subject_geographic 
+    12, -- subject_name
+    13, -- subject_temporal
+    14, -- subject_topic
+    19, -- ISSN
+    20, -- UPC
+    26  -- TCN
+);
+
+-- Map display field names to config.metabib_field entries
+
+INSERT INTO config.display_field_map (name, field, multi) VALUES 
+    ('series_title',         1, TRUE),
+    ('subject_geographic',  11, TRUE),
+    ('subject_name',        12, TRUE),
+    ('subject_temporal',    13, TRUE),
+    ('subject_topic',       14, TRUE),
+    ('issn',                19, TRUE),
+    ('upc',                 20, TRUE),
+    ('tcn',                 26, FALSE),
+    ('edition',             38, FALSE),
+    ('physical_description',39, TRUE),
+    ('genre',               33, TRUE),
+    ('bibliography',        46, TRUE),
+    ('thesis',              47, TRUE),
+    ('performers',          49, TRUE),
+    ('production_credits',  48, TRUE),
+    ('general_note',        50, TRUE),
+    ('publisher',           52, FALSE),
+    ('abstract',            41, FALSE),
+    ('toc',                 42, FALSE),
+    ('type_of_resource',    43, FALSE),
+    ('pubdate',             44, FALSE)
+;
+
+UPDATE config.display_field_map SET field = 51 WHERE name = 'author';
+
+-- Add a column to wide-display-entry per well-known field
+
+DROP VIEW IF EXISTS metabib.wide_display_entry;
+CREATE VIEW metabib.wide_display_entry AS
+    SELECT 
+        bre.id AS source,
+        COALESCE(mcde_title.value, 'null')::TEXT AS title,
+        COALESCE(mcde_author.value, 'null')::TEXT AS author,
+        COALESCE(mcde_subject_geographic.value, 'null')::TEXT AS subject_geographic,
+        COALESCE(mcde_subject_name.value, 'null')::TEXT AS subject_name,
+        COALESCE(mcde_subject_temporal.value, 'null')::TEXT AS subject_temporal,
+        COALESCE(mcde_subject_topic.value, 'null')::TEXT AS subject_topic,
+        COALESCE(mcde_creators.value, 'null')::TEXT AS creators,
+        COALESCE(mcde_isbn.value, 'null')::TEXT AS isbn,
+        COALESCE(mcde_issn.value, 'null')::TEXT AS issn,
+        COALESCE(mcde_upc.value, 'null')::TEXT AS upc,
+        COALESCE(mcde_tcn.value, 'null')::TEXT AS tcn,
+        COALESCE(mcde_edition.value, 'null')::TEXT AS edition,
+        COALESCE(mcde_physical_description.value, 'null')::TEXT AS physical_description,
+        COALESCE(mcde_publisher.value, 'null')::TEXT AS publisher,
+        COALESCE(mcde_series_title.value, 'null')::TEXT AS series_title,
+        COALESCE(mcde_abstract.value, 'null')::TEXT AS abstract,
+        COALESCE(mcde_toc.value, 'null')::TEXT AS toc,
+        COALESCE(mcde_pubdate.value, 'null')::TEXT AS pubdate,
+        COALESCE(mcde_type_of_resource.value, 'null')::TEXT AS type_of_resource
+    FROM biblio.record_entry bre 
+    LEFT JOIN metabib.compressed_display_entry mcde_title 
+        ON (bre.id = mcde_title.source AND mcde_title.name = 'title')
+    LEFT JOIN metabib.compressed_display_entry mcde_author 
+        ON (bre.id = mcde_author.source AND mcde_author.name = 'author')
+    LEFT JOIN metabib.compressed_display_entry mcde_subject 
+        ON (bre.id = mcde_subject.source AND mcde_subject.name = 'subject')
+    LEFT JOIN metabib.compressed_display_entry mcde_subject_geographic 
+        ON (bre.id = mcde_subject_geographic.source 
+            AND mcde_subject_geographic.name = 'subject_geographic')
+    LEFT JOIN metabib.compressed_display_entry mcde_subject_name 
+        ON (bre.id = mcde_subject_name.source 
+            AND mcde_subject_name.name = 'subject_name')
+    LEFT JOIN metabib.compressed_display_entry mcde_subject_temporal 
+        ON (bre.id = mcde_subject_temporal.source 
+            AND mcde_subject_temporal.name = 'subject_temporal')
+    LEFT JOIN metabib.compressed_display_entry mcde_subject_topic 
+        ON (bre.id = mcde_subject_topic.source 
+            AND mcde_subject_topic.name = 'subject_topic')
+    LEFT JOIN metabib.compressed_display_entry mcde_creators 
+        ON (bre.id = mcde_creators.source AND mcde_creators.name = 'creators')
+    LEFT JOIN metabib.compressed_display_entry mcde_isbn 
+        ON (bre.id = mcde_isbn.source AND mcde_isbn.name = 'isbn')
+    LEFT JOIN metabib.compressed_display_entry mcde_issn 
+        ON (bre.id = mcde_issn.source AND mcde_issn.name = 'issn')
+    LEFT JOIN metabib.compressed_display_entry mcde_upc 
+        ON (bre.id = mcde_upc.source AND mcde_upc.name = 'upc')
+    LEFT JOIN metabib.compressed_display_entry mcde_tcn 
+        ON (bre.id = mcde_tcn.source AND mcde_tcn.name = 'tcn')
+    LEFT JOIN metabib.compressed_display_entry mcde_edition 
+        ON (bre.id = mcde_edition.source AND mcde_edition.name = 'edition')
+    LEFT JOIN metabib.compressed_display_entry mcde_physical_description 
+        ON (bre.id = mcde_physical_description.source 
+            AND mcde_physical_description.name = 'physical_description')
+    LEFT JOIN metabib.compressed_display_entry mcde_publisher 
+        ON (bre.id = mcde_publisher.source AND mcde_publisher.name = 'publisher')
+    LEFT JOIN metabib.compressed_display_entry mcde_series_title 
+        ON (bre.id = mcde_series_title.source AND mcde_series_title.name = 'series_title')
+    LEFT JOIN metabib.compressed_display_entry mcde_abstract 
+        ON (bre.id = mcde_abstract.source AND mcde_abstract.name = 'abstract')
+    LEFT JOIN metabib.compressed_display_entry mcde_toc 
+        ON (bre.id = mcde_toc.source AND mcde_toc.name = 'toc')
+    LEFT JOIN metabib.compressed_display_entry mcde_pubdate 
+        ON (bre.id = mcde_pubdate.source AND mcde_pubdate.name = 'pubdate')
+    LEFT JOIN metabib.compressed_display_entry mcde_type_of_resource 
+        ON (bre.id = mcde_type_of_resource.source 
+            AND mcde_type_of_resource.name = 'type_of_resource')
+;
+
+CREATE OR REPLACE VIEW reporter.old_super_simple_record AS
+SELECT  r.id,
+    r.fingerprint,
+    r.quality,
+    r.tcn_source,
+    r.tcn_value,
+    evergreen.oils_json_to_text(d.title) AS title,
+    evergreen.oils_json_to_text(d.author) AS author,
+    evergreen.oils_json_to_text(d.publisher) AS publisher,
+    evergreen.oils_json_to_text(d.pubdate) AS pubdate,
+    CASE WHEN d.isbn = 'null'
+        THEN NULL
+        ELSE (SELECT ARRAY(SELECT json_array_elements_text(d.isbn::JSON)))
+    END AS isbn,
+    CASE WHEN d.issn = 'null'
+        THEN NULL
+        ELSE (SELECT ARRAY(SELECT json_array_elements_text(d.issn::JSON)))
+    END AS issn
+  FROM  biblio.record_entry r
+        JOIN metabib.wide_display_entry d ON (r.id = d.source);
+
+
+
+SELECT evergreen.upgrade_deps_block_check('1101', :eg_version);
+
+ALTER TABLE config.metabib_field ALTER COLUMN xpath DROP NOT NULL;
+
+CREATE TABLE config.metabib_field_virtual_map (
+    id      SERIAL  PRIMARY KEY,
+    real    INT NOT NULL REFERENCES config.metabib_field (id),
+    virtual INT NOT NULL REFERENCES config.metabib_field (id),
+    weight  INT NOT NULL DEFAULT 1
+);
+COMMENT ON TABLE config.metabib_field_virtual_map IS $$
+Maps between real (physically extracted) index definitions
+and virtual (target sync, no required extraction of its own)
+index definitions.
+
+The virtual side may not extract any data of its own, but
+will collect data from all of the real fields.  This reduces
+extraction (ingest) overhead by eliminating duplcated extraction,
+and allows for searching across novel combinations of fields, such
+as names used as either subjects or authors.  By preserving this
+mapping rather than defining duplicate extractions, information
+about the originating, "real" index definitions can be used
+in interesting ways, such as highlighting in search results.
+$$;
+
+CREATE OR REPLACE VIEW metabib.combined_all_field_entry AS
+    SELECT * FROM metabib.combined_title_field_entry
+        UNION ALL
+    SELECT * FROM metabib.combined_author_field_entry
+        UNION ALL
+    SELECT * FROM metabib.combined_subject_field_entry
+        UNION ALL
+    SELECT * FROM metabib.combined_keyword_field_entry
+        UNION ALL
+    SELECT * FROM metabib.combined_identifier_field_entry
+        UNION ALL
+    SELECT * FROM metabib.combined_series_field_entry;
+
+
+CREATE OR REPLACE FUNCTION biblio.extract_metabib_field_entry (
+    rid BIGINT,
+    default_joiner TEXT,
+    field_types TEXT[],
+    only_fields INT[]
+) RETURNS SETOF metabib.field_entry_template AS $func$
+DECLARE
+    bib     biblio.record_entry%ROWTYPE;
+    idx     config.metabib_field%ROWTYPE;
+    xfrm        config.xml_transform%ROWTYPE;
+    prev_xfrm   TEXT;
+    transformed_xml TEXT;
+    xml_node    TEXT;
+    xml_node_list   TEXT[];
+    facet_text  TEXT;
+    display_text TEXT;
+    browse_text TEXT;
+    sort_value  TEXT;
+    raw_text    TEXT;
+    curr_text   TEXT;
+    joiner      TEXT := default_joiner; -- XXX will index defs supply a joiner?
+    authority_text TEXT;
+    authority_link BIGINT;
+    output_row  metabib.field_entry_template%ROWTYPE;
+    process_idx BOOL;
+BEGIN
+
+    -- Start out with no field-use bools set
+    output_row.browse_field = FALSE;
+    output_row.facet_field = FALSE;
+    output_row.display_field = FALSE;
+    output_row.search_field = FALSE;
+
+    -- Get the record
+    SELECT INTO bib * FROM biblio.record_entry WHERE id = rid;
+
+    -- Loop over the indexing entries
+    FOR idx IN SELECT * FROM config.metabib_field WHERE id = ANY (only_fields) ORDER BY format LOOP
+        CONTINUE WHEN idx.xpath IS NULL OR idx.xpath = ''; -- pure virtual field
+
+        process_idx := FALSE;
+        IF idx.display_field AND 'display' = ANY (field_types) THEN process_idx = TRUE; END IF;
+        IF idx.browse_field AND 'browse' = ANY (field_types) THEN process_idx = TRUE; END IF;
+        IF idx.search_field AND 'search' = ANY (field_types) THEN process_idx = TRUE; END IF;
+        IF idx.facet_field AND 'facet' = ANY (field_types) THEN process_idx = TRUE; END IF;
+        CONTINUE WHEN process_idx = FALSE; -- disabled for all types
+
+        joiner := COALESCE(idx.joiner, default_joiner);
+
+        SELECT INTO xfrm * from config.xml_transform WHERE name = idx.format;
+
+        -- See if we can skip the XSLT ... it's expensive
+        IF prev_xfrm IS NULL OR prev_xfrm <> xfrm.name THEN
+            -- Can't skip the transform
+            IF xfrm.xslt <> '---' THEN
+                transformed_xml := oils_xslt_process(bib.marc,xfrm.xslt);
+            ELSE
+                transformed_xml := bib.marc;
+            END IF;
+
+            prev_xfrm := xfrm.name;
+        END IF;
+
+        xml_node_list := oils_xpath( idx.xpath, transformed_xml, ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]] );
+
+        raw_text := NULL;
+        FOR xml_node IN SELECT x FROM unnest(xml_node_list) AS x LOOP
+            CONTINUE WHEN xml_node !~ E'^\\s*<';
+
+            -- XXX much of this should be moved into oils_xpath_string...
+            curr_text := ARRAY_TO_STRING(evergreen.array_remove_item_by_value(evergreen.array_remove_item_by_value(
+                oils_xpath( '//text()', -- get the content of all the nodes within the main selected node
+                    REGEXP_REPLACE( xml_node, E'\\s+', ' ', 'g' ) -- Translate adjacent whitespace to a single space
+                ), ' '), ''),  -- throw away morally empty (bankrupt?) strings
+                joiner
+            );
+
+            CONTINUE WHEN curr_text IS NULL OR curr_text = '';
+
+            IF raw_text IS NOT NULL THEN
+                raw_text := raw_text || joiner;
+            END IF;
+
+            raw_text := COALESCE(raw_text,'') || curr_text;
+
+            -- autosuggest/metabib.browse_entry
+            IF idx.browse_field THEN
+
+                IF idx.browse_xpath IS NOT NULL AND idx.browse_xpath <> '' THEN
+                    browse_text := oils_xpath_string( idx.browse_xpath, xml_node, joiner, ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]] );
+                ELSE
+                    browse_text := curr_text;
+                END IF;
+
+                IF idx.browse_sort_xpath IS NOT NULL AND
+                    idx.browse_sort_xpath <> '' THEN
+
+                    sort_value := oils_xpath_string(
+                        idx.browse_sort_xpath, xml_node, joiner,
+                        ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]]
+                    );
+                ELSE
+                    sort_value := browse_text;
+                END IF;
+
+                output_row.field_class = idx.field_class;
+                output_row.field = idx.id;
+                output_row.source = rid;
+                output_row.value = BTRIM(REGEXP_REPLACE(browse_text, E'\\s+', ' ', 'g'));
+                output_row.sort_value :=
+                    public.naco_normalize(sort_value);
+
+                output_row.authority := NULL;
+
+                IF idx.authority_xpath IS NOT NULL AND idx.authority_xpath <> '' THEN
+                    authority_text := oils_xpath_string(
+                        idx.authority_xpath, xml_node, joiner,
+                        ARRAY[
+                            ARRAY[xfrm.prefix, xfrm.namespace_uri],
+                            ARRAY['xlink','http://www.w3.org/1999/xlink']
+                        ]
+                    );
+
+                    IF authority_text ~ '^\d+$' THEN
+                        authority_link := authority_text::BIGINT;
+                        PERFORM * FROM authority.record_entry WHERE id = authority_link;
+                        IF FOUND THEN
+                            output_row.authority := authority_link;
+                        END IF;
+                    END IF;
+
+                END IF;
+
+                output_row.browse_field = TRUE;
+                -- Returning browse rows with search_field = true for search+browse
+                -- configs allows us to retain granularity of being able to search
+                -- browse fields with "starts with" type operators (for example, for
+                -- titles of songs in music albums)
+                IF idx.search_field THEN
+                    output_row.search_field = TRUE;
+                END IF;
+                RETURN NEXT output_row;
+                output_row.browse_field = FALSE;
+                output_row.search_field = FALSE;
+                output_row.sort_value := NULL;
+            END IF;
+
+            -- insert raw node text for faceting
+            IF idx.facet_field THEN
+
+                IF idx.facet_xpath IS NOT NULL AND idx.facet_xpath <> '' THEN
+                    facet_text := oils_xpath_string( idx.facet_xpath, xml_node, joiner, ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]] );
+                ELSE
+                    facet_text := curr_text;
+                END IF;
+
+                output_row.field_class = idx.field_class;
+                output_row.field = -1 * idx.id;
+                output_row.source = rid;
+                output_row.value = BTRIM(REGEXP_REPLACE(facet_text, E'\\s+', ' ', 'g'));
+
+                output_row.facet_field = TRUE;
+                RETURN NEXT output_row;
+                output_row.facet_field = FALSE;
+            END IF;
+
+            -- insert raw node text for display
+            IF idx.display_field THEN
+
+                IF idx.display_xpath IS NOT NULL AND idx.display_xpath <> '' THEN
+                    display_text := oils_xpath_string( idx.display_xpath, xml_node, joiner, ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]] );
+                ELSE
+                    display_text := curr_text;
+                END IF;
+
+                output_row.field_class = idx.field_class;
+                output_row.field = -1 * idx.id;
+                output_row.source = rid;
+                output_row.value = BTRIM(REGEXP_REPLACE(display_text, E'\\s+', ' ', 'g'));
+
+                output_row.display_field = TRUE;
+                RETURN NEXT output_row;
+                output_row.display_field = FALSE;
+            END IF;
+
+        END LOOP;
+
+        CONTINUE WHEN raw_text IS NULL OR raw_text = '';
+
+        -- insert combined node text for searching
+        IF idx.search_field THEN
+            output_row.field_class = idx.field_class;
+            output_row.field = idx.id;
+            output_row.source = rid;
+            output_row.value = BTRIM(REGEXP_REPLACE(raw_text, E'\\s+', ' ', 'g'));
+
+            output_row.search_field = TRUE;
+            RETURN NEXT output_row;
+            output_row.search_field = FALSE;
+        END IF;
+
+    END LOOP;
+
+END;
+$func$ LANGUAGE PLPGSQL;
+
+CREATE OR REPLACE FUNCTION metabib.update_combined_index_vectors(bib_id BIGINT) RETURNS VOID AS $func$
+DECLARE
+    rdata       TSVECTOR;
+    vclass      TEXT;
+    vfield      INT;
+    rfields     INT[];
+BEGIN
+    DELETE FROM metabib.combined_keyword_field_entry WHERE record = bib_id;
+    INSERT INTO metabib.combined_keyword_field_entry(record, metabib_field, index_vector)
+        SELECT bib_id, field, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+        FROM metabib.keyword_field_entry WHERE source = bib_id GROUP BY field;
+    INSERT INTO metabib.combined_keyword_field_entry(record, metabib_field, index_vector)
+        SELECT bib_id, NULL, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+        FROM metabib.keyword_field_entry WHERE source = bib_id;
+
+    DELETE FROM metabib.combined_title_field_entry WHERE record = bib_id;
+    INSERT INTO metabib.combined_title_field_entry(record, metabib_field, index_vector)
+        SELECT bib_id, field, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+        FROM metabib.title_field_entry WHERE source = bib_id GROUP BY field;
+    INSERT INTO metabib.combined_title_field_entry(record, metabib_field, index_vector)
+        SELECT bib_id, NULL, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+        FROM metabib.title_field_entry WHERE source = bib_id;
+
+    DELETE FROM metabib.combined_author_field_entry WHERE record = bib_id;
+    INSERT INTO metabib.combined_author_field_entry(record, metabib_field, index_vector)
+        SELECT bib_id, field, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+        FROM metabib.author_field_entry WHERE source = bib_id GROUP BY field;
+    INSERT INTO metabib.combined_author_field_entry(record, metabib_field, index_vector)
+        SELECT bib_id, NULL, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+        FROM metabib.author_field_entry WHERE source = bib_id;
+
+    DELETE FROM metabib.combined_subject_field_entry WHERE record = bib_id;
+    INSERT INTO metabib.combined_subject_field_entry(record, metabib_field, index_vector)
+        SELECT bib_id, field, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+        FROM metabib.subject_field_entry WHERE source = bib_id GROUP BY field;
+    INSERT INTO metabib.combined_subject_field_entry(record, metabib_field, index_vector)
+        SELECT bib_id, NULL, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+        FROM metabib.subject_field_entry WHERE source = bib_id;
+
+    DELETE FROM metabib.combined_series_field_entry WHERE record = bib_id;
+    INSERT INTO metabib.combined_series_field_entry(record, metabib_field, index_vector)
+        SELECT bib_id, field, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+        FROM metabib.series_field_entry WHERE source = bib_id GROUP BY field;
+    INSERT INTO metabib.combined_series_field_entry(record, metabib_field, index_vector)
+        SELECT bib_id, NULL, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+        FROM metabib.series_field_entry WHERE source = bib_id;
+
+    DELETE FROM metabib.combined_identifier_field_entry WHERE record = bib_id;
+    INSERT INTO metabib.combined_identifier_field_entry(record, metabib_field, index_vector)
+        SELECT bib_id, field, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+        FROM metabib.identifier_field_entry WHERE source = bib_id GROUP BY field;
+    INSERT INTO metabib.combined_identifier_field_entry(record, metabib_field, index_vector)
+        SELECT bib_id, NULL, strip(COALESCE(string_agg(index_vector::TEXT,' '),'')::tsvector)
+        FROM metabib.identifier_field_entry WHERE source = bib_id;
+
+    -- For each virtual def, gather the data from the combined real field
+    -- entries and append it to the virtual combined entry.
+    FOR vfield, rfields IN SELECT virtual, ARRAY_AGG(real)  FROM config.metabib_field_virtual_map GROUP BY virtual LOOP
+        SELECT  field_class INTO vclass
+          FROM  config.metabib_field
+          WHERE id = vfield;
+
+        SELECT  string_agg(index_vector::TEXT,' ')::tsvector INTO rdata
+          FROM  metabib.combined_all_field_entry
+          WHERE record = bib_id
+                AND metabib_field = ANY (rfields);
+
+        BEGIN -- I cannot wait for INSERT ON CONFLICT ... 9.5, though
+            EXECUTE $$
+                INSERT INTO metabib.combined_$$ || vclass || $$_field_entry
+                    (record, metabib_field, index_vector) VALUES ($1, $2, $3)
+            $$ USING bib_id, vfield, rdata;
+        EXCEPTION WHEN unique_violation THEN
+            EXECUTE $$
+                UPDATE  metabib.combined_$$ || vclass || $$_field_entry
+                  SET   index_vector = index_vector || $3
+                  WHERE record = $1
+                        AND metabib_field = $2
+            $$ USING bib_id, vfield, rdata;
+        WHEN OTHERS THEN
+            -- ignore and move on
+        END;
+    END LOOP;
+END;
+$func$ LANGUAGE PLPGSQL;
+
+CREATE OR REPLACE VIEW search.best_tsconfig AS
+    SELECT  m.id AS id,
+            COALESCE(f.ts_config, c.ts_config, 'simple') AS ts_config
+      FROM  config.metabib_field m
+            LEFT JOIN config.metabib_class_ts_map c ON (c.field_class = m.field_class AND c.index_weight = 'C')
+            LEFT JOIN config.metabib_field_ts_map f ON (f.metabib_field = m.id AND f.index_weight = 'C');
+
+CREATE TYPE search.highlight_result AS ( id BIGINT, source BIGINT, field INT, value TEXT, highlight TEXT );
+
+CREATE OR REPLACE FUNCTION search.highlight_display_fields_impl(
+    rid         BIGINT,
+    tsq         TEXT,
+    field_list  INT[] DEFAULT '{}'::INT[],
+    css_class   TEXT DEFAULT 'oils_SH',
+    hl_all      BOOL DEFAULT TRUE,
+    minwords    INT DEFAULT 5,
+    maxwords    INT DEFAULT 25,
+    shortwords  INT DEFAULT 0,
+    maxfrags    INT DEFAULT 0,
+    delimiter   TEXT DEFAULT ' ... '
+) RETURNS SETOF search.highlight_result AS $f$
+DECLARE
+    opts            TEXT := '';
+    v_css_class     TEXT := css_class;
+    v_delimiter     TEXT := delimiter;
+    v_field_list    INT[] := field_list;
+    hl_query        TEXT;
+BEGIN
+    IF v_delimiter LIKE $$%'%$$ OR v_delimiter LIKE '%"%' THEN --"
+        v_delimiter := ' ... ';
+    END IF;
+
+    IF NOT hl_all THEN
+        opts := opts || 'MinWords=' || minwords;
+        opts := opts || ', MaxWords=' || maxwords;
+        opts := opts || ', ShortWords=' || shortwords;
+        opts := opts || ', MaxFragments=' || maxfrags;
+        opts := opts || ', FragmentDelimiter="' || delimiter || '"';
+    ELSE
+        opts := opts || 'HighlightAll=TRUE';
+    END IF;
+
+    IF v_css_class LIKE $$%'%$$ OR v_css_class LIKE '%"%' THEN -- "
+        v_css_class := 'oils_SH';
+    END IF;
+
+    opts := opts || $$, StopSel=</b>, StartSel="<b class='$$ || v_css_class; -- "
+
+    IF v_field_list = '{}'::INT[] THEN
+        SELECT ARRAY_AGG(id) INTO v_field_list FROM config.metabib_field WHERE display_field;
+    END IF;
+
+    hl_query := $$
+        SELECT  de.id,
+                de.source,
+                de.field,
+                de.value AS value,
+                ts_headline(
+                    ts_config::REGCONFIG,
+                    evergreen.escape_for_html(de.value),
+                    $$ || quote_literal(tsq) || $$,
+                    $1 || ' ' || mf.field_class || ' ' || mf.name || $xx$'>"$xx$ -- "'
+                ) AS highlight
+          FROM  metabib.display_entry de
+                JOIN config.metabib_field mf ON (mf.id = de.field)
+                JOIN search.best_tsconfig t ON (t.id = de.field)
+          WHERE de.source = $2
+                AND field = ANY ($3)
+          ORDER BY de.id;$$;
+
+    RETURN QUERY EXECUTE hl_query USING opts, rid, v_field_list;
+END;
+$f$ LANGUAGE PLPGSQL;
+
+CREATE OR REPLACE FUNCTION evergreen.escape_for_html (TEXT) RETURNS TEXT AS $$
+    SELECT  regexp_replace(
+                regexp_replace(
+                    regexp_replace(
+                        $1,
+                        '&',
+                        '&',
+                        'g'
+                    ),
+                    '<',
+                    '<',
+                    'g'
+                ),
+                '>',
+                '>',
+                'g'
+            );
+$$ LANGUAGE SQL IMMUTABLE LEAKPROOF STRICT COST 10;
+
+CREATE OR REPLACE FUNCTION search.highlight_display_fields(
+    rid         BIGINT,
+    tsq_map     TEXT, -- { '(a | b) & c' => '1,2,3,4', ...}
+    css_class   TEXT DEFAULT 'oils_SH',
+    hl_all      BOOL DEFAULT TRUE,
+    minwords    INT DEFAULT 5,
+    maxwords    INT DEFAULT 25,
+    shortwords  INT DEFAULT 0,
+    maxfrags    INT DEFAULT 0,
+    delimiter   TEXT DEFAULT ' ... '
+) RETURNS SETOF search.highlight_result AS $f$
+DECLARE
+    tsq_hstore  HSTORE;
+    tsq         TEXT;
+    fields      TEXT;
+    afields     INT[];
+    seen        INT[];
+BEGIN
+
+    IF (tsq_map ILIKE 'hstore%') THEN
+        EXECUTE 'SELECT ' || tsq_map INTO tsq_hstore;
+    ELSE
+        tsq_hstore := tsq_map::HSTORE;
+    END IF;
+    
+    FOR tsq, fields IN SELECT key, value FROM each(tsq_hstore::HSTORE) LOOP
+        SELECT  ARRAY_AGG(unnest::INT) INTO afields
+          FROM  unnest(regexp_split_to_array(fields,','));
+        seen := seen || afields;
+
+        RETURN QUERY
+            SELECT * FROM search.highlight_display_fields_impl(
+                rid, tsq, afields, css_class, hl_all,minwords,
+                maxwords, shortwords, maxfrags, delimiter
+            );
+    END LOOP;
+
+    RETURN QUERY
+        SELECT  id,
+                source,
+                field,
+                value,
+                value AS highlight
+          FROM  metabib.display_entry
+          WHERE source = rid
+                AND NOT (field = ANY (seen));
+END;
+$f$ LANGUAGE PLPGSQL ROWS 10;
+ 
+CREATE OR REPLACE FUNCTION metabib.remap_metarecord_for_bib(
+    bib_id bigint,
+    fp text,
+    bib_is_deleted boolean DEFAULT false,
+    retain_deleted boolean DEFAULT false
+) RETURNS bigint AS $function$
+DECLARE
+    new_mapping     BOOL := TRUE;
+    source_count    INT;
+    old_mr          BIGINT;
+    tmp_mr          metabib.metarecord%ROWTYPE;
+    deleted_mrs     BIGINT[];
+BEGIN
+
+    -- We need to make sure we're not a deleted master record of an MR
+    IF bib_is_deleted THEN
+        IF NOT retain_deleted THEN -- Go away for any MR that we're master of, unless retained
+            DELETE FROM metabib.metarecord_source_map WHERE source = bib_id;
+        END IF;
+
+        FOR old_mr IN SELECT id FROM metabib.metarecord WHERE master_record = bib_id LOOP
+
+            -- Now, are there any more sources on this MR?
+            SELECT COUNT(*) INTO source_count FROM metabib.metarecord_source_map WHERE metarecord = old_mr;
+
+            IF source_count = 0 AND NOT retain_deleted THEN -- No other records
+                deleted_mrs := ARRAY_APPEND(deleted_mrs, old_mr); -- Just in case...
+                DELETE FROM metabib.metarecord WHERE id = old_mr;
+
+            ELSE -- indeed there are. Update it with a null cache and recalcualated master record
+                UPDATE  metabib.metarecord
+                  SET   mods = NULL,
+                        master_record = ( SELECT id FROM biblio.record_entry WHERE fingerprint = fp AND NOT deleted ORDER BY quality DESC LIMIT 1)
+                  WHERE id = old_mr;
+            END IF;
+        END LOOP;
+
+    ELSE -- insert or update
+
+        FOR tmp_mr IN SELECT m.* FROM metabib.metarecord m JOIN metabib.metarecord_source_map s ON (s.metarecord = m.id) WHERE s.source = bib_id LOOP
+
+            -- Find the first fingerprint-matching
+            IF old_mr IS NULL AND fp = tmp_mr.fingerprint THEN
+                old_mr := tmp_mr.id;
+                new_mapping := FALSE;
+
+            ELSE -- Our fingerprint changed ... maybe remove the old MR
+                DELETE FROM metabib.metarecord_source_map WHERE metarecord = tmp_mr.id AND source = bib_id; -- remove the old source mapping
+                SELECT COUNT(*) INTO source_count FROM metabib.metarecord_source_map WHERE metarecord = tmp_mr.id;
+                IF source_count = 0 THEN -- No other records
+                    deleted_mrs := ARRAY_APPEND(deleted_mrs, tmp_mr.id);
+                    DELETE FROM metabib.metarecord WHERE id = tmp_mr.id;
+                END IF;
+            END IF;
+
+        END LOOP;
+
+        -- we found no suitable, preexisting MR based on old source maps
+        IF old_mr IS NULL THEN
+            SELECT id INTO old_mr FROM metabib.metarecord WHERE fingerprint = fp; -- is there one for our current fingerprint?
+
+            IF old_mr IS NULL THEN -- nope, create one and grab its id
+                INSERT INTO metabib.metarecord ( fingerprint, master_record ) VALUES ( fp, bib_id );
+                SELECT id INTO old_mr FROM metabib.metarecord WHERE fingerprint = fp;
+
+            ELSE -- indeed there is. update it with a null cache and recalcualated master record
+                UPDATE  metabib.metarecord
+                  SET   mods = NULL,
+                        master_record = ( SELECT id FROM biblio.record_entry WHERE fingerprint = fp AND NOT deleted ORDER BY quality DESC LIMIT 1)
+                  WHERE id = old_mr;
+            END IF;
+
+        ELSE -- there was one we already attached to, update its mods cache and master_record
+            UPDATE  metabib.metarecord
+              SET   mods = NULL,
+                    master_record = ( SELECT id FROM biblio.record_entry WHERE fingerprint = fp AND NOT deleted ORDER BY quality DESC LIMIT 1)
+              WHERE id = old_mr;
+        END IF;
+
+        IF new_mapping THEN
+            INSERT INTO metabib.metarecord_source_map (metarecord, source) VALUES (old_mr, bib_id); -- new source mapping
+        END IF;
+
+    END IF;
+
+    IF ARRAY_UPPER(deleted_mrs,1) > 0 THEN
+        UPDATE action.hold_request SET target = old_mr WHERE target IN ( SELECT unnest(deleted_mrs) ) AND hold_type = 'M'; -- if we had to delete any MRs above, make sure their holds are moved
+    END IF;
+
+    RETURN old_mr;
+
+END;
+$function$ LANGUAGE plpgsql;
+
+CREATE OR REPLACE FUNCTION evergreen.marc_to (marc text, xfrm text) RETURNS TEXT AS $$
+    SELECT evergreen.xml_pretty_print(xslt_process($1,xslt)::XML)::TEXT FROM config.xml_transform WHERE name = $2;
+$$ LANGUAGE SQL;
+
+
+
+SELECT evergreen.upgrade_deps_block_check('1102', :eg_version);
+
+update config.xml_transform set xslt = $XXXX$<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns="http://www.loc.gov/mods/v3" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xlink marc" version="1.0">
+        <xsl:output encoding="UTF-8" indent="yes" method="xml"/>
+<!--
+Revision 1.14 - Fixed template isValid and fields 010, 020, 022, 024, 028, and 037 to output additional identifier elements
+  with corresponding @type and @invalid eq 'yes' when subfields z or y (in the case of 022) exist in the MARCXML ::: 2007/01/04 17:35:20 cred
+
+Revision 1.13 - Changed order of output under cartographics to reflect schema  2006/11/28 tmee
+
+Revision 1.12 - Updated to reflect MODS 3.2 Mapping  2006/10/11 tmee
+
+Revision 1.11 - The attribute objectPart moved from <languageTerm> to <language>
+      2006/04/08  jrad
+
+Revision 1.10 MODS 3.1 revisions to language and classification elements
+                                (plus ability to find marc:collection embedded in wrapper elements such as SRU zs: wrappers)
+                                2006/02/06  ggar
+
+Revision 1.9 subfield $y was added to field 242 2004/09/02 10:57 jrad
+
+Revision 1.8 Subject chopPunctuation expanded and attribute fixes 2004/08/12 jrad
+
+Revision 1.7 2004/03/25 08:29 jrad
+
+Revision 1.6 various validation fixes 2004/02/20 ntra
+
+Revision 1.5  2003/10/02 16:18:58  ntra
+MODS2 to MODS3 updates, language unstacking and
+de-duping, chopPunctuation expanded
+
+Revision 1.3  2003/04/03 00:07:19  ntra
+Revision 1.3 Additional Changes not related to MODS Version 2.0 by ntra
+
+Revision 1.2  2003/03/24 19:37:42  ckeith
+Added Log Comment
+
+-->
+        <xsl:template match="/">
+                <xsl:choose>
+                        <xsl:when test="//marc:collection">
+                                <modsCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-2.xsd">
+                                        <xsl:for-each select="//marc:collection/marc:record">
+                                                <mods version="3.2">
+                                                        <xsl:call-template name="marcRecord"/>
+                                                </mods>
+                                        </xsl:for-each>
+                                </modsCollection>
+                        </xsl:when>
+                        <xsl:otherwise>
+                                <mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.2" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-2.xsd">
+                                        <xsl:for-each select="//marc:record">
+                                                <xsl:call-template name="marcRecord"/>
+                                        </xsl:for-each>
+                                </mods>
+                        </xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+        <xsl:template name="marcRecord">
+                <xsl:variable name="leader" select="marc:leader"/>
+                <xsl:variable name="leader6" select="substring($leader,7,1)"/>
+                <xsl:variable name="leader7" select="substring($leader,8,1)"/>
+                <xsl:variable name="controlField008" select="marc:controlfield[@tag='008']"/>
+                <xsl:variable name="typeOf008">
+                        <xsl:choose>
+                                <xsl:when test="$leader6='a'">
+                                        <xsl:choose>
+                                                <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
+                                                <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">SE</xsl:when>
+                                        </xsl:choose>
+                                </xsl:when>
+                                <xsl:when test="$leader6='t'">BK</xsl:when>
+                                <xsl:when test="$leader6='p'">MM</xsl:when>
+                                <xsl:when test="$leader6='m'">CF</xsl:when>
+                                <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
+                                <xsl:when test="$leader6='g' or $leader6='k' or $leader6='o' or $leader6='r'">VM</xsl:when>
+                                <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">MU</xsl:when>
+                        </xsl:choose>
+                </xsl:variable>
+                <xsl:for-each select="marc:datafield[@tag='245']">
+                        <titleInfo>
+                                <xsl:variable name="title">
+                                        <xsl:choose>
+                                                <xsl:when test="marc:subfield[@code='b']">
+                                                        <xsl:call-template name="specialSubfieldSelect">
+                                                                <xsl:with-param name="axis">b</xsl:with-param>
+                                                                <xsl:with-param name="beforeCodes">afgk</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:when>
+                                                <xsl:otherwise>
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">abfgk</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:otherwise>
+                                        </xsl:choose>
+                                </xsl:variable>
+                                <xsl:variable name="titleChop">
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="$title"/>
+                                                </xsl:with-param>
+                                                <xsl:with-param name="punctuation">
+                                                    <xsl:text>,;/ </xsl:text>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </xsl:variable>
+                                <xsl:choose>
+                                        <xsl:when test="@ind2>0">
+                                                <nonSort>
+                                                        <xsl:value-of select="substring($titleChop,1, at ind2)"/>
+                                                </nonSort>
+                                                <title>
+                                                        <xsl:value-of select="substring($titleChop, at ind2+1)"/>
+                                                </title>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <title>
+                                                        <xsl:value-of select="$titleChop"/>
+                                                </title>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                                <xsl:if test="marc:subfield[@code='b']">
+                                        <subTitle>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="axis">b</xsl:with-param>
+                                                                        <xsl:with-param name="anyCodes">b</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">afgk</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </subTitle>
+                                </xsl:if>
+                                <xsl:call-template name="part"></xsl:call-template>
+                        </titleInfo>
+                        <!-- A form of title that ignores non-filing characters; useful
+                                 for not converting "L'Oreal" into "L' Oreal" at index time -->
+                        <titleNonfiling>
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">abfgk</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:call-template name="part"></xsl:call-template>
+                        </titleNonfiling>
+                        <!-- hybrid of titleInfo and titleNonfiling which will give us a preformatted string (for punctuation)
+                                 but also keep the nonSort stuff in a separate field (for sorting) -->
+                        <titleBrowse>
+                                <xsl:variable name="titleBrowseChop">
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">abfgk</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </xsl:variable>
+                                <xsl:choose>
+                                        <xsl:when test="@ind2>0">
+                                                <nonSort>
+                                                        <xsl:value-of select="substring($titleBrowseChop,1, at ind2)"/>
+                                                </nonSort>
+                                                <title>
+                                                        <xsl:value-of select="substring($titleBrowseChop, at ind2+1)"/>
+                                                </title>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <title>
+                                                        <xsl:value-of select="$titleBrowseChop"/>
+                                                </title>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                                <xsl:call-template name="part"></xsl:call-template>
+                        </titleBrowse>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='210']">
+                        <titleInfo type="abbreviated">
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">a</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:call-template name="subtitle"/>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='242']">
+                        <xsl:variable name="titleChop">
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <!-- 1/04 removed $h, b -->
+                                                        <xsl:with-param name="codes">a</xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </xsl:variable>
+                        <titleInfo type="translated">
+                                <!--09/01/04 Added subfield $y-->
+                                <xsl:for-each select="marc:subfield[@code='y']">
+                                        <xsl:attribute name="lang">
+                                                <xsl:value-of select="text()"/>
+                                        </xsl:attribute>
+                                </xsl:for-each>
+                                <title>
+                                        <xsl:value-of select="$titleChop" />
+                                </title>
+                                <!-- 1/04 fix -->
+                                <xsl:call-template name="subtitle"/>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                        <titleInfo type="translated-nfi">
+                                <xsl:for-each select="marc:subfield[@code='y']">
+                                        <xsl:attribute name="lang">
+                                                <xsl:value-of select="text()"/>
+                                        </xsl:attribute>
+                                </xsl:for-each>
+                                <xsl:choose>
+                                        <xsl:when test="@ind2>0">
+                                                <nonSort>
+                                                        <xsl:value-of select="substring($titleChop,1, at ind2)"/>
+                                                </nonSort>
+                                                <title>
+                                                        <xsl:value-of select="substring($titleChop, at ind2+1)"/>
+                                                </title>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <title>
+                                                        <xsl:value-of select="$titleChop" />
+                                                </title>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                                <xsl:call-template name="subtitle"/>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='246']">
+                        <titleInfo type="alternative">
+                                <xsl:for-each select="marc:subfield[@code='i']">
+                                        <xsl:attribute name="displayLabel">
+                                                <xsl:value-of select="text()"/>
+                                        </xsl:attribute>
+                                </xsl:for-each>
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <!-- 1/04 removed $h, $b -->
+                                                                <xsl:with-param name="codes">af</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:call-template name="subtitle"/>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='130']|marc:datafield[@tag='240']|marc:datafield[@tag='730'][@ind2!='2']">
+                        <xsl:variable name="nfi">
+                                <xsl:choose>
+                                        <xsl:when test="@tag='240'">
+                                                <xsl:value-of select="@ind2"/>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <xsl:value-of select="@ind1"/>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                        </xsl:variable>
+                        <xsl:variable name="titleChop">
+                                <xsl:call-template name="uri" />
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield">
+                                                <xsl:if test="(contains('adfklmor', at code) and (not(../marc:subfield[@code='n' or @code='p']) or (following-sibling::marc:subfield[@code='n' or @code='p'])))">
+                                                        <xsl:value-of select="text()"/>
+                                                        <xsl:text> </xsl:text>
+                                                </xsl:if>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </xsl:variable>
+                        <titleInfo type="uniform">
+                                <title>
+                                        <xsl:value-of select="$titleChop"/>
+                                </title>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                        <titleInfo type="uniform-nfi">
+                                <xsl:choose>
+                                        <xsl:when test="$nfi>0">
+                                                <nonSort>
+                                                        <xsl:value-of select="substring($titleChop,1,$nfi)"/>
+                                                </nonSort>
+                                                <title>
+                                                        <xsl:value-of select="substring($titleChop,$nfi+1)"/>
+                                                </title>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <title>
+                                                        <xsl:value-of select="$titleChop"/>
+                                                </title>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='740'][@ind2!='2']">
+                        <xsl:variable name="titleChop">
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">ah</xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </xsl:variable>
+                        <titleInfo type="alternative">
+                                <title>
+                                        <xsl:value-of select="$titleChop" />
+                                </title>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                        <titleInfo type="alternative-nfi">
+                                <xsl:choose>
+                                        <xsl:when test="@ind1>0">
+                                                <nonSort>
+                                                        <xsl:value-of select="substring($titleChop,1, at ind1)"/>
+                                                </nonSort>
+                                                <title>
+                                                        <xsl:value-of select="substring($titleChop, at ind1+1)"/>
+                                                </title>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <title>
+                                                        <xsl:value-of select="$titleChop" />
+                                                </title>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='100']">
+                        <name type="personal">
+                                <xsl:call-template name="uri" />
+                                <xsl:call-template name="nameABCDQ"/>
+                                <xsl:call-template name="affiliation"/>
+                                <role>
+                                        <roleTerm authority="marcrelator" type="text">creator</roleTerm>
+                                </role>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='110']">
+                        <name type="corporate">
+                                <xsl:call-template name="uri" />
+                                <xsl:call-template name="nameABCDN"/>
+                                <role>
+                                        <roleTerm authority="marcrelator" type="text">creator</roleTerm>
+                                </role>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='111']">
+                        <name type="conference">
+                                <xsl:call-template name="uri" />
+                                <xsl:call-template name="nameACDEQ"/>
+                                <role>
+                                        <roleTerm authority="marcrelator" type="text">creator</roleTerm>
+                                </role>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='700'][not(marc:subfield[@code='t'])]">
+                        <name type="personal">
+                                <xsl:call-template name="uri" />
+                                <xsl:call-template name="nameABCDQ"/>
+                                <xsl:call-template name="affiliation"/>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='710'][not(marc:subfield[@code='t'])]">
+                        <name type="corporate">
+                                <xsl:call-template name="uri" />
+                                <xsl:call-template name="nameABCDN"/>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='711'][not(marc:subfield[@code='t'])]">
+                        <name type="conference">
+                                <xsl:call-template name="uri" />
+                                <xsl:call-template name="nameACDEQ"/>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='720'][not(marc:subfield[@code='t'])]">
+                        <name>
+                                <xsl:if test="@ind1=1">
+                                        <xsl:attribute name="type">
+                                                <xsl:text>personal</xsl:text>
+                                        </xsl:attribute>
+                                </xsl:if>
+                                <namePart>
+                                        <xsl:value-of select="marc:subfield[@code='a']"/>
+                                </namePart>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <typeOfResource>
+                        <xsl:if test="$leader7='c'">
+                                <xsl:attribute name="collection">yes</xsl:attribute>
+                        </xsl:if>
+                        <xsl:if test="$leader6='d' or $leader6='f' or $leader6='p' or $leader6='t'">
+                                <xsl:attribute name="manuscript">yes</xsl:attribute>
+                        </xsl:if>
+                        <xsl:choose>
+                                <xsl:when test="$leader6='a' or $leader6='t'">text</xsl:when>
+                                <xsl:when test="$leader6='e' or $leader6='f'">cartographic</xsl:when>
+                                <xsl:when test="$leader6='c' or $leader6='d'">notated music</xsl:when>
+                                <xsl:when test="$leader6='i'">sound recording-nonmusical</xsl:when>
+                                <xsl:when test="$leader6='j'">sound recording-musical</xsl:when>
+                                <xsl:when test="$leader6='k'">still image</xsl:when>
+                                <xsl:when test="$leader6='g'">moving image</xsl:when>
+                                <xsl:when test="$leader6='r'">three dimensional object</xsl:when>
+                                <xsl:when test="$leader6='m'">software, multimedia</xsl:when>
+                                <xsl:when test="$leader6='p'">mixed material</xsl:when>
+                        </xsl:choose>
+                </typeOfResource>
+                <xsl:if test="substring($controlField008,26,1)='d'">
+                        <genre authority="marc">globe</genre>
+                </xsl:if>
+                <xsl:if test="marc:controlfield[@tag='007'][substring(text(),1,1)='a'][substring(text(),2,1)='r']">
+                        <genre authority="marc">remote sensing image</genre>
+                </xsl:if>
+                <xsl:if test="$typeOf008='MP'">
+                        <xsl:variable name="controlField008-25" select="substring($controlField008,26,1)"></xsl:variable>
+                        <xsl:choose>
+                                <xsl:when test="$controlField008-25='a' or $controlField008-25='b' or $controlField008-25='c' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='j']">
+                                        <genre authority="marc">map</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-25='e' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='d']">
+                                        <genre authority="marc">atlas</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:if test="$typeOf008='SE'">
+                        <xsl:variable name="controlField008-21" select="substring($controlField008,22,1)"></xsl:variable>
+                        <xsl:choose>
+                                <xsl:when test="$controlField008-21='d'">
+                                        <genre authority="marc">database</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-21='l'">
+                                        <genre authority="marc">loose-leaf</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-21='m'">
+                                        <genre authority="marc">series</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-21='n'">
+                                        <genre authority="marc">newspaper</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-21='p'">
+                                        <genre authority="marc">periodical</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-21='w'">
+                                        <genre authority="marc">web site</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:if test="$typeOf008='BK' or $typeOf008='SE'">
+                        <xsl:variable name="controlField008-24" select="substring($controlField008,25,4)"></xsl:variable>
+                        <xsl:choose>
+                                <xsl:when test="contains($controlField008-24,'a')">
+                                        <genre authority="marc">abstract or summary</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'b')">
+                                        <genre authority="marc">bibliography</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'c')">
+                                        <genre authority="marc">catalog</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'d')">
+                                        <genre authority="marc">dictionary</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'e')">
+                                        <genre authority="marc">encyclopedia</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'f')">
+                                        <genre authority="marc">handbook</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'g')">
+                                        <genre authority="marc">legal article</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'i')">
+                                        <genre authority="marc">index</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'k')">
+                                        <genre authority="marc">discography</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'l')">
+                                        <genre authority="marc">legislation</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'m')">
+                                        <genre authority="marc">theses</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'n')">
+                                        <genre authority="marc">survey of literature</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'o')">
+                                        <genre authority="marc">review</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'p')">
+                                        <genre authority="marc">programmed text</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'q')">
+                                        <genre authority="marc">filmography</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'r')">
+                                        <genre authority="marc">directory</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'s')">
+                                        <genre authority="marc">statistics</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'t')">
+                                        <genre authority="marc">technical report</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'v')">
+                                        <genre authority="marc">legal case and case notes</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'w')">
+                                        <genre authority="marc">law report or digest</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'z')">
+                                        <genre authority="marc">treaty</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                        <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"></xsl:variable>
+                        <xsl:choose>
+                                <xsl:when test="$controlField008-29='1'">
+                                        <genre authority="marc">conference publication</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:if test="$typeOf008='CF'">
+                        <xsl:variable name="controlField008-26" select="substring($controlField008,27,1)"></xsl:variable>
+                        <xsl:choose>
+                                <xsl:when test="$controlField008-26='a'">
+                                        <genre authority="marc">numeric data</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-26='e'">
+                                        <genre authority="marc">database</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-26='f'">
+                                        <genre authority="marc">font</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-26='g'">
+                                        <genre authority="marc">game</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:if test="$typeOf008='BK'">
+                        <xsl:if test="substring($controlField008,25,1)='j'">
+                                <genre authority="marc">patent</genre>
+                        </xsl:if>
+                        <xsl:if test="substring($controlField008,31,1)='1'">
+                                <genre authority="marc">festschrift</genre>
+                        </xsl:if>
+                        <xsl:variable name="controlField008-34" select="substring($controlField008,35,1)"></xsl:variable>
+                        <xsl:if test="$controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'">
+                                <genre authority="marc">biography</genre>
+                        </xsl:if>
+                        <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"></xsl:variable>
+                        <xsl:choose>
+                                <xsl:when test="$controlField008-33='e'">
+                                        <genre authority="marc">essay</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='d'">
+                                        <genre authority="marc">drama</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='c'">
+                                        <genre authority="marc">comic strip</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='l'">
+                                        <genre authority="marc">fiction</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='h'">
+                                        <genre authority="marc">humor, satire</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='i'">
+                                        <genre authority="marc">letter</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='f'">
+                                        <genre authority="marc">novel</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='j'">
+                                        <genre authority="marc">short story</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='s'">
+                                        <genre authority="marc">speech</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:if test="$typeOf008='MU'">
+                        <xsl:variable name="controlField008-30-31" select="substring($controlField008,31,2)"></xsl:variable>
+                        <xsl:if test="contains($controlField008-30-31,'b')">
+                                <genre authority="marc">biography</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'c')">
+                                <genre authority="marc">conference publication</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'d')">
+                                <genre authority="marc">drama</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'e')">
+                                <genre authority="marc">essay</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'f')">
+                                <genre authority="marc">fiction</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'o')">
+                                <genre authority="marc">folktale</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'h')">
+                                <genre authority="marc">history</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'k')">
+                                <genre authority="marc">humor, satire</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'m')">
+                                <genre authority="marc">memoir</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'p')">
+                                <genre authority="marc">poetry</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'r')">
+                                <genre authority="marc">rehearsal</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'g')">
+                                <genre authority="marc">reporting</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'s')">
+                                <genre authority="marc">sound</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'l')">
+                                <genre authority="marc">speech</genre>
+                        </xsl:if>
+                </xsl:if>
+                <xsl:if test="$typeOf008='VM'">
+                        <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"></xsl:variable>
+                        <xsl:choose>
+                                <xsl:when test="$controlField008-33='a'">
+                                        <genre authority="marc">art original</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='b'">
+                                        <genre authority="marc">kit</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='c'">
+                                        <genre authority="marc">art reproduction</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='d'">
+                                        <genre authority="marc">diorama</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='f'">
+                                        <genre authority="marc">filmstrip</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='g'">
+                                        <genre authority="marc">legal article</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='i'">
+                                        <genre authority="marc">picture</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='k'">
+                                        <genre authority="marc">graphic</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='l'">
+                                        <genre authority="marc">technical drawing</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='m'">
+                                        <genre authority="marc">motion picture</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='n'">
+                                        <genre authority="marc">chart</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='o'">
+                                        <genre authority="marc">flash card</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='p'">
+                                        <genre authority="marc">microscope slide</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='q' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
+                                        <genre authority="marc">model</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='r'">
+                                        <genre authority="marc">realia</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='s'">
+                                        <genre authority="marc">slide</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='t'">
+                                        <genre authority="marc">transparency</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='v'">
+                                        <genre authority="marc">videorecording</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='w'">
+                                        <genre authority="marc">toy</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:for-each select="marc:datafield[@tag=655]">
+                        <genre authority="marc">
+                                <xsl:attribute name="authority">
+                                        <xsl:value-of select="marc:subfield[@code='2']"/>
+                                </xsl:attribute>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">abvxyz</xsl:with-param>
+                                        <xsl:with-param name="delimeter">-</xsl:with-param>
+                                </xsl:call-template>
+                        </genre>
+                </xsl:for-each>
+                <originInfo>
+                        <xsl:variable name="MARCpublicationCode" select="normalize-space(substring($controlField008,16,3))"></xsl:variable>
+                        <xsl:if test="translate($MARCpublicationCode,'|','')">
+                                <place>
+                                        <placeTerm>
+                                                <xsl:attribute name="type">code</xsl:attribute>
+                                                <xsl:attribute name="authority">marccountry</xsl:attribute>
+                                                <xsl:value-of select="$MARCpublicationCode"/>
+                                        </placeTerm>
+                                </place>
+                        </xsl:if>
+                        <xsl:for-each select="marc:datafield[@tag=044]/marc:subfield[@code='c']">
+                                <place>
+                                        <placeTerm>
+                                                <xsl:attribute name="type">code</xsl:attribute>
+                                                <xsl:attribute name="authority">iso3166</xsl:attribute>
+                                                <xsl:value-of select="."/>
+                                        </placeTerm>
+                                </place>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=260]/marc:subfield[@code='a']">
+                                <place>
+                                        <placeTerm>
+                                                <xsl:attribute name="type">text</xsl:attribute>
+                                                <xsl:call-template name="chopPunctuationFront">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="chopPunctuation">
+                                                                        <xsl:with-param name="chopString" select="."/>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </placeTerm>
+                                </place>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='m']">
+                                <dateValid point="start">
+                                        <xsl:value-of select="."/>
+                                </dateValid>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='n']">
+                                <dateValid point="end">
+                                        <xsl:value-of select="."/>
+                                </dateValid>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='j']">
+                                <dateModified>
+                                        <xsl:value-of select="."/>
+                                </dateModified>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=260]/marc:subfield[@code='b' or @code='c' or @code='g']">
+                                <xsl:choose>
+                                        <xsl:when test="@code='b'">
+                                                <publisher>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."/>
+                                                                <xsl:with-param name="punctuation">
+                                                                        <xsl:text>:,;/ </xsl:text>
+                                                                </xsl:with-param>
+                                                        </xsl:call-template>
+                                                </publisher>
+                                        </xsl:when>
+                                        <xsl:when test="@code='c'">
+                                                <dateIssued>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."/>
+                                                        </xsl:call-template>
+                                                </dateIssued>
+                                        </xsl:when>
+                                        <xsl:when test="@code='g'">
+                                                <dateCreated>
+                                                        <xsl:value-of select="."/>
+                                                </dateCreated>
+                                        </xsl:when>
+                                </xsl:choose>
+                        </xsl:for-each>
+                        <xsl:variable name="dataField260c">
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString" select="marc:datafield[@tag=260]/marc:subfield[@code='c']"></xsl:with-param>
+                                </xsl:call-template>
+                        </xsl:variable>
+                        <xsl:variable name="controlField008-7-10" select="normalize-space(substring($controlField008, 8, 4))"></xsl:variable>
+                        <xsl:variable name="controlField008-11-14" select="normalize-space(substring($controlField008, 12, 4))"></xsl:variable>
+                        <xsl:variable name="controlField008-6" select="normalize-space(substring($controlField008, 7, 1))"></xsl:variable>
+                        <xsl:if test="$controlField008-6='e' or $controlField008-6='p' or $controlField008-6='r' or $controlField008-6='t' or $controlField008-6='s'">
+                                <xsl:if test="$controlField008-7-10 and ($controlField008-7-10 != $dataField260c)">
+                                        <dateIssued encoding="marc">
+                                                <xsl:value-of select="$controlField008-7-10"/>
+                                        </dateIssued>
+                                </xsl:if>
+                        </xsl:if>
+                        <xsl:if test="$controlField008-6='c' or $controlField008-6='d' or $controlField008-6='i' or $controlField008-6='k' or $controlField008-6='m' or $controlField008-6='q' or $controlField008-6='u'">
+                                <xsl:if test="$controlField008-7-10">
+                                        <dateIssued encoding="marc" point="start">
+                                                <xsl:value-of select="$controlField008-7-10"/>
+                                        </dateIssued>
+                                </xsl:if>
+                        </xsl:if>
+                        <xsl:if test="$controlField008-6='c' or $controlField008-6='d' or $controlField008-6='i' or $controlField008-6='k' or $controlField008-6='m' or $controlField008-6='q' or $controlField008-6='u'">
+                                <xsl:if test="$controlField008-11-14">
+                                        <dateIssued encoding="marc" point="end">
+                                                <xsl:value-of select="$controlField008-11-14"/>
+                                        </dateIssued>
+                                </xsl:if>
+                        </xsl:if>
+                        <xsl:if test="$controlField008-6='q'">
+                                <xsl:if test="$controlField008-7-10">
+                                        <dateIssued encoding="marc" point="start" qualifier="questionable">
+                                                <xsl:value-of select="$controlField008-7-10"/>
+                                        </dateIssued>
+                                </xsl:if>
+                        </xsl:if>
+                        <xsl:if test="$controlField008-6='q'">
+                                <xsl:if test="$controlField008-11-14">
+                                        <dateIssued encoding="marc" point="end" qualifier="questionable">
+                                                <xsl:value-of select="$controlField008-11-14"/>
+                                        </dateIssued>
+                                </xsl:if>
+                        </xsl:if>
+                        <xsl:if test="$controlField008-6='t'">
+                                <xsl:if test="$controlField008-11-14">
+                                        <copyrightDate encoding="marc">
+                                                <xsl:value-of select="$controlField008-11-14"/>
+                                        </copyrightDate>
+                                </xsl:if>
+                        </xsl:if>
+                        <xsl:for-each select="marc:datafield[@tag=033][@ind1=0 or @ind1=1]/marc:subfield[@code='a']">
+                                <dateCaptured encoding="iso8601">
+                                        <xsl:value-of select="."/>
+                                </dateCaptured>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=033][@ind1=2]/marc:subfield[@code='a'][1]">
+                                <dateCaptured encoding="iso8601" point="start">
+                                        <xsl:value-of select="."/>
+                                </dateCaptured>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=033][@ind1=2]/marc:subfield[@code='a'][2]">
+                                <dateCaptured encoding="iso8601" point="end">
+                                        <xsl:value-of select="."/>
+                                </dateCaptured>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=250]/marc:subfield[@code='a']">
+                                <edition>
+                                        <xsl:value-of select="."/>
+                                </edition>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:leader">
+                                <issuance>
+                                        <xsl:choose>
+                                                <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">monographic</xsl:when>
+                                                <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">continuing</xsl:when>
+                                        </xsl:choose>
+                                </issuance>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=310]|marc:datafield[@tag=321]">
+                                <frequency>
+                                        <xsl:call-template name="subfieldSelect">
+                                                <xsl:with-param name="codes">ab</xsl:with-param>
+                                        </xsl:call-template>
+                                </frequency>
+                        </xsl:for-each>
+                </originInfo>
+                <xsl:variable name="controlField008-35-37" select="normalize-space(translate(substring($controlField008,36,3),'|#',''))"></xsl:variable>
+                <xsl:if test="$controlField008-35-37">
+                        <language>
+                                <languageTerm authority="iso639-2b" type="code">
+                                        <xsl:value-of select="substring($controlField008,36,3)"/>
+                                </languageTerm>
+                        </language>
+                </xsl:if>
+                <xsl:for-each select="marc:datafield[@tag=041]">
+                        <xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='d' or @code='e' or @code='f' or @code='g' or @code='h']">
+                                <xsl:variable name="langCodes" select="."/>
+                                <xsl:choose>
+                                        <xsl:when test="../marc:subfield[@code='2']='rfc3066'">
+                                                <!-- not stacked but could be repeated -->
+                                                <xsl:call-template name="rfcLanguages">
+                                                        <xsl:with-param name="nodeNum">
+                                                                <xsl:value-of select="1"/>
+                                                        </xsl:with-param>
+                                                        <xsl:with-param name="usedLanguages">
+                                                                <xsl:text></xsl:text>
+                                                        </xsl:with-param>
+                                                        <xsl:with-param name="controlField008-35-37">
+                                                                <xsl:value-of select="$controlField008-35-37"></xsl:value-of>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <!-- iso -->
+                                                <xsl:variable name="allLanguages">
+                                                        <xsl:copy-of select="$langCodes"></xsl:copy-of>
+                                                </xsl:variable>
+                                                <xsl:variable name="currentLanguage">
+                                                        <xsl:value-of select="substring($allLanguages,1,3)"></xsl:value-of>
+                                                </xsl:variable>
+                                                <xsl:call-template name="isoLanguage">
+                                                        <xsl:with-param name="currentLanguage">
+                                                                <xsl:value-of select="substring($allLanguages,1,3)"></xsl:value-of>
+                                                        </xsl:with-param>
+                                                        <xsl:with-param name="remainingLanguages">
+                                                                <xsl:value-of select="substring($allLanguages,4,string-length($allLanguages)-3)"></xsl:value-of>
+                                                        </xsl:with-param>
+                                                        <xsl:with-param name="usedLanguages">
+                                                                <xsl:if test="$controlField008-35-37">
+                                                                        <xsl:value-of select="$controlField008-35-37"></xsl:value-of>
+                                                                </xsl:if>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                        </xsl:for-each>
+                </xsl:for-each>
+                <xsl:variable name="physicalDescription">
+                        <!--3.2 change tmee 007/11 -->
+                        <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='a']">
+                                <digitalOrigin>reformatted digital</digitalOrigin>
+                        </xsl:if>
+                        <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='b']">
+                                <digitalOrigin>digitized microfilm</digitalOrigin>
+                        </xsl:if>
+                        <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='d']">
+                                <digitalOrigin>digitized other analog</digitalOrigin>
+                        </xsl:if>
+                        <xsl:variable name="controlField008-23" select="substring($controlField008,24,1)"></xsl:variable>
+                        <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"></xsl:variable>
+                        <xsl:variable name="check008-23">
+                                <xsl:if test="$typeOf008='BK' or $typeOf008='MU' or $typeOf008='SE' or $typeOf008='MM'">
+                                        <xsl:value-of select="true()"></xsl:value-of>
+                                </xsl:if>
+                        </xsl:variable>
+                        <xsl:variable name="check008-29">
+                                <xsl:if test="$typeOf008='MP' or $typeOf008='VM'">
+                                        <xsl:value-of select="true()"></xsl:value-of>
+                                </xsl:if>
+                        </xsl:variable>
+                        <xsl:choose>
+                                <xsl:when test="($check008-23 and $controlField008-23='f') or ($check008-29 and $controlField008-29='f')">
+                                        <form authority="marcform">braille</form>
+                                </xsl:when>
+                                <xsl:when test="($controlField008-23=' ' and ($leader6='c' or $leader6='d')) or (($typeOf008='BK' or $typeOf008='SE') and ($controlField008-23=' ' or $controlField008='r'))">
+                                        <form authority="marcform">print</form>
+                                </xsl:when>
+                                <xsl:when test="$leader6 = 'm' or ($check008-23 and $controlField008-23='s') or ($check008-29 and $controlField008-29='s')">
+                                        <form authority="marcform">electronic</form>
+                                </xsl:when>
+                                <xsl:when test="($check008-23 and $controlField008-23='b') or ($check008-29 and $controlField008-29='b')">
+                                        <form authority="marcform">microfiche</form>
+                                </xsl:when>
+                                <xsl:when test="($check008-23 and $controlField008-23='a') or ($check008-29 and $controlField008-29='a')">
+                                        <form authority="marcform">microfilm</form>
+                                </xsl:when>
+                        </xsl:choose>
+                        <!-- 1/04 fix -->
+                        <xsl:if test="marc:datafield[@tag=130]/marc:subfield[@code='h']">
+                                <form authority="gmd">
+                                        <xsl:call-template name="chopBrackets">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:datafield[@tag=130]/marc:subfield[@code='h']"></xsl:value-of>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </form>
+                        </xsl:if>
+                        <xsl:if test="marc:datafield[@tag=240]/marc:subfield[@code='h']">
+                                <form authority="gmd">
+                                        <xsl:call-template name="chopBrackets">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:datafield[@tag=240]/marc:subfield[@code='h']"></xsl:value-of>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </form>
+                        </xsl:if>
+                        <xsl:if test="marc:datafield[@tag=242]/marc:subfield[@code='h']">
+                                <form authority="gmd">
+                                        <xsl:call-template name="chopBrackets">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:datafield[@tag=242]/marc:subfield[@code='h']"></xsl:value-of>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </form>
+                        </xsl:if>
+                        <xsl:if test="marc:datafield[@tag=245]/marc:subfield[@code='h']">
+                                <form authority="gmd">
+                                        <xsl:call-template name="chopBrackets">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:datafield[@tag=245]/marc:subfield[@code='h']"></xsl:value-of>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </form>
+                        </xsl:if>
+                        <xsl:if test="marc:datafield[@tag=246]/marc:subfield[@code='h']">
+                                <form authority="gmd">
+                                        <xsl:call-template name="chopBrackets">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:datafield[@tag=246]/marc:subfield[@code='h']"></xsl:value-of>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </form>
+                        </xsl:if>
+                        <xsl:if test="marc:datafield[@tag=730]/marc:subfield[@code='h']">
+                                <form authority="gmd">
+                                        <xsl:call-template name="chopBrackets">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:datafield[@tag=730]/marc:subfield[@code='h']"></xsl:value-of>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </form>
+                        </xsl:if>
+                        <xsl:for-each select="marc:datafield[@tag=256]/marc:subfield[@code='a']">
+                                <form>
+                                        <xsl:value-of select="."></xsl:value-of>
+                                </form>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:controlfield[@tag=007][substring(text(),1,1)='c']">
+                                <xsl:choose>
+                                        <xsl:when test="substring(text(),14,1)='a'">
+                                                <reformattingQuality>access</reformattingQuality>
+                                        </xsl:when>
+                                        <xsl:when test="substring(text(),14,1)='p'">
+                                                <reformattingQuality>preservation</reformattingQuality>
+                                        </xsl:when>
+                                        <xsl:when test="substring(text(),14,1)='r'">
+                                                <reformattingQuality>replacement</reformattingQuality>
+                                        </xsl:when>
+                                </xsl:choose>
+                        </xsl:for-each>
+                        <!--3.2 change tmee 007/01 -->
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='b']">
+                                <form authority="smd">chip cartridge</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='c']">
+                                <form authority="smd">computer optical disc cartridge</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='j']">
+                                <form authority="smd">magnetic disc</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='m']">
+                                <form authority="smd">magneto-optical disc</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='o']">
+                                <form authority="smd">optical disc</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='r']">
+                                <form authority="smd">remote</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='a']">
+                                <form authority="smd">tape cartridge</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='f']">
+                                <form authority="smd">tape cassette</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='h']">
+                                <form authority="smd">tape reel</form>
+                        </xsl:if>
+
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='a']">
+                                <form authority="smd">celestial globe</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='e']">
+                                <form authority="smd">earth moon globe</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='b']">
+                                <form authority="smd">planetary or lunar globe</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='c']">
+                                <form authority="smd">terrestrial globe</form>
+                        </xsl:if>
+
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='o'][substring(text(),2,1)='o']">
+                                <form authority="smd">kit</form>
+                        </xsl:if>
+
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='d']">
+                                <form authority="smd">atlas</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='g']">
+                                <form authority="smd">diagram</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='j']">
+                                <form authority="smd">map</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
+                                <form authority="smd">model</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='k']">
+                                <form authority="smd">profile</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='r']">
+                                <form authority="smd">remote-sensing image</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='s']">
+                                <form authority="smd">section</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='y']">
+                                <form authority="smd">view</form>
+                        </xsl:if>
+
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='a']">
+                                <form authority="smd">aperture card</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='e']">
+                                <form authority="smd">microfiche</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='f']">
+                                <form authority="smd">microfiche cassette</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='b']">
+                                <form authority="smd">microfilm cartridge</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='c']">
+                                <form authority="smd">microfilm cassette</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='d']">
+                                <form authority="smd">microfilm reel</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='g']">
+                                <form authority="smd">microopaque</form>
+                        </xsl:if>
+
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='m'][substring(text(),2,1)='c']">
+                                <form authority="smd">film cartridge</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='m'][substring(text(),2,1)='f']">
+                                <form authority="smd">film cassette</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='m'][substring(text(),2,1)='r']">
+                                <form authority="smd">film reel</form>
+                        </xsl:if>
+
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='n']">
+                                <form authority="smd">chart</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='c']">
+                                <form authority="smd">collage</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='d']">
+                                <form authority="smd">drawing</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='o']">
+                                <form authority="smd">flash card</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='e']">
+                                <form authority="smd">painting</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='f']">
+                                <form authority="smd">photomechanical print</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='g']">
+                                <form authority="smd">photonegative</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='h']">
+                                <form authority="smd">photoprint</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='i']">
+                                <form authority="smd">picture</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='j']">
+                                <form authority="smd">print</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='l']">
+                                <form authority="smd">technical drawing</form>
+                        </xsl:if>
+
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='q'][substring(text(),2,1)='q']">
+                                <form authority="smd">notated music</form>
+                        </xsl:if>
+
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='d']">
+                                <form authority="smd">filmslip</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='c']">
+                                <form authority="smd">filmstrip cartridge</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='o']">
+                                <form authority="smd">filmstrip roll</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='f']">
+                                <form authority="smd">other filmstrip type</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='s']">
+                                <form authority="smd">slide</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='t']">
+                                <form authority="smd">transparency</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='r'][substring(text(),2,1)='r']">
+                                <form authority="smd">remote-sensing image</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='e']">
+                                <form authority="smd">cylinder</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='q']">
+                                <form authority="smd">roll</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='g']">
+                                <form authority="smd">sound cartridge</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='s']">
+                                <form authority="smd">sound cassette</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='d']">
+                                <form authority="smd">sound disc</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='t']">
+                                <form authority="smd">sound-tape reel</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='i']">
+                                <form authority="smd">sound-track film</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='w']">
+                                <form authority="smd">wire recording</form>
+                        </xsl:if>
+
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='c']">
+                                <form authority="smd">braille</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='b']">
+                                <form authority="smd">combination</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='a']">
+                                <form authority="smd">moon</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='d']">
+                                <form authority="smd">tactile, with no writing system</form>
+                        </xsl:if>
+
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='c']">
+                                <form authority="smd">braille</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='b']">
+                                <form authority="smd">large print</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='a']">
+                                <form authority="smd">regular print</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='d']">
+                                <form authority="smd">text in looseleaf binder</form>
+                        </xsl:if>
+
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='c']">
+                                <form authority="smd">videocartridge</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='f']">
+                                <form authority="smd">videocassette</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='d']">
+                                <form authority="smd">videodisc</form>
+                        </xsl:if>
+                        <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='r']">
+                                <form authority="smd">videoreel</form>
+                        </xsl:if>
+
+                        <xsl:for-each select="marc:datafield[@tag=856]/marc:subfield[@code='q'][string-length(.)>1]">
+                                <internetMediaType>
+                                        <xsl:value-of select="."></xsl:value-of>
+                                </internetMediaType>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=300]">
+                                <extent>
+                                        <xsl:call-template name="subfieldSelect">
+                                                <xsl:with-param name="codes">abce</xsl:with-param>
+                                        </xsl:call-template>
+                                </extent>
+                        </xsl:for-each>
+                </xsl:variable>
+                <xsl:if test="string-length(normalize-space($physicalDescription))">
+                        <physicalDescription>
+                                <xsl:copy-of select="$physicalDescription"></xsl:copy-of>
+                        </physicalDescription>
+                </xsl:if>
+                <xsl:for-each select="marc:datafield[@tag=520]">
+                        <abstract>
+                                <xsl:call-template name="uri"></xsl:call-template>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </abstract>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=505]">
+                        <tableOfContents>
+                                <xsl:call-template name="uri"></xsl:call-template>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">agrt</xsl:with-param>
+                                </xsl:call-template>
+                        </tableOfContents>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=521]">
+                        <targetAudience>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </targetAudience>
+                </xsl:for-each>
+                <xsl:if test="$typeOf008='BK' or $typeOf008='CF' or $typeOf008='MU' or $typeOf008='VM'">
+                        <xsl:variable name="controlField008-22" select="substring($controlField008,23,1)"></xsl:variable>
+                        <xsl:choose>
+                                <!-- 01/04 fix -->
+                                <xsl:when test="$controlField008-22='d'">
+                                        <targetAudience authority="marctarget">adolescent</targetAudience>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-22='e'">
+                                        <targetAudience authority="marctarget">adult</targetAudience>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-22='g'">
+                                        <targetAudience authority="marctarget">general</targetAudience>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-22='b' or $controlField008-22='c' or $controlField008-22='j'">
+                                        <targetAudience authority="marctarget">juvenile</targetAudience>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-22='a'">
+                                        <targetAudience authority="marctarget">preschool</targetAudience>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-22='f'">
+                                        <targetAudience authority="marctarget">specialized</targetAudience>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:for-each select="marc:datafield[@tag=245]/marc:subfield[@code='c']">
+                        <note type="statement of responsibility">
+                                <xsl:value-of select="."></xsl:value-of>
+                        </note>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=500]">
+                        <note>
+                                <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
+                                <xsl:call-template name="uri"></xsl:call-template>
+                        </note>
+                </xsl:for-each>
+
+                <!--3.2 change tmee additional note fields-->
+
+                <xsl:for-each select="marc:datafield[@tag=502]">
+                        <note type="thesis">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=504]">
+                        <note type="bibliography">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=508]">
+                        <note type="creation/production credits">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=506]">
+                        <note type="restrictions">
+                                <xsl:call-template name="uri"></xsl:call-template>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."></xsl:value-of>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"></xsl:value-of>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=510]">
+                        <note  type="citation/reference">
+                                <xsl:call-template name="uri"></xsl:call-template>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."></xsl:value-of>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"></xsl:value-of>
+                        </note>
+                </xsl:for-each>
+
+
+                <xsl:for-each select="marc:datafield[@tag=511]">
+                        <note type="performers">
+                                <xsl:call-template name="uri"></xsl:call-template>
+                                <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
+                        </note>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=518]">
+                        <note type="venue">
+                                <xsl:call-template name="uri"></xsl:call-template>
+                                <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=530]">
+                        <note  type="additional physical form">
+                                <xsl:call-template name="uri"></xsl:call-template>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."></xsl:value-of>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"></xsl:value-of>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=533]">
+                        <note  type="reproduction">
+                                <xsl:call-template name="uri"></xsl:call-template>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."></xsl:value-of>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"></xsl:value-of>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=534]">
+                        <note  type="original version">
+                                <xsl:call-template name="uri"></xsl:call-template>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."></xsl:value-of>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"></xsl:value-of>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=538]">
+                        <note  type="system details">
+                                <xsl:call-template name="uri"></xsl:call-template>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."></xsl:value-of>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"></xsl:value-of>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=583]">
+                        <note type="action">
+                                <xsl:call-template name="uri"></xsl:call-template>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."></xsl:value-of>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"></xsl:value-of>
+                        </note>
+                </xsl:for-each>
+
+
+
+
+
+                <xsl:for-each select="marc:datafield[@tag=501 or @tag=507 or  @tag=513 or @tag=514 or @tag=515 or @tag=516 or @tag=522 or @tag=524 or @tag=525 or @tag=526 or @tag=535 or @tag=536 or @tag=540 or @tag=541 or @tag=544 or @tag=545 or @tag=546 or @tag=547 or @tag=550 or @tag=552 or @tag=555 or @tag=556 or @tag=561 or @tag=562 or @tag=565 or @tag=567 or @tag=580 or @tag=581 or @tag=584 or @tag=585 or @tag=586]">
+                        <note>
+                                <xsl:call-template name="uri"></xsl:call-template>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."></xsl:value-of>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"></xsl:value-of>
+                        </note>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=034][marc:subfield[@code='d' or @code='e' or @code='f' or @code='g']]">
+                        <subject>
+                                <cartographics>
+                                        <coordinates>
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">defg</xsl:with-param>
+                                                </xsl:call-template>
+                                        </coordinates>
+                                </cartographics>
+                        </subject>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=043]">
+                        <subject>
+                                <xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='c']">
+                                        <geographicCode>
+                                                <xsl:attribute name="authority">
+                                                        <xsl:if test="@code='a'">
+                                                                <xsl:text>marcgac</xsl:text>
+                                                        </xsl:if>
+                                                        <xsl:if test="@code='b'">
+                                                                <xsl:value-of select="following-sibling::marc:subfield[@code=2]"></xsl:value-of>
+                                                        </xsl:if>
+                                                        <xsl:if test="@code='c'">
+                                                                <xsl:text>iso3166</xsl:text>
+                                                        </xsl:if>
+                                                </xsl:attribute>
+                                                <xsl:value-of select="self::marc:subfield"></xsl:value-of>
+                                        </geographicCode>
+                                </xsl:for-each>
+                        </subject>
+                </xsl:for-each>
+                <!-- tmee 2006/11/27 -->
+                <xsl:for-each select="marc:datafield[@tag=255]">
+                        <subject>
+                                <xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='c']">
+                                <cartographics>
+                                        <xsl:if test="@code='a'">
+                                                <scale>
+                                                        <xsl:value-of select="."></xsl:value-of>
+                                                </scale>
+                                        </xsl:if>
+                                        <xsl:if test="@code='b'">
+                                                <projection>
+                                                        <xsl:value-of select="."></xsl:value-of>
+                                                </projection>
+                                        </xsl:if>
+                                        <xsl:if test="@code='c'">
+                                                <coordinates>
+                                                        <xsl:value-of select="."></xsl:value-of>
+                                                </coordinates>
+                                        </xsl:if>
+                                </cartographics>
+                                </xsl:for-each>
+                        </subject>
+                </xsl:for-each>
+
+                <xsl:apply-templates select="marc:datafield[653 >= @tag and @tag >= 600]"></xsl:apply-templates>
+                <xsl:apply-templates select="marc:datafield[@tag=656]"></xsl:apply-templates>
+                <xsl:for-each select="marc:datafield[@tag=752]">
+                        <subject>
+                                <hierarchicalGeographic>
+                                        <xsl:for-each select="marc:subfield[@code='a']">
+                                                <country>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."></xsl:with-param>
+                                                        </xsl:call-template>
+                                                </country>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='b']">
+                                                <state>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."></xsl:with-param>
+                                                        </xsl:call-template>
+                                                </state>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='c']">
+                                                <county>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."></xsl:with-param>
+                                                        </xsl:call-template>
+                                                </county>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='d']">
+                                                <city>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."></xsl:with-param>
+                                                        </xsl:call-template>
+                                                </city>
+                                        </xsl:for-each>
+                                </hierarchicalGeographic>
+                        </subject>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=045][marc:subfield[@code='b']]">
+                        <subject>
+                                <xsl:choose>
+                                        <xsl:when test="@ind1=2">
+                                                <temporal encoding="iso8601" point="start">
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString">
+                                                                        <xsl:value-of select="marc:subfield[@code='b'][1]"></xsl:value-of>
+                                                                </xsl:with-param>
+                                                        </xsl:call-template>
+                                                </temporal>
+                                                <temporal encoding="iso8601" point="end">
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString">
+                                                                        <xsl:value-of select="marc:subfield[@code='b'][2]"></xsl:value-of>
+                                                                </xsl:with-param>
+                                                        </xsl:call-template>
+                                                </temporal>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <xsl:for-each select="marc:subfield[@code='b']">
+                                                        <temporal encoding="iso8601">
+                                                                <xsl:call-template name="chopPunctuation">
+                                                                        <xsl:with-param name="chopString" select="."></xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </temporal>
+                                                </xsl:for-each>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                        </subject>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=050]">
+                        <xsl:for-each select="marc:subfield[@code='b']">
+                                <classification authority="lcc">
+                                        <xsl:if test="../marc:subfield[@code='3']">
+                                                <xsl:attribute name="displayLabel">
+                                                        <xsl:value-of select="../marc:subfield[@code='3']"></xsl:value-of>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                        <xsl:value-of select="preceding-sibling::marc:subfield[@code='a'][1]"></xsl:value-of>
+                                        <xsl:text> </xsl:text>
+                                        <xsl:value-of select="text()"></xsl:value-of>
+                                </classification>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:subfield[@code='a'][not(following-sibling::marc:subfield[@code='b'])]">
+                                <classification authority="lcc">
+                                        <xsl:if test="../marc:subfield[@code='3']">
+                                                <xsl:attribute name="displayLabel">
+                                                        <xsl:value-of select="../marc:subfield[@code='3']"></xsl:value-of>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                        <xsl:value-of select="text()"></xsl:value-of>
+                                </classification>
+                        </xsl:for-each>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=082]">
+                        <classification authority="ddc">
+                                <xsl:if test="marc:subfield[@code='2']">
+                                        <xsl:attribute name="edition">
+                                                <xsl:value-of select="marc:subfield[@code='2']"></xsl:value-of>
+                                        </xsl:attribute>
+                                </xsl:if>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=080]">
+                        <classification authority="udc">
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">abx</xsl:with-param>
+                                </xsl:call-template>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=060]">
+                        <classification authority="nlm">
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=086][@ind1=0]">
+                        <classification authority="sudocs">
+                                <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=086][@ind1=1]">
+                        <classification authority="candoc">
+                                <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=086]">
+                        <classification>
+                                <xsl:attribute name="authority">
+                                        <xsl:value-of select="marc:subfield[@code='2']"></xsl:value-of>
+                                </xsl:attribute>
+                                <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=084]">
+                        <classification>
+                                <xsl:attribute name="authority">
+                                        <xsl:value-of select="marc:subfield[@code='2']"></xsl:value-of>
+                                </xsl:attribute>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=440]">
+                        <relatedItem type="series">
+                                <xsl:variable name="titleChop">
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">av</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </xsl:variable>
+                                <titleInfo>
+                                        <title>
+                                                <xsl:value-of select="$titleChop" />
+                                        </title>
+                                        <xsl:call-template name="part"></xsl:call-template>
+                                </titleInfo>
+                                <titleInfo type="nfi">
+                                        <xsl:choose>
+                                                <xsl:when test="@ind2>0">
+                                                        <nonSort>
+                                                                <xsl:value-of select="substring($titleChop,1, at ind2)"/>
+                                                        </nonSort>
+                                                        <title>
+                                                                <xsl:value-of select="substring($titleChop, at ind2+1)"/>
+                                                        </title>
+                                                        <xsl:call-template name="part"/>
+                                                </xsl:when>
+                                                <xsl:otherwise>
+                                                        <title>
+                                                                <xsl:value-of select="$titleChop" />
+                                                        </title>
+                                                </xsl:otherwise>
+                                        </xsl:choose>
+                                        <xsl:call-template name="part"></xsl:call-template>
+                                </titleInfo>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=490][@ind1=0]">
+                        <relatedItem type="series">
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="subfieldSelect">
+                                                                        <xsl:with-param name="codes">av</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="part"></xsl:call-template>
+                                </titleInfo>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=510]">
+                        <relatedItem type="isReferencedBy">
+                                <note>
+                                        <xsl:call-template name="subfieldSelect">
+                                                <xsl:with-param name="codes">abcx3</xsl:with-param>
+                                        </xsl:call-template>
+                                </note>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=534]">
+                        <relatedItem type="original">
+                                <xsl:call-template name="relatedTitle"></xsl:call-template>
+                                <xsl:call-template name="relatedName"></xsl:call-template>
+                                <xsl:if test="marc:subfield[@code='b' or @code='c']">
+                                        <originInfo>
+                                                <xsl:for-each select="marc:subfield[@code='c']">
+                                                        <publisher>
+                                                                <xsl:value-of select="."></xsl:value-of>
+                                                        </publisher>
+                                                </xsl:for-each>
+                                                <xsl:for-each select="marc:subfield[@code='b']">
+                                                        <edition>
+                                                                <xsl:value-of select="."></xsl:value-of>
+                                                        </edition>
+                                                </xsl:for-each>
+                                        </originInfo>
+                                </xsl:if>
+                                <xsl:call-template name="relatedIdentifierISSN"></xsl:call-template>
+                                <xsl:for-each select="marc:subfield[@code='z']">
+                                        <identifier type="isbn">
+                                                <xsl:value-of select="."></xsl:value-of>
+                                        </identifier>
+                                </xsl:for-each>
+                                <xsl:call-template name="relatedNote"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=700][marc:subfield[@code='t']]">
+                        <relatedItem>
+                                <xsl:call-template name="constituentOrRelatedType"></xsl:call-template>
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">g</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="part"></xsl:call-template>
+                                </titleInfo>
+                                <name type="personal">
+                                        <namePart>
+                                                <xsl:call-template name="specialSubfieldSelect">
+                                                        <xsl:with-param name="anyCodes">aq</xsl:with-param>
+                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                        <xsl:with-param name="beforeCodes">g</xsl:with-param>
+                                                </xsl:call-template>
+                                        </namePart>
+                                        <xsl:call-template name="termsOfAddress"></xsl:call-template>
+                                        <xsl:call-template name="nameDate"></xsl:call-template>
+                                        <xsl:call-template name="role"></xsl:call-template>
+                                </name>
+                                <xsl:call-template name="relatedForm"></xsl:call-template>
+                                <xsl:call-template name="relatedIdentifierISSN"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=710][marc:subfield[@code='t']]">
+                        <relatedItem>
+                                <xsl:call-template name="constituentOrRelatedType"></xsl:call-template>
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">dg</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="relatedPartNumName"></xsl:call-template>
+                                </titleInfo>
+                                <name type="corporate">
+                                        <xsl:for-each select="marc:subfield[@code='a']">
+                                                <namePart>
+                                                        <xsl:value-of select="."></xsl:value-of>
+                                                </namePart>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='b']">
+                                                <namePart>
+                                                        <xsl:value-of select="."></xsl:value-of>
+                                                </namePart>
+                                        </xsl:for-each>
+                                        <xsl:variable name="tempNamePart">
+                                                <xsl:call-template name="specialSubfieldSelect">
+                                                        <xsl:with-param name="anyCodes">c</xsl:with-param>
+                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                        <xsl:with-param name="beforeCodes">dgn</xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:variable>
+                                        <xsl:if test="normalize-space($tempNamePart)">
+                                                <namePart>
+                                                        <xsl:value-of select="$tempNamePart"></xsl:value-of>
+                                                </namePart>
+                                        </xsl:if>
+                                        <xsl:call-template name="role"></xsl:call-template>
+                                </name>
+                                <xsl:call-template name="relatedForm"></xsl:call-template>
+                                <xsl:call-template name="relatedIdentifierISSN"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=711][marc:subfield[@code='t']]">
+                        <relatedItem>
+                                <xsl:call-template name="constituentOrRelatedType"></xsl:call-template>
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">tfklsv</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">g</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="relatedPartNumName"></xsl:call-template>
+                                </titleInfo>
+                                <name type="conference">
+                                        <namePart>
+                                                <xsl:call-template name="specialSubfieldSelect">
+                                                        <xsl:with-param name="anyCodes">aqdc</xsl:with-param>
+                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                        <xsl:with-param name="beforeCodes">gn</xsl:with-param>
+                                                </xsl:call-template>
+                                        </namePart>
+                                </name>
+                                <xsl:call-template name="relatedForm"></xsl:call-template>
+                                <xsl:call-template name="relatedIdentifierISSN"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=730][@ind2=2]">
+                        <relatedItem>
+                                <xsl:call-template name="constituentOrRelatedType"></xsl:call-template>
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="subfieldSelect">
+                                                                        <xsl:with-param name="codes">adfgklmorsv</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="part"></xsl:call-template>
+                                </titleInfo>
+                                <xsl:call-template name="relatedForm"></xsl:call-template>
+                                <xsl:call-template name="relatedIdentifierISSN"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=740][@ind2=2]">
+                        <relatedItem>
+                                <xsl:call-template name="constituentOrRelatedType"></xsl:call-template>
+                                <xsl:variable name="titleChop">
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </xsl:variable>
+                                <titleInfo>
+                                        <title>
+                                                <xsl:value-of select="$titleChop" />
+                                        </title>
+                                        <xsl:call-template name="part"></xsl:call-template>
+                                </titleInfo>
+                                <titleInfo type="nfi">
+                                        <xsl:choose>
+                                                <xsl:when test="@ind1>0">
+                                                        <nonSort>
+                                                                <xsl:value-of select="substring($titleChop,1, at ind1)"/>
+                                                        </nonSort>
+                                                        <title>
+                                                                <xsl:value-of select="substring($titleChop, at ind1+1)"/>
+                                                        </title>
+                                                </xsl:when>
+                                                <xsl:otherwise>
+                                                        <title>
+                                                                <xsl:value-of select="$titleChop" />
+                                                        </title>
+                                                </xsl:otherwise>
+                                        </xsl:choose>
+                                        <xsl:call-template name="part"></xsl:call-template>
+                                </titleInfo>
+                                <xsl:call-template name="relatedForm"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=760]|marc:datafield[@tag=762]">
+                        <relatedItem type="series">
+                                <xsl:call-template name="relatedItem76X-78X"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=765]|marc:datafield[@tag=767]|marc:datafield[@tag=777]|marc:datafield[@tag=787]">
+                        <relatedItem>
+                                <xsl:call-template name="relatedItem76X-78X"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=775]">
+                        <relatedItem type="otherVersion">
+                                <xsl:call-template name="relatedItem76X-78X"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=770]|marc:datafield[@tag=774]">
+                        <relatedItem type="constituent">
+                                <xsl:call-template name="relatedItem76X-78X"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=772]|marc:datafield[@tag=773]">
+                        <relatedItem type="host">
+                                <xsl:call-template name="relatedItem76X-78X"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=776]">
+                        <relatedItem type="otherFormat">
+                                <xsl:call-template name="relatedItem76X-78X"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=780]">
+                        <relatedItem type="preceding">
+                                <xsl:call-template name="relatedItem76X-78X"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=785]">
+                        <relatedItem type="succeeding">
+                                <xsl:call-template name="relatedItem76X-78X"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=786]">
+                        <relatedItem type="original">
+                                <xsl:call-template name="relatedItem76X-78X"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=800]">
+                        <relatedItem type="series">
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">g</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="part"></xsl:call-template>
+                                </titleInfo>
+                                <name type="personal">
+                                        <namePart>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">aq</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="beforeCodes">g</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </namePart>
+                                        <xsl:call-template name="termsOfAddress"></xsl:call-template>
+                                        <xsl:call-template name="nameDate"></xsl:call-template>
+                                        <xsl:call-template name="role"></xsl:call-template>
+                                </name>
+                                <xsl:call-template name="relatedForm"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=810]">
+                        <relatedItem type="series">
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">dg</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="relatedPartNumName"></xsl:call-template>
+                                </titleInfo>
+                                <name type="corporate">
+                                        <xsl:for-each select="marc:subfield[@code='a']">
+                                                <namePart>
+                                                        <xsl:value-of select="."></xsl:value-of>
+                                                </namePart>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='b']">
+                                                <namePart>
+                                                        <xsl:value-of select="."></xsl:value-of>
+                                                </namePart>
+                                        </xsl:for-each>
+                                        <namePart>
+                                                <xsl:call-template name="specialSubfieldSelect">
+                                                        <xsl:with-param name="anyCodes">c</xsl:with-param>
+                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                        <xsl:with-param name="beforeCodes">dgn</xsl:with-param>
+                                                </xsl:call-template>
+                                        </namePart>
+                                        <xsl:call-template name="role"></xsl:call-template>
+                                </name>
+                                <xsl:call-template name="relatedForm"></xsl:call-template>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=811]">
+                        <relatedItem type="series">
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">tfklsv</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">g</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="relatedPartNumName"/>
+                                </titleInfo>
+                                <name type="conference">
+                                        <namePart>
+                                                <xsl:call-template name="specialSubfieldSelect">
+                                                        <xsl:with-param name="anyCodes">aqdc</xsl:with-param>
+                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                        <xsl:with-param name="beforeCodes">gn</xsl:with-param>
+                                                </xsl:call-template>
+                                        </namePart>
+                                        <xsl:call-template name="role"/>
+                                </name>
+                                <xsl:call-template name="relatedForm"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='830']">
+                        <relatedItem type="series">
+                                <xsl:variable name="titleChop">
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">adfgklmorsv</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </xsl:variable>
+                                <titleInfo>
+                                        <title>
+                                                <xsl:value-of select="$titleChop" />
+                                        </title>
+                                        <xsl:call-template name="part"/>
+                                </titleInfo>
+                                <titleInfo type="nfi">
+                                        <xsl:choose>
+                                                <xsl:when test="@ind2>0">
+                                                        <nonSort>
+                                                                <xsl:value-of select="substring($titleChop,1, at ind2)"/>
+                                                        </nonSort>
+                                                        <title>
+                                                                <xsl:value-of select="substring($titleChop, at ind2+1)"/>
+                                                        </title>
+                                                </xsl:when>
+                                                <xsl:otherwise>
+                                                        <title>
+                                                                <xsl:value-of select="$titleChop" />
+                                                        </title>
+                                                </xsl:otherwise>
+                                        </xsl:choose>
+                                        <xsl:call-template name="part"/>
+                                </titleInfo>
+                                <xsl:call-template name="relatedForm"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='856'][@ind2='2']/marc:subfield[@code='q']">
+                        <relatedItem>
+                                <internetMediaType>
+                                        <xsl:value-of select="."/>
+                                </internetMediaType>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='020']">
+                        <xsl:call-template name="isInvalid">
+                                <xsl:with-param name="type">isbn</xsl:with-param>
+                        </xsl:call-template>
+                        <xsl:if test="marc:subfield[@code='a']">
+                                <identifier type="isbn">
+                                        <xsl:value-of select="marc:subfield[@code='a']"/>
+                                </identifier>
+                        </xsl:if>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='024'][@ind1='0']">
+                        <xsl:call-template name="isInvalid">
+                                <xsl:with-param name="type">isrc</xsl:with-param>
+                        </xsl:call-template>
+                        <xsl:if test="marc:subfield[@code='a']">
+                                <identifier type="isrc">
+                                        <xsl:value-of select="marc:subfield[@code='a']"/>
+                                </identifier>
+                        </xsl:if>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='024'][@ind1='2']">
+                        <xsl:call-template name="isInvalid">
+                                <xsl:with-param name="type">ismn</xsl:with-param>
+                        </xsl:call-template>
+                        <xsl:if test="marc:subfield[@code='a']">
+                                <identifier type="ismn">
+                                        <xsl:value-of select="marc:subfield[@code='a']"/>
+                                </identifier>
+                        </xsl:if>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='024'][@ind1='4']">
+                        <xsl:call-template name="isInvalid">
+                                <xsl:with-param name="type">sici</xsl:with-param>
+                        </xsl:call-template>
+                        <identifier type="sici">
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </identifier>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='022']">
+                        <xsl:call-template name="isInvalid">
+                                <xsl:with-param name="type">issn</xsl:with-param>
+                        </xsl:call-template>
+                        <identifier type="issn">
+                                <xsl:value-of select="marc:subfield[@code='a']"/>
+                        </identifier>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='010']">
+                        <xsl:call-template name="isInvalid">
+                                <xsl:with-param name="type">lccn</xsl:with-param>
+                        </xsl:call-template>
+                        <identifier type="lccn">
+                                <xsl:value-of select="normalize-space(marc:subfield[@code='a'])"/>
+                        </identifier>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='028']">
+                        <identifier>
+                                <xsl:attribute name="type">
+                                        <xsl:choose>
+                                                <xsl:when test="@ind1='0'">issue number</xsl:when>
+                                                <xsl:when test="@ind1='1'">matrix number</xsl:when>
+                                                <xsl:when test="@ind1='2'">music plate</xsl:when>
+                                                <xsl:when test="@ind1='3'">music publisher</xsl:when>
+                                                <xsl:when test="@ind1='4'">videorecording identifier</xsl:when>
+                                        </xsl:choose>
+                                </xsl:attribute>
+                                <!--<xsl:call-template name="isInvalid"/>--> <!-- no $z in 028 -->
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">
+                                                <xsl:choose>
+                                                        <xsl:when test="@ind1='0'">ba</xsl:when>
+                                                        <xsl:otherwise>ab</xsl:otherwise>
+                                                </xsl:choose>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </identifier>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='037']">
+                        <identifier type="stock number">
+                                <!--<xsl:call-template name="isInvalid"/>--> <!-- no $z in 037 -->
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </identifier>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='856'][marc:subfield[@code='u']]">
+                        <identifier>
+                                <xsl:attribute name="type">
+                                        <xsl:choose>
+                                                <xsl:when test="starts-with(marc:subfield[@code='u'],'urn:doi') or starts-with(marc:subfield[@code='u'],'doi')">doi</xsl:when>
+                                                <xsl:when test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl') or starts-with(marc:subfield[@code='u'],'http://hdl.loc.gov')">hdl</xsl:when>
+                                                <xsl:otherwise>uri</xsl:otherwise>
+                                        </xsl:choose>
+                                </xsl:attribute>
+                                <xsl:choose>
+                                        <xsl:when test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl') or starts-with(marc:subfield[@code='u'],'http://hdl.loc.gov') ">
+                                                <xsl:value-of select="concat('hdl:',substring-after(marc:subfield[@code='u'],'http://hdl.loc.gov/'))"></xsl:value-of>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <xsl:value-of select="marc:subfield[@code='u']"></xsl:value-of>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                        </identifier>
+                        <xsl:if test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl')">
+                                <identifier type="hdl">
+                                        <xsl:if test="marc:subfield[@code='y' or @code='3' or @code='z']">
+                                                <xsl:attribute name="displayLabel">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">y3z</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                        <xsl:value-of select="concat('hdl:',substring-after(marc:subfield[@code='u'],'http://hdl.loc.gov/'))"></xsl:value-of>
+                                </identifier>
+                        </xsl:if>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=024][@ind1=1]">
+                        <identifier type="upc">
+                                <xsl:call-template name="isInvalid"/>
+                                <xsl:value-of select="marc:subfield[@code='a']"/>
+                        </identifier>
+                </xsl:for-each>
+                <!-- 1/04 fix added $y -->
+                <xsl:for-each select="marc:datafield[@tag=856][marc:subfield[@code='u']]">
+                        <location>
+                                <url>
+                                        <xsl:if test="marc:subfield[@code='y' or @code='3']">
+                                                <xsl:attribute name="displayLabel">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">y3</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                        <xsl:if test="marc:subfield[@code='z' ]">
+                                                <xsl:attribute name="note">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">z</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                        <xsl:value-of select="marc:subfield[@code='u']"></xsl:value-of>
+
+                                </url>
+                        </location>
+                </xsl:for-each>
+
+                        <!-- 3.2 change tmee 856z  -->
+
+
+                <xsl:for-each select="marc:datafield[@tag=852]">
+                        <location>
+                                <physicalLocation>
+                                        <xsl:call-template name="displayLabel"></xsl:call-template>
+                                        <xsl:call-template name="subfieldSelect">
+                                                <xsl:with-param name="codes">abje</xsl:with-param>
+                                        </xsl:call-template>
+                                </physicalLocation>
+                        </location>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=506]">
+                        <accessCondition type="restrictionOnAccess">
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">abcd35</xsl:with-param>
+                                </xsl:call-template>
+                        </accessCondition>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=540]">
+                        <accessCondition type="useAndReproduction">
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">abcde35</xsl:with-param>
+                                </xsl:call-template>
+                        </accessCondition>
+                </xsl:for-each>
+                <recordInfo>
+                        <xsl:for-each select="marc:datafield[@tag=040]">
+                                <recordContentSource authority="marcorg">
+                                        <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
+                                </recordContentSource>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:controlfield[@tag=008]">
+                                <recordCreationDate encoding="marc">
+                                        <xsl:value-of select="substring(.,1,6)"></xsl:value-of>
+                                </recordCreationDate>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:controlfield[@tag=005]">
+                                <recordChangeDate encoding="iso8601">
+                                        <xsl:value-of select="."></xsl:value-of>
+                                </recordChangeDate>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:controlfield[@tag=001]">
+                                <recordIdentifier>
+                                        <xsl:if test="../marc:controlfield[@tag=003]">
+                                                <xsl:attribute name="source">
+                                                        <xsl:value-of select="../marc:controlfield[@tag=003]"></xsl:value-of>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                        <xsl:value-of select="."></xsl:value-of>
+                                </recordIdentifier>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=040]/marc:subfield[@code='b']">
+                                <languageOfCataloging>
+                                        <languageTerm authority="iso639-2b" type="code">
+                                                <xsl:value-of select="."></xsl:value-of>
+                                        </languageTerm>
+                                </languageOfCataloging>
+                        </xsl:for-each>
+                </recordInfo>
+        </xsl:template>
+        <xsl:template name="displayForm">
+                <xsl:for-each select="marc:subfield[@code='c']">
+                        <displayForm>
+                                <xsl:value-of select="."></xsl:value-of>
+                        </displayForm>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="affiliation">
+                <xsl:for-each select="marc:subfield[@code='u']">
+                        <affiliation>
+                                <xsl:value-of select="."></xsl:value-of>
+                        </affiliation>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="uri">
+                <xsl:for-each select="marc:subfield[@code='u']">
+                        <xsl:attribute name="xlink:href">
+                                <xsl:value-of select="."></xsl:value-of>
+                        </xsl:attribute>
+                </xsl:for-each>
+                <xsl:for-each select="marc:subfield[@code='0']">
+                        <xsl:choose>
+                                <xsl:when test="contains(text(), ')')">
+                                        <xsl:attribute name="xlink:href">
+                                                <xsl:value-of select="substring-after(text(), ')')"></xsl:value-of>
+                                        </xsl:attribute>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                        <xsl:attribute name="xlink:href">
+                                                <xsl:value-of select="."></xsl:value-of>
+                                        </xsl:attribute>
+                                </xsl:otherwise>
+                        </xsl:choose>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="role">
+                <xsl:for-each select="marc:subfield[@code='e']">
+                        <role>
+                                <roleTerm type="text">
+                                        <xsl:value-of select="."></xsl:value-of>
+                                </roleTerm>
+                        </role>
+                </xsl:for-each>
+                <xsl:for-each select="marc:subfield[@code='4']">
+                        <role>
+                                <roleTerm authority="marcrelator" type="code">
+                                        <xsl:value-of select="."></xsl:value-of>
+                                </roleTerm>
+                        </role>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="part">
+                <xsl:variable name="partNumber">
+                        <xsl:call-template name="specialSubfieldSelect">
+                                <xsl:with-param name="axis">n</xsl:with-param>
+                                <xsl:with-param name="anyCodes">n</xsl:with-param>
+                                <xsl:with-param name="afterCodes">fgkdlmor</xsl:with-param>
+                        </xsl:call-template>
+                </xsl:variable>
+                <xsl:variable name="partName">
+                        <xsl:call-template name="specialSubfieldSelect">
+                                <xsl:with-param name="axis">p</xsl:with-param>
+                                <xsl:with-param name="anyCodes">p</xsl:with-param>
+                                <xsl:with-param name="afterCodes">fgkdlmor</xsl:with-param>
+                        </xsl:call-template>
+                </xsl:variable>
+                <xsl:if test="string-length(normalize-space($partNumber))">
+                        <partNumber>
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString" select="$partNumber"></xsl:with-param>
+                                </xsl:call-template>
+                        </partNumber>
+                </xsl:if>
+                <xsl:if test="string-length(normalize-space($partName))">
+                        <partName>
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString" select="$partName"></xsl:with-param>
+                                </xsl:call-template>
+                        </partName>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="relatedPart">
+                <xsl:if test="@tag=773">
+                        <xsl:for-each select="marc:subfield[@code='g']">
+                                <part>
+                                        <text>
+                                                <xsl:value-of select="."></xsl:value-of>
+                                        </text>
+                                </part>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:subfield[@code='q']">
+                                <part>
+                                        <xsl:call-template name="parsePart"></xsl:call-template>
+                                </part>
+                        </xsl:for-each>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="relatedPartNumName">
+                <xsl:variable name="partNumber">
+                        <xsl:call-template name="specialSubfieldSelect">
+                                <xsl:with-param name="axis">g</xsl:with-param>
+                                <xsl:with-param name="anyCodes">g</xsl:with-param>
+                                <xsl:with-param name="afterCodes">pst</xsl:with-param>
+                        </xsl:call-template>
+                </xsl:variable>
+                <xsl:variable name="partName">
+                        <xsl:call-template name="specialSubfieldSelect">
+                                <xsl:with-param name="axis">p</xsl:with-param>
+                                <xsl:with-param name="anyCodes">p</xsl:with-param>
+                                <xsl:with-param name="afterCodes">fgkdlmor</xsl:with-param>
+                        </xsl:call-template>
+                </xsl:variable>
+                <xsl:if test="string-length(normalize-space($partNumber))">
+                        <partNumber>
+                                <xsl:value-of select="$partNumber"></xsl:value-of>
+                        </partNumber>
+                </xsl:if>
+                <xsl:if test="string-length(normalize-space($partName))">
+                        <partName>
+                                <xsl:value-of select="$partName"></xsl:value-of>
+                        </partName>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="relatedName">
+                <xsl:for-each select="marc:subfield[@code='a']">
+                        <name>
+                                <namePart>
+                                        <xsl:value-of select="."></xsl:value-of>
+                                </namePart>
+                        </name>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedForm">
+                <xsl:for-each select="marc:subfield[@code='h']">
+                        <physicalDescription>
+                                <form>
+                                        <xsl:value-of select="."></xsl:value-of>
+                                </form>
+                        </physicalDescription>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedExtent">
+                <xsl:for-each select="marc:subfield[@code='h']">
+                        <physicalDescription>
+                                <extent>
+                                        <xsl:value-of select="."></xsl:value-of>
+                                </extent>
+                        </physicalDescription>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedNote">
+                <xsl:for-each select="marc:subfield[@code='n']">
+                        <note>
+                                <xsl:value-of select="."></xsl:value-of>
+                        </note>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedSubject">
+                <xsl:for-each select="marc:subfield[@code='j']">
+                        <subject>
+                                <temporal encoding="iso8601">
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString" select="."></xsl:with-param>
+                                        </xsl:call-template>
+                                </temporal>
+                        </subject>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedIdentifierISSN">
+                <xsl:for-each select="marc:subfield[@code='x']">
+                        <identifier type="issn">
+                                <xsl:value-of select="."></xsl:value-of>
+                        </identifier>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedIdentifierLocal">
+                <xsl:for-each select="marc:subfield[@code='w']">
+                        <identifier type="local">
+                                <xsl:value-of select="."></xsl:value-of>
+                        </identifier>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedIdentifier">
+                <xsl:for-each select="marc:subfield[@code='o']">
+                        <identifier>
+                                <xsl:value-of select="."></xsl:value-of>
+                        </identifier>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedItem76X-78X">
+                <xsl:call-template name="displayLabel"></xsl:call-template>
+                <xsl:call-template name="relatedTitle76X-78X"></xsl:call-template>
+                <xsl:call-template name="relatedName"></xsl:call-template>
+                <xsl:call-template name="relatedOriginInfo"></xsl:call-template>
+                <xsl:call-template name="relatedLanguage"></xsl:call-template>
+                <xsl:call-template name="relatedExtent"></xsl:call-template>
+                <xsl:call-template name="relatedNote"></xsl:call-template>
+                <xsl:call-template name="relatedSubject"></xsl:call-template>
+                <xsl:call-template name="relatedIdentifier"></xsl:call-template>
+                <xsl:call-template name="relatedIdentifierISSN"></xsl:call-template>
+                <xsl:call-template name="relatedIdentifierLocal"></xsl:call-template>
+                <xsl:call-template name="relatedPart"></xsl:call-template>
+        </xsl:template>
+        <xsl:template name="subjectGeographicZ">
+                <geographic>
+                        <xsl:call-template name="chopPunctuation">
+                                <xsl:with-param name="chopString" select="."></xsl:with-param>
+                        </xsl:call-template>
+                </geographic>
+        </xsl:template>
+        <xsl:template name="subjectTemporalY">
+                <temporal>
+                        <xsl:call-template name="chopPunctuation">
+                                <xsl:with-param name="chopString" select="."></xsl:with-param>
+                        </xsl:call-template>
+                </temporal>
+        </xsl:template>
+        <xsl:template name="subjectTopic">
+                <topic>
+                        <xsl:call-template name="chopPunctuation">
+                                <xsl:with-param name="chopString" select="."></xsl:with-param>
+                        </xsl:call-template>
+                </topic>
+        </xsl:template>
+        <!-- 3.2 change tmee 6xx $v genre -->
+        <xsl:template name="subjectGenre">
+                <genre>
+                        <xsl:call-template name="chopPunctuation">
+                                <xsl:with-param name="chopString" select="."></xsl:with-param>
+                        </xsl:call-template>
+                </genre>
+        </xsl:template>
+
+        <xsl:template name="nameABCDN">
+                <xsl:for-each select="marc:subfield[@code='a']">
+                        <namePart>
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString" select="."></xsl:with-param>
+                                </xsl:call-template>
+                        </namePart>
+                </xsl:for-each>
+                <xsl:for-each select="marc:subfield[@code='b']">
+                        <namePart>
+                                <xsl:value-of select="."></xsl:value-of>
+                        </namePart>
+                </xsl:for-each>
+                <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
+                        <namePart>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">cdn</xsl:with-param>
+                                </xsl:call-template>
+                        </namePart>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="nameABCDQ">
+                <namePart>
+                        <xsl:call-template name="chopPunctuation">
+                                <xsl:with-param name="chopString">
+                                        <xsl:call-template name="subfieldSelect">
+                                                <xsl:with-param name="codes">aq</xsl:with-param>
+                                        </xsl:call-template>
+                                </xsl:with-param>
+                                <xsl:with-param name="punctuation">
+                                        <xsl:text>:,;/ </xsl:text>
+                                </xsl:with-param>
+                        </xsl:call-template>
+                </namePart>
+                <xsl:call-template name="termsOfAddress"></xsl:call-template>
+                <xsl:call-template name="nameDate"></xsl:call-template>
+        </xsl:template>
+        <xsl:template name="nameACDEQ">
+                <namePart>
+                        <xsl:call-template name="subfieldSelect">
+                                <xsl:with-param name="codes">acdeq</xsl:with-param>
+                        </xsl:call-template>
+                </namePart>
+        </xsl:template>
+        <xsl:template name="constituentOrRelatedType">
+                <xsl:if test="@ind2=2">
+                        <xsl:attribute name="type">constituent</xsl:attribute>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="relatedTitle">
+                <xsl:for-each select="marc:subfield[@code='t']">
+                        <titleInfo>
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="."></xsl:value-of>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                        </titleInfo>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedTitle76X-78X">
+                <xsl:for-each select="marc:subfield[@code='t']">
+                        <titleInfo>
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="."></xsl:value-of>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']">
+                                        <xsl:call-template name="relatedPartNumName"></xsl:call-template>
+                                </xsl:if>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:subfield[@code='p']">
+                        <titleInfo type="abbreviated">
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="."></xsl:value-of>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']">
+                                        <xsl:call-template name="relatedPartNumName"></xsl:call-template>
+                                </xsl:if>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:subfield[@code='s']">
+                        <titleInfo type="uniform">
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="."></xsl:value-of>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']">
+                                        <xsl:call-template name="relatedPartNumName"></xsl:call-template>
+                                </xsl:if>
+                        </titleInfo>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedOriginInfo">
+                <xsl:if test="marc:subfield[@code='b' or @code='d'] or marc:subfield[@code='f']">
+                        <originInfo>
+                                <xsl:if test="@tag=775">
+                                        <xsl:for-each select="marc:subfield[@code='f']">
+                                                <place>
+                                                        <placeTerm>
+                                                                <xsl:attribute name="type">code</xsl:attribute>
+                                                                <xsl:attribute name="authority">marcgac</xsl:attribute>
+                                                                <xsl:value-of select="."></xsl:value-of>
+                                                        </placeTerm>
+                                                </place>
+                                        </xsl:for-each>
+                                </xsl:if>
+                                <xsl:for-each select="marc:subfield[@code='d']">
+                                        <publisher>
+                                                <xsl:value-of select="."></xsl:value-of>
+                                        </publisher>
+                                </xsl:for-each>
+                                <xsl:for-each select="marc:subfield[@code='b']">
+                                        <edition>
+                                                <xsl:value-of select="."></xsl:value-of>
+                                        </edition>
+                                </xsl:for-each>
+                        </originInfo>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="relatedLanguage">
+                <xsl:for-each select="marc:subfield[@code='e']">
+                        <xsl:call-template name="getLanguage">
+                                <xsl:with-param name="langString">
+                                        <xsl:value-of select="."></xsl:value-of>
+                                </xsl:with-param>
+                        </xsl:call-template>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="nameDate">
+                <xsl:for-each select="marc:subfield[@code='d']">
+                        <namePart type="date">
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString" select="."></xsl:with-param>
+                                </xsl:call-template>
+                        </namePart>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="subjectAuthority">
+                <xsl:if test="@ind2!=4">
+                        <xsl:if test="@ind2!=' '">
+                                <xsl:if test="@ind2!=8">
+                                        <xsl:if test="@ind2!=9">
+                                                <xsl:attribute name="authority">
+                                                        <xsl:choose>
+                                                                <xsl:when test="@ind2=0">lcsh</xsl:when>
+                                                                <xsl:when test="@ind2=1">lcshac</xsl:when>
+                                                                <xsl:when test="@ind2=2">mesh</xsl:when>
+                                                                <!-- 1/04 fix -->
+                                                                <xsl:when test="@ind2=3">nal</xsl:when>
+                                                                <xsl:when test="@ind2=5">csh</xsl:when>
+                                                                <xsl:when test="@ind2=6">rvm</xsl:when>
+                                                                <xsl:when test="@ind2=7">
+                                                                        <xsl:value-of select="marc:subfield[@code='2']"></xsl:value-of>
+                                                                </xsl:when>
+                                                        </xsl:choose>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                </xsl:if>
+                        </xsl:if>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="subjectAnyOrder">
+                <xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
+                        <xsl:choose>
+                                <xsl:when test="@code='v'">
+                                        <xsl:call-template name="subjectGenre"></xsl:call-template>
+                                </xsl:when>
+                                <xsl:when test="@code='x'">
+                                        <xsl:call-template name="subjectTopic"></xsl:call-template>
+                                </xsl:when>
+                                <xsl:when test="@code='y'">
+                                        <xsl:call-template name="subjectTemporalY"></xsl:call-template>
+                                </xsl:when>
+                                <xsl:when test="@code='z'">
+                                        <xsl:call-template name="subjectGeographicZ"></xsl:call-template>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="specialSubfieldSelect">
+                <xsl:param name="anyCodes"></xsl:param>
+                <xsl:param name="axis"></xsl:param>
+                <xsl:param name="beforeCodes"></xsl:param>
+                <xsl:param name="afterCodes"></xsl:param>
+                <xsl:variable name="str">
+                        <xsl:for-each select="marc:subfield">
+                                <xsl:if test="contains($anyCodes, @code)      or (contains($beforeCodes, at code) and following-sibling::marc:subfield[@code=$axis])      or (contains($afterCodes, at code) and preceding-sibling::marc:subfield[@code=$axis])">
+                                        <xsl:value-of select="text()"></xsl:value-of>
+                                        <xsl:text> </xsl:text>
+                                </xsl:if>
+                        </xsl:for-each>
+                </xsl:variable>
+                <xsl:value-of select="substring($str,1,string-length($str)-1)"></xsl:value-of>
+        </xsl:template>
+
+        <!-- 3.2 change tmee 6xx $v genre -->
+        <xsl:template match="marc:datafield[@tag=600]">
+                <subject>
+                        <xsl:call-template name="subjectAuthority"></xsl:call-template>
+                        <name type="personal">
+                                <xsl:call-template name="uri" />
+                                <namePart>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">aq</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </namePart>
+                                <xsl:call-template name="termsOfAddress"></xsl:call-template>
+                                <xsl:call-template name="nameDate"></xsl:call-template>
+                                <xsl:call-template name="affiliation"></xsl:call-template>
+                                <xsl:call-template name="role"></xsl:call-template>
+                        </name>
+                        <xsl:call-template name="subjectAnyOrder"></xsl:call-template>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=610]">
+                <subject>
+                        <xsl:call-template name="subjectAuthority"></xsl:call-template>
+                        <name type="corporate">
+                                <xsl:call-template name="uri" />
+                                <xsl:for-each select="marc:subfield[@code='a']">
+                                        <namePart>
+                                                <xsl:value-of select="."></xsl:value-of>
+                                        </namePart>
+                                </xsl:for-each>
+                                <xsl:for-each select="marc:subfield[@code='b']">
+                                        <namePart>
+                                                <xsl:value-of select="."></xsl:value-of>
+                                        </namePart>
+                                </xsl:for-each>
+                                <xsl:if test="marc:subfield[@code='c' or @code='d' or @code='n' or @code='p']">
+                                        <namePart>
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">cdnp</xsl:with-param>
+                                                </xsl:call-template>
+                                        </namePart>
+                                </xsl:if>
+                                <xsl:call-template name="role"></xsl:call-template>
+                        </name>
+                        <xsl:call-template name="subjectAnyOrder"></xsl:call-template>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=611]">
+                <subject>
+                        <xsl:call-template name="subjectAuthority"></xsl:call-template>
+                        <name type="conference">
+                                <xsl:call-template name="uri" />
+                                <namePart>
+                                        <xsl:call-template name="subfieldSelect">
+                                                <xsl:with-param name="codes">abcdeqnp</xsl:with-param>
+                                        </xsl:call-template>
+                                </namePart>
+                                <xsl:for-each select="marc:subfield[@code='4']">
+                                        <role>
+                                                <roleTerm authority="marcrelator" type="code">
+                                                        <xsl:value-of select="."></xsl:value-of>
+                                                </roleTerm>
+                                        </role>
+                                </xsl:for-each>
+                        </name>
+                        <xsl:call-template name="subjectAnyOrder"></xsl:call-template>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=630]">
+                <subject>
+                        <xsl:call-template name="subjectAuthority"></xsl:call-template>
+                        <xsl:variable name="titleChop">
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">adfhklor</xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </xsl:variable>
+                        <titleInfo>
+                                <title>
+                                        <xsl:value-of select="$titleChop" />
+                                </title>
+                                <xsl:call-template name="part"></xsl:call-template>
+                        </titleInfo>
+                        <titleInfo type="nfi">
+                                <xsl:choose>
+                                        <xsl:when test="@ind1>0">
+                                                <nonSort>
+                                                        <xsl:value-of select="substring($titleChop,1, at ind1)"/>
+                                                </nonSort>
+                                                <title>
+                                                        <xsl:value-of select="substring($titleChop, at ind1+1)"/>
+                                                </title>
+                                                <xsl:call-template name="part"/>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <title>
+                                                        <xsl:value-of select="$titleChop" />
+                                                </title>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                                <xsl:call-template name="part"></xsl:call-template>
+                        </titleInfo>
+                        <xsl:call-template name="subjectAnyOrder"></xsl:call-template>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=650]">
+                <subject>
+                        <xsl:call-template name="subjectAuthority"></xsl:call-template>
+                        <topic>
+                                <xsl:call-template name="uri" />
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">abcd</xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </topic>
+                        <xsl:call-template name="subjectAnyOrder"></xsl:call-template>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=651]">
+                <subject>
+                        <xsl:call-template name="subjectAuthority"></xsl:call-template>
+                        <xsl:for-each select="marc:subfield[@code='a']">
+                                <geographic>
+                                        <xsl:call-template name="uri" />
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString" select="."></xsl:with-param>
+                                        </xsl:call-template>
+                                </geographic>
+                        </xsl:for-each>
+                        <xsl:call-template name="subjectAnyOrder"></xsl:call-template>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=653]">
+                <subject>
+                        <xsl:for-each select="marc:subfield[@code='a']">
+                                <topic>
+                                        <xsl:call-template name="uri" />
+                                        <xsl:value-of select="."></xsl:value-of>
+                                </topic>
+                        </xsl:for-each>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=656]">
+                <subject>
+                        <xsl:if test="marc:subfield[@code=2]">
+                                <xsl:attribute name="authority">
+                                        <xsl:value-of select="marc:subfield[@code=2]"></xsl:value-of>
+                                </xsl:attribute>
+                        </xsl:if>
+                        <occupation>
+                                <xsl:call-template name="uri" />
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </occupation>
+                </subject>
+        </xsl:template>
+        <xsl:template name="termsOfAddress">
+                <xsl:if test="marc:subfield[@code='b' or @code='c']">
+                        <namePart type="termsOfAddress">
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">bc</xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </namePart>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="displayLabel">
+                <xsl:if test="marc:subfield[@code='i']">
+                        <xsl:attribute name="displayLabel">
+                                <xsl:value-of select="marc:subfield[@code='i']"></xsl:value-of>
+                        </xsl:attribute>
+                </xsl:if>
+                <xsl:if test="marc:subfield[@code='3']">
+                        <xsl:attribute name="displayLabel">
+                                <xsl:value-of select="marc:subfield[@code='3']"></xsl:value-of>
+                        </xsl:attribute>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="isInvalid">
+                <xsl:param name="type"/>
+                <xsl:if test="marc:subfield[@code='z'] or marc:subfield[@code='y']">
+                        <identifier>
+                                <xsl:attribute name="type">
+                                        <xsl:value-of select="$type"/>
+                                </xsl:attribute>
+                                <xsl:attribute name="invalid">
+                                        <xsl:text>yes</xsl:text>
+                                </xsl:attribute>
+                                <xsl:if test="marc:subfield[@code='z']">
+                                        <xsl:value-of select="marc:subfield[@code='z']"/>
+                                </xsl:if>
+                                <xsl:if test="marc:subfield[@code='y']">
+                                        <xsl:value-of select="marc:subfield[@code='y']"/>
+                                </xsl:if>
+                        </identifier>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="subtitle">
+                <xsl:if test="marc:subfield[@code='b']">
+                        <subTitle>
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:value-of select="marc:subfield[@code='b']"/>
+                                                <!--<xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">b</xsl:with-param>
+                                                </xsl:call-template>-->
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </subTitle>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="script">
+                <xsl:param name="scriptCode"></xsl:param>
+                <xsl:attribute name="script">
+                        <xsl:choose>
+                                <xsl:when test="$scriptCode='(3'">Arabic</xsl:when>
+                                <xsl:when test="$scriptCode='(B'">Latin</xsl:when>
+                                <xsl:when test="$scriptCode='$1'">Chinese, Japanese, Korean</xsl:when>
+                                <xsl:when test="$scriptCode='(N'">Cyrillic</xsl:when>
+                                <xsl:when test="$scriptCode='(2'">Hebrew</xsl:when>
+                                <xsl:when test="$scriptCode='(S'">Greek</xsl:when>
+                        </xsl:choose>
+                </xsl:attribute>
+        </xsl:template>
+        <xsl:template name="parsePart">
+                <!-- assumes 773$q= 1:2:3<4
+                     with up to 3 levels and one optional start page
+                -->
+                <xsl:variable name="level1">
+                        <xsl:choose>
+                                <xsl:when test="contains(text(),':')">
+                                        <!-- 1:2 -->
+                                        <xsl:value-of select="substring-before(text(),':')"></xsl:value-of>
+                                </xsl:when>
+                                <xsl:when test="not(contains(text(),':'))">
+                                        <!-- 1 or 1<3 -->
+                                        <xsl:if test="contains(text(),'<')">
+                                                <!-- 1<3 -->
+                                                <xsl:value-of select="substring-before(text(),'<')"></xsl:value-of>
+                                        </xsl:if>
+                                        <xsl:if test="not(contains(text(),'<'))">
+                                                <!-- 1 -->
+                                                <xsl:value-of select="text()"></xsl:value-of>
+                                        </xsl:if>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="sici2">
+                        <xsl:choose>
+                                <xsl:when test="starts-with(substring-after(text(),$level1),':')">
+                                        <xsl:value-of select="substring(substring-after(text(),$level1),2)"></xsl:value-of>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                        <xsl:value-of select="substring-after(text(),$level1)"></xsl:value-of>
+                                </xsl:otherwise>
+                        </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="level2">
+                        <xsl:choose>
+                                <xsl:when test="contains($sici2,':')">
+                                        <!--  2:3<4  -->
+                                        <xsl:value-of select="substring-before($sici2,':')"></xsl:value-of>
+                                </xsl:when>
+                                <xsl:when test="contains($sici2,'<')">
+                                        <!-- 1: 2<4 -->
+                                        <xsl:value-of select="substring-before($sici2,'<')"></xsl:value-of>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                        <xsl:value-of select="$sici2"></xsl:value-of>
+                                        <!-- 1:2 -->
+                                </xsl:otherwise>
+                        </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="sici3">
+                        <xsl:choose>
+                                <xsl:when test="starts-with(substring-after($sici2,$level2),':')">
+                                        <xsl:value-of select="substring(substring-after($sici2,$level2),2)"></xsl:value-of>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                        <xsl:value-of select="substring-after($sici2,$level2)"></xsl:value-of>
+                                </xsl:otherwise>
+                        </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="level3">
+                        <xsl:choose>
+                                <xsl:when test="contains($sici3,'<')">
+                                        <!-- 2<4 -->
+                                        <xsl:value-of select="substring-before($sici3,'<')"></xsl:value-of>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                        <xsl:value-of select="$sici3"></xsl:value-of>
+                                        <!-- 3 -->
+                                </xsl:otherwise>
+                        </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="page">
+                        <xsl:if test="contains(text(),'<')">
+                                <xsl:value-of select="substring-after(text(),'<')"></xsl:value-of>
+                        </xsl:if>
+                </xsl:variable>
+                <xsl:if test="$level1">
+                        <detail level="1">
+                                <number>
+                                        <xsl:value-of select="$level1"></xsl:value-of>
+                                </number>
+                        </detail>
+                </xsl:if>
+                <xsl:if test="$level2">
+                        <detail level="2">
+                                <number>
+                                        <xsl:value-of select="$level2"></xsl:value-of>
+                                </number>
+                        </detail>
+                </xsl:if>
+                <xsl:if test="$level3">
+                        <detail level="3">
+                                <number>
+                                        <xsl:value-of select="$level3"></xsl:value-of>
+                                </number>
+                        </detail>
+                </xsl:if>
+                <xsl:if test="$page">
+                        <extent unit="page">
+                                <start>
+                                        <xsl:value-of select="$page"></xsl:value-of>
+                                </start>
+                        </extent>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="getLanguage">
+                <xsl:param name="langString"></xsl:param>
+                <xsl:param name="controlField008-35-37"></xsl:param>
+                <xsl:variable name="length" select="string-length($langString)"></xsl:variable>
+                <xsl:choose>
+                        <xsl:when test="$length=0"></xsl:when>
+                        <xsl:when test="$controlField008-35-37=substring($langString,1,3)">
+                                <xsl:call-template name="getLanguage">
+                                        <xsl:with-param name="langString" select="substring($langString,4,$length)"></xsl:with-param>
+                                        <xsl:with-param name="controlField008-35-37" select="$controlField008-35-37"></xsl:with-param>
+                                </xsl:call-template>
+                        </xsl:when>
+                        <xsl:otherwise>
+                                <language>
+                                        <languageTerm authority="iso639-2b" type="code">
+                                                <xsl:value-of select="substring($langString,1,3)"></xsl:value-of>
+                                        </languageTerm>
+                                </language>
+                                <xsl:call-template name="getLanguage">
+                                        <xsl:with-param name="langString" select="substring($langString,4,$length)"></xsl:with-param>
+                                        <xsl:with-param name="controlField008-35-37" select="$controlField008-35-37"></xsl:with-param>
+                                </xsl:call-template>
+                        </xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+        <xsl:template name="isoLanguage">
+                <xsl:param name="currentLanguage"></xsl:param>
+                <xsl:param name="usedLanguages"></xsl:param>
+                <xsl:param name="remainingLanguages"></xsl:param>
+                <xsl:choose>
+                        <xsl:when test="string-length($currentLanguage)=0"></xsl:when>
+                        <xsl:when test="not(contains($usedLanguages, $currentLanguage))">
+                                <language>
+                                        <xsl:if test="@code!='a'">
+                                                <xsl:attribute name="objectPart">
+                                                        <xsl:choose>
+                                                                <xsl:when test="@code='b'">summary or subtitle</xsl:when>
+                                                                <xsl:when test="@code='d'">sung or spoken text</xsl:when>
+                                                                <xsl:when test="@code='e'">libretto</xsl:when>
+                                                                <xsl:when test="@code='f'">table of contents</xsl:when>
+                                                                <xsl:when test="@code='g'">accompanying material</xsl:when>
+                                                                <xsl:when test="@code='h'">translation</xsl:when>
+                                                        </xsl:choose>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                        <languageTerm authority="iso639-2b" type="code">
+                                                <xsl:value-of select="$currentLanguage"></xsl:value-of>
+                                        </languageTerm>
+                                </language>
+                                <xsl:call-template name="isoLanguage">
+                                        <xsl:with-param name="currentLanguage">
+                                                <xsl:value-of select="substring($remainingLanguages,1,3)"></xsl:value-of>
+                                        </xsl:with-param>
+                                        <xsl:with-param name="usedLanguages">
+                                                <xsl:value-of select="concat($usedLanguages,$currentLanguage)"></xsl:value-of>
+                                        </xsl:with-param>
+                                        <xsl:with-param name="remainingLanguages">
+                                                <xsl:value-of select="substring($remainingLanguages,4,string-length($remainingLanguages))"></xsl:value-of>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </xsl:when>
+                        <xsl:otherwise>
+                                <xsl:call-template name="isoLanguage">
+                                        <xsl:with-param name="currentLanguage">
+                                                <xsl:value-of select="substring($remainingLanguages,1,3)"></xsl:value-of>
+                                        </xsl:with-param>
+                                        <xsl:with-param name="usedLanguages">
+                                                <xsl:value-of select="concat($usedLanguages,$currentLanguage)"></xsl:value-of>
+                                        </xsl:with-param>
+                                        <xsl:with-param name="remainingLanguages">
+                                                <xsl:value-of select="substring($remainingLanguages,4,string-length($remainingLanguages))"></xsl:value-of>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+        <xsl:template name="chopBrackets">
+                <xsl:param name="chopString"></xsl:param>
+                <xsl:variable name="string">
+                        <xsl:call-template name="chopPunctuation">
+                                <xsl:with-param name="chopString" select="$chopString"></xsl:with-param>
+                        </xsl:call-template>
+                </xsl:variable>
+                <xsl:if test="substring($string, 1,1)='['">
+                        <xsl:value-of select="substring($string,2, string-length($string)-2)"></xsl:value-of>
+                </xsl:if>
+                <xsl:if test="substring($string, 1,1)!='['">
+                        <xsl:value-of select="$string"></xsl:value-of>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="rfcLanguages">
+                <xsl:param name="nodeNum"></xsl:param>
+                <xsl:param name="usedLanguages"></xsl:param>
+                <xsl:param name="controlField008-35-37"></xsl:param>
+                <xsl:variable name="currentLanguage" select="."></xsl:variable>
+                <xsl:choose>
+                        <xsl:when test="not($currentLanguage)"></xsl:when>
+                        <xsl:when test="$currentLanguage!=$controlField008-35-37 and $currentLanguage!='rfc3066'">
+                                <xsl:if test="not(contains($usedLanguages,$currentLanguage))">
+                                        <language>
+                                                <xsl:if test="@code!='a'">
+                                                        <xsl:attribute name="objectPart">
+                                                                <xsl:choose>
+                                                                        <xsl:when test="@code='b'">summary or subtitle</xsl:when>
+                                                                        <xsl:when test="@code='d'">sung or spoken text</xsl:when>
+                                                                        <xsl:when test="@code='e'">libretto</xsl:when>
+                                                                        <xsl:when test="@code='f'">table of contents</xsl:when>
+                                                                        <xsl:when test="@code='g'">accompanying material</xsl:when>
+                                                                        <xsl:when test="@code='h'">translation</xsl:when>
+                                                                </xsl:choose>
+                                                        </xsl:attribute>
+                                                </xsl:if>
+                                                <languageTerm authority="rfc3066" type="code">
+                                                        <xsl:value-of select="$currentLanguage"/>
+                                                </languageTerm>
+                                        </language>
+                                </xsl:if>
+                        </xsl:when>
+                        <xsl:otherwise>
+                        </xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+        <xsl:template name="datafield">
+                <xsl:param name="tag"/>
+                <xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
+                <xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param>
+                <xsl:param name="subfields"/>
+                <xsl:element name="marc:datafield">
+                        <xsl:attribute name="tag">
+                                <xsl:value-of select="$tag"/>
+                        </xsl:attribute>
+                        <xsl:attribute name="ind1">
+                                <xsl:value-of select="$ind1"/>
+                        </xsl:attribute>
+                        <xsl:attribute name="ind2">
+                                <xsl:value-of select="$ind2"/>
+                        </xsl:attribute>
+                        <xsl:copy-of select="$subfields"/>
+                </xsl:element>
+        </xsl:template>
+
+        <xsl:template name="subfieldSelect">
+                <xsl:param name="codes"/>
+                <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
+                <xsl:variable name="str">
+                        <xsl:for-each select="marc:subfield">
+                                <xsl:if test="contains($codes, @code)">
+                                        <xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/>
+                                </xsl:if>
+                        </xsl:for-each>
+                </xsl:variable>
+                <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
+        </xsl:template>
+
+        <xsl:template name="buildSpaces">
+                <xsl:param name="spaces"/>
+                <xsl:param name="char"><xsl:text> </xsl:text></xsl:param>
+                <xsl:if test="$spaces>0">
+                        <xsl:value-of select="$char"/>
+                        <xsl:call-template name="buildSpaces">
+                                <xsl:with-param name="spaces" select="$spaces - 1"/>
+                                <xsl:with-param name="char" select="$char"/>
+                        </xsl:call-template>
+                </xsl:if>
+        </xsl:template>
+
+        <xsl:template name="chopPunctuation">
+                <xsl:param name="chopString"/>
+                <xsl:param name="punctuation"><xsl:text>.:,;/ </xsl:text></xsl:param>
+                <xsl:variable name="length" select="string-length($chopString)"/>
+                <xsl:choose>
+                        <xsl:when test="$length=0"/>
+                        <xsl:when test="contains($punctuation, substring($chopString,$length,1))">
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
+                                        <xsl:with-param name="punctuation" select="$punctuation"/>
+                                </xsl:call-template>
+                        </xsl:when>
+                        <xsl:when test="not($chopString)"/>
+                        <xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+
+        <xsl:template name="chopPunctuationFront">
+                <xsl:param name="chopString"/>
+                <xsl:variable name="length" select="string-length($chopString)"/>
+                <xsl:choose>
+                        <xsl:when test="$length=0"/>
+                        <xsl:when test="contains('.:,;/[ ', substring($chopString,1,1))">
+                                <xsl:call-template name="chopPunctuationFront">
+                                        <xsl:with-param name="chopString" select="substring($chopString,2,$length - 1)"/>
+                                </xsl:call-template>
+                        </xsl:when>
+                        <xsl:when test="not($chopString)"/>
+                        <xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+</xsl:stylesheet>$XXXX$ where name = $$mods32$$;
+
+update config.xml_transform set xslt = $XXXX$<xsl:stylesheet xmlns="http://www.loc.gov/mods/v3" xmlns:marc="http://www.loc.gov/MARC21/slim"
+        xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+        exclude-result-prefixes="xlink marc" version="1.0">
+        <xsl:output encoding="UTF-8" indent="yes" method="xml"/>
+
+        <xsl:variable name="ascii">
+                <xsl:text> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~</xsl:text>
+        </xsl:variable>
+
+        <xsl:variable name="latin1">
+                <xsl:text> ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ</xsl:text>
+        </xsl:variable>
+        <!-- Characters that usually don't need to be escaped -->
+        <xsl:variable name="safe">
+                <xsl:text>!'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~</xsl:text>
+        </xsl:variable>
+
+        <xsl:variable name="hex">0123456789ABCDEF</xsl:variable>
+
+    <!-- Evergreen specific: revert Revision 1.23, so we can have those authority xlink attributes back. -->
+
+        <!--MARC21slim2MODS3-3.xsl
+Revision 1.27 - Mapped 648 to <subject> 2009/03/13 tmee
+Revision 1.26 - Added subfield $s mapping for 130/240/730  2008/10/16 tmee
+Revision 1.25 - Mapped 040e to <descriptiveStandard> and Leader/18 to <descriptive standard>aacr2  2008/09/18 tmee
+Revision 1.24 - Mapped 852 subfields $h, $i, $j, $k, $l, $m, $t to <shelfLocation> and 852 subfield $u to <physicalLocation> with @xlink 2008/09/17 tmee
+Revision 1.23 - Commented out xlink/uri for subfield 0 for 130/240/730, 100/700, 110/710, 111/711 as these are currently unactionable  2008/09/17  tmee
+Revision 1.22 - Mapped 022 subfield $l to type "issn-l" subfield $m to output identifier element with corresponding @type and @invalid eq 'yes'2008/09/17  tmee
+Revision 1.21 - Mapped 856 ind2=1 or ind2=2 to <relatedItem><location><url>  2008/07/03  tmee
+Revision 1.20 - Added genre w/@auth="contents of 2" and type= "musical composition"  2008/07/01  tmee
+Revision 1.19 - Added genre offprint for 008/24+ BK code 2  2008/07/01  tmee
+Revision 1.18 - Added xlink/uri for subfield 0 for 130/240/730, 100/700, 110/710, 111/711  2008/06/26  tmee
+Revision 1.17 - Added mapping of 662 2008/05/14 tmee
+Revision 1.16 - Changed @authority from "marc" to "marcgt" for 007 and 008 codes mapped to a term in <genre> 2007/07/10  tmee
+Revision 1.15 - For field 630, moved call to part template outside title element  2007/07/10  tmee
+Revision 1.14 - Fixed template isValid and fields 010, 020, 022, 024, 028, and 037 to output additional identifier elements with corresponding @type and @invalid eq 'yes' when subfields z or y (in the case of 022) exist in the MARCXML ::: 2007/01/04 17:35:20 cred
+Revision 1.13 - Changed order of output under cartographics to reflect schema  2006/11/28  tmee
+Revision 1.12 - Updated to reflect MODS 3.2 Mapping  2006/10/11  tmee
+Revision 1.11 - The attribute objectPart moved from <languageTerm> to <language>  2006/04/08  jrad
+Revision 1.10 - MODS 3.1 revisions to language and classification elements  (plus ability to find marc:collection embedded in wrapper elements such as SRU zs: wrappers)  2006/02/06  ggar
+Revision 1.9 - Subfield $y was added to field 242 2004/09/02 10:57 jrad
+Revision 1.8 - Subject chopPunctuation expanded and attribute fixes 2004/08/12 jrad
+Revision 1.7 - 2004/03/25 08:29 jrad
+Revision 1.6 - Various validation fixes 2004/02/20 ntra
+Revision 1.5 - MODS2 to MODS3 updates, language unstacking and de-duping, chopPunctuation expanded  2003/10/02 16:18:58  ntra
+Revision 1.3 - Additional Changes not related to MODS Version 2.0 by ntra
+Revision 1.2 - Added Log Comment  2003/03/24 19:37:42  ckeith
+-->
+        <xsl:template match="/">
+                <xsl:choose>
+                        <xsl:when test="//marc:collection">
+                                <modsCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                                        xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-2.xsd">
+                                        <xsl:for-each select="//marc:collection/marc:record">
+                                                <mods version="3.3">
+                                                        <xsl:call-template name="marcRecord"/>
+                                                </mods>
+                                        </xsl:for-each>
+                                </modsCollection>
+                        </xsl:when>
+                        <xsl:otherwise>
+                                <mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.3"
+                                        xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-2.xsd">
+                                        <xsl:for-each select="//marc:record">
+                                                <xsl:call-template name="marcRecord"/>
+                                        </xsl:for-each>
+                                </mods>
+                        </xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+        <xsl:template name="marcRecord">
+                <xsl:variable name="leader" select="marc:leader"/>
+                <xsl:variable name="leader6" select="substring($leader,7,1)"/>
+                <xsl:variable name="leader7" select="substring($leader,8,1)"/>
+                <xsl:variable name="controlField008" select="marc:controlfield[@tag='008']"/>
+                <xsl:variable name="typeOf008">
+                        <xsl:choose>
+                                <xsl:when test="$leader6='a'">
+                                        <xsl:choose>
+                                                <xsl:when
+                                                        test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
+                                                <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">SE</xsl:when>
+                                        </xsl:choose>
+                                </xsl:when>
+                                <xsl:when test="$leader6='t'">BK</xsl:when>
+                                <xsl:when test="$leader6='p'">MM</xsl:when>
+                                <xsl:when test="$leader6='m'">CF</xsl:when>
+                                <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
+                                <xsl:when test="$leader6='g' or $leader6='k' or $leader6='o' or $leader6='r'">VM</xsl:when>
+                                <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'"
+                                >MU</xsl:when>
+                        </xsl:choose>
+                </xsl:variable>
+                <xsl:for-each select="marc:datafield[@tag='245']">
+                        <titleInfo>
+                                <xsl:variable name="title">
+                                        <xsl:choose>
+                                                <xsl:when test="marc:subfield[@code='b']">
+                                                        <xsl:call-template name="specialSubfieldSelect">
+                                                                <xsl:with-param name="axis">b</xsl:with-param>
+                                                                <xsl:with-param name="beforeCodes">afgk</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:when>
+                                                <xsl:otherwise>
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">abfgk</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:otherwise>
+                                        </xsl:choose>
+                                </xsl:variable>
+                                <xsl:variable name="titleChop">
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="$title"/>
+                                                </xsl:with-param>
+                                                <xsl:with-param name="punctuation">
+                                                    <xsl:text>,;/ </xsl:text>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </xsl:variable>
+                                <xsl:choose>
+                                        <xsl:when test="@ind2>0">
+                                                <nonSort>
+                                                        <xsl:value-of select="substring($titleChop,1, at ind2)"/>
+                                                </nonSort>
+                                                <title>
+                                                        <xsl:value-of select="substring($titleChop, at ind2+1)"/>
+                                                </title>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <title>
+                                                        <xsl:value-of select="$titleChop"/>
+                                                </title>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                                <xsl:if test="marc:subfield[@code='b']">
+                                        <subTitle>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="axis">b</xsl:with-param>
+                                                                        <xsl:with-param name="anyCodes">b</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">afgk</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </subTitle>
+                                </xsl:if>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='210']">
+                        <titleInfo type="abbreviated">
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">a</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:call-template name="subtitle"/>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='242']">
+                        <titleInfo type="translated">
+                                <!--09/01/04 Added subfield $y-->
+                                <xsl:for-each select="marc:subfield[@code='y']">
+                                        <xsl:attribute name="lang">
+                                                <xsl:value-of select="text()"/>
+                                        </xsl:attribute>
+                                </xsl:for-each>
+                                <xsl:for-each select="marc:subfield[@code='i']">
+                                        <xsl:attribute name="displayLabel">
+                                                <xsl:value-of select="text()"/>
+                                        </xsl:attribute>
+                                </xsl:for-each>
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <!-- 1/04 removed $h, b -->
+                                                                <xsl:with-param name="codes">a</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <!-- 1/04 fix -->
+                                <xsl:call-template name="subtitle"/>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='246']">
+                        <titleInfo type="alternative">
+                                <xsl:for-each select="marc:subfield[@code='i']">
+                                        <xsl:attribute name="displayLabel">
+                                                <xsl:value-of select="text()"/>
+                                        </xsl:attribute>
+                                </xsl:for-each>
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <!-- 1/04 removed $h, $b -->
+                                                                <xsl:with-param name="codes">af</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:call-template name="subtitle"/>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each
+                        select="marc:datafield[@tag='130']|marc:datafield[@tag='240']|marc:datafield[@tag='730'][@ind2!='2']">
+                        <titleInfo type="uniform">
+                                <title>
+                                                <xsl:call-template name="uri"/>
+
+                                        <xsl:variable name="str">
+                                                <xsl:for-each select="marc:subfield">
+                                                        <xsl:if
+                                                                test="(contains('adfklmors', at code) and (not(../marc:subfield[@code='n' or @code='p']) or (following-sibling::marc:subfield[@code='n' or @code='p'])))">
+                                                                <xsl:value-of select="text()"/>
+                                                                <xsl:text> </xsl:text>
+                                                        </xsl:if>
+                                                </xsl:for-each>
+                                        </xsl:variable>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='740'][@ind2!='2']">
+                        <titleInfo type="alternative">
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">ah</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='100']">
+                        <name type="personal">
+
+                                <xsl:call-template name="uri"/>
+
+                                <xsl:call-template name="nameABCDQ"/>
+                                <xsl:call-template name="affiliation"/>
+                                <role>
+                                        <roleTerm authority="marcrelator" type="text">creator</roleTerm>
+                                </role>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='110']">
+                        <name type="corporate">
+
+                                        <xsl:call-template name="uri"/>
+
+                                <xsl:call-template name="nameABCDN"/>
+                                <role>
+                                        <roleTerm authority="marcrelator" type="text">creator</roleTerm>
+                                </role>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='111']">
+                        <name type="conference">
+
+                                        <xsl:call-template name="uri"/>
+
+                                <xsl:call-template name="nameACDEQ"/>
+                                <role>
+                                        <roleTerm authority="marcrelator" type="text">creator</roleTerm>
+                                </role>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='700'][not(marc:subfield[@code='t'])]">
+                        <name type="personal">
+
+                                        <xsl:call-template name="uri"/>
+
+                                <xsl:call-template name="nameABCDQ"/>
+                                <xsl:call-template name="affiliation"/>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='710'][not(marc:subfield[@code='t'])]">
+                        <name type="corporate">
+
+                                        <xsl:call-template name="uri"/>
+
+                                <xsl:call-template name="nameABCDN"/>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='711'][not(marc:subfield[@code='t'])]">
+                        <name type="conference">
+
+                                        <xsl:call-template name="uri"/>
+
+                                <xsl:call-template name="nameACDEQ"/>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='720'][not(marc:subfield[@code='t'])]">
+                        <name>
+                                <xsl:if test="@ind1=1">
+                                        <xsl:attribute name="type">
+                                                <xsl:text>personal</xsl:text>
+                                        </xsl:attribute>
+                                </xsl:if>
+                                <namePart>
+                                        <xsl:value-of select="marc:subfield[@code='a']"/>
+                                </namePart>
+                                <xsl:call-template name="role"/>
+                        </name>
+                </xsl:for-each>
+                <typeOfResource>
+                        <xsl:if test="$leader7='c'">
+                                <xsl:attribute name="collection">yes</xsl:attribute>
+                        </xsl:if>
+                        <xsl:if test="$leader6='d' or $leader6='f' or $leader6='p' or $leader6='t'">
+                                <xsl:attribute name="manuscript">yes</xsl:attribute>
+                        </xsl:if>
+                        <xsl:choose>
+                                <xsl:when test="$leader6='a' or $leader6='t'">text</xsl:when>
+                                <xsl:when test="$leader6='e' or $leader6='f'">cartographic</xsl:when>
+                                <xsl:when test="$leader6='c' or $leader6='d'">notated music</xsl:when>
+                                <xsl:when test="$leader6='i'">sound recording-nonmusical</xsl:when>
+                                <xsl:when test="$leader6='j'">sound recording-musical</xsl:when>
+                                <xsl:when test="$leader6='k'">still image</xsl:when>
+                                <xsl:when test="$leader6='g'">moving image</xsl:when>
+                                <xsl:when test="$leader6='r'">three dimensional object</xsl:when>
+                                <xsl:when test="$leader6='m'">software, multimedia</xsl:when>
+                                <xsl:when test="$leader6='p'">mixed material</xsl:when>
+                        </xsl:choose>
+                </typeOfResource>
+                <xsl:if test="substring($controlField008,26,1)='d'">
+                        <genre authority="marcgt">globe</genre>
+                </xsl:if>
+                <xsl:if
+                        test="marc:controlfield[@tag='007'][substring(text(),1,1)='a'][substring(text(),2,1)='r']">
+                        <genre authority="marcgt">remote-sensing image</genre>
+                </xsl:if>
+                <xsl:if test="$typeOf008='MP'">
+                        <xsl:variable name="controlField008-25" select="substring($controlField008,26,1)"/>
+                        <xsl:choose>
+                                <xsl:when
+                                        test="$controlField008-25='a' or $controlField008-25='b' or $controlField008-25='c' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='j']">
+                                        <genre authority="marcgt">map</genre>
+                                </xsl:when>
+                                <xsl:when
+                                        test="$controlField008-25='e' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='d']">
+                                        <genre authority="marcgt">atlas</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:if test="$typeOf008='SE'">
+                        <xsl:variable name="controlField008-21" select="substring($controlField008,22,1)"/>
+                        <xsl:choose>
+                                <xsl:when test="$controlField008-21='d'">
+                                        <genre authority="marcgt">database</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-21='l'">
+                                        <genre authority="marcgt">loose-leaf</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-21='m'">
+                                        <genre authority="marcgt">series</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-21='n'">
+                                        <genre authority="marcgt">newspaper</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-21='p'">
+                                        <genre authority="marcgt">periodical</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-21='w'">
+                                        <genre authority="marcgt">web site</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:if test="$typeOf008='BK' or $typeOf008='SE'">
+                        <xsl:variable name="controlField008-24" select="substring($controlField008,25,4)"/>
+                        <xsl:choose>
+                                <xsl:when test="contains($controlField008-24,'a')">
+                                        <genre authority="marcgt">abstract or summary</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'b')">
+                                        <genre authority="marcgt">bibliography</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'c')">
+                                        <genre authority="marcgt">catalog</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'d')">
+                                        <genre authority="marcgt">dictionary</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'e')">
+                                        <genre authority="marcgt">encyclopedia</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'f')">
+                                        <genre authority="marcgt">handbook</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'g')">
+                                        <genre authority="marcgt">legal article</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'i')">
+                                        <genre authority="marcgt">index</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'k')">
+                                        <genre authority="marcgt">discography</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'l')">
+                                        <genre authority="marcgt">legislation</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'m')">
+                                        <genre authority="marcgt">theses</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'n')">
+                                        <genre authority="marcgt">survey of literature</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'o')">
+                                        <genre authority="marcgt">review</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'p')">
+                                        <genre authority="marcgt">programmed text</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'q')">
+                                        <genre authority="marcgt">filmography</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'r')">
+                                        <genre authority="marcgt">directory</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'s')">
+                                        <genre authority="marcgt">statistics</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'t')">
+                                        <genre authority="marcgt">technical report</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'v')">
+                                        <genre authority="marcgt">legal case and case notes</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'w')">
+                                        <genre authority="marcgt">law report or digest</genre>
+                                </xsl:when>
+                                <xsl:when test="contains($controlField008-24,'z')">
+                                        <genre authority="marcgt">treaty</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                        <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
+                        <xsl:choose>
+                                <xsl:when test="$controlField008-29='1'">
+                                        <genre authority="marcgt">conference publication</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:if test="$typeOf008='CF'">
+                        <xsl:variable name="controlField008-26" select="substring($controlField008,27,1)"/>
+                        <xsl:choose>
+                                <xsl:when test="$controlField008-26='a'">
+                                        <genre authority="marcgt">numeric data</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-26='e'">
+                                        <genre authority="marcgt">database</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-26='f'">
+                                        <genre authority="marcgt">font</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-26='g'">
+                                        <genre authority="marcgt">game</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:if test="$typeOf008='BK'">
+                        <xsl:if test="substring($controlField008,25,1)='j'">
+                                <genre authority="marcgt">patent</genre>
+                        </xsl:if>
+                        <xsl:if test="substring($controlField008,25,1)='2'">
+                                <genre authority="marcgt">offprint</genre>
+                        </xsl:if>
+                        <xsl:if test="substring($controlField008,31,1)='1'">
+                                <genre authority="marcgt">festschrift</genre>
+                        </xsl:if>
+                        <xsl:variable name="controlField008-34" select="substring($controlField008,35,1)"/>
+                        <xsl:if
+                                test="$controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'">
+                                <genre authority="marcgt">biography</genre>
+                        </xsl:if>
+                        <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
+                        <xsl:choose>
+                                <xsl:when test="$controlField008-33='e'">
+                                        <genre authority="marcgt">essay</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='d'">
+                                        <genre authority="marcgt">drama</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='c'">
+                                        <genre authority="marcgt">comic strip</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='l'">
+                                        <genre authority="marcgt">fiction</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='h'">
+                                        <genre authority="marcgt">humor, satire</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='i'">
+                                        <genre authority="marcgt">letter</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='f'">
+                                        <genre authority="marcgt">novel</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='j'">
+                                        <genre authority="marcgt">short story</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='s'">
+                                        <genre authority="marcgt">speech</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:if test="$typeOf008='MU'">
+                        <xsl:variable name="controlField008-30-31" select="substring($controlField008,31,2)"/>
+                        <xsl:if test="contains($controlField008-30-31,'b')">
+                                <genre authority="marcgt">biography</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'c')">
+                                <genre authority="marcgt">conference publication</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'d')">
+                                <genre authority="marcgt">drama</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'e')">
+                                <genre authority="marcgt">essay</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'f')">
+                                <genre authority="marcgt">fiction</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'o')">
+                                <genre authority="marcgt">folktale</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'h')">
+                                <genre authority="marcgt">history</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'k')">
+                                <genre authority="marcgt">humor, satire</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'m')">
+                                <genre authority="marcgt">memoir</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'p')">
+                                <genre authority="marcgt">poetry</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'r')">
+                                <genre authority="marcgt">rehearsal</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'g')">
+                                <genre authority="marcgt">reporting</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'s')">
+                                <genre authority="marcgt">sound</genre>
+                        </xsl:if>
+                        <xsl:if test="contains($controlField008-30-31,'l')">
+                                <genre authority="marcgt">speech</genre>
+                        </xsl:if>
+                </xsl:if>
+                <xsl:if test="$typeOf008='VM'">
+                        <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
+                        <xsl:choose>
+                                <xsl:when test="$controlField008-33='a'">
+                                        <genre authority="marcgt">art original</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='b'">
+                                        <genre authority="marcgt">kit</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='c'">
+                                        <genre authority="marcgt">art reproduction</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='d'">
+                                        <genre authority="marcgt">diorama</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='f'">
+                                        <genre authority="marcgt">filmstrip</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='g'">
+                                        <genre authority="marcgt">legal article</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='i'">
+                                        <genre authority="marcgt">picture</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='k'">
+                                        <genre authority="marcgt">graphic</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='l'">
+                                        <genre authority="marcgt">technical drawing</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='m'">
+                                        <genre authority="marcgt">motion picture</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='n'">
+                                        <genre authority="marcgt">chart</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='o'">
+                                        <genre authority="marcgt">flash card</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='p'">
+                                        <genre authority="marcgt">microscope slide</genre>
+                                </xsl:when>
+                                <xsl:when
+                                        test="$controlField008-33='q' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
+                                        <genre authority="marcgt">model</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='r'">
+                                        <genre authority="marcgt">realia</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='s'">
+                                        <genre authority="marcgt">slide</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='t'">
+                                        <genre authority="marcgt">transparency</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='v'">
+                                        <genre authority="marcgt">videorecording</genre>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-33='w'">
+                                        <genre authority="marcgt">toy</genre>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+
+                <!-- 1.20 047 genre tmee-->
+
+                <xsl:for-each select="marc:datafield[@tag=047]">
+                        <genre authority="marcgt">
+                                <xsl:attribute name="authority">
+                                        <xsl:value-of select="marc:subfield[@code='2']"/>
+                                </xsl:attribute>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">abcdef</xsl:with-param>
+                                        <xsl:with-param name="delimeter">-</xsl:with-param>
+                                </xsl:call-template>
+                        </genre>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=655]">
+                        <genre authority="marcgt">
+                                <xsl:attribute name="authority">
+                                        <xsl:value-of select="marc:subfield[@code='2']"/>
+                                </xsl:attribute>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">abvxyz</xsl:with-param>
+                                        <xsl:with-param name="delimeter">-</xsl:with-param>
+                                </xsl:call-template>
+                        </genre>
+                </xsl:for-each>
+                <originInfo>
+                        <xsl:variable name="MARCpublicationCode"
+                                select="normalize-space(substring($controlField008,16,3))"/>
+                        <xsl:if test="translate($MARCpublicationCode,'|','')">
+                                <place>
+                                        <placeTerm>
+                                                <xsl:attribute name="type">code</xsl:attribute>
+                                                <xsl:attribute name="authority">marccountry</xsl:attribute>
+                                                <xsl:value-of select="$MARCpublicationCode"/>
+                                        </placeTerm>
+                                </place>
+                        </xsl:if>
+                        <xsl:for-each select="marc:datafield[@tag=044]/marc:subfield[@code='c']">
+                                <place>
+                                        <placeTerm>
+                                                <xsl:attribute name="type">code</xsl:attribute>
+                                                <xsl:attribute name="authority">iso3166</xsl:attribute>
+                                                <xsl:value-of select="."/>
+                                        </placeTerm>
+                                </place>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=260]/marc:subfield[@code='a']">
+                                <place>
+                                        <placeTerm>
+                                                <xsl:attribute name="type">text</xsl:attribute>
+                                                <xsl:call-template name="chopPunctuationFront">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="chopPunctuation">
+                                                                        <xsl:with-param name="chopString" select="."/>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </placeTerm>
+                                </place>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='m']">
+                                <dateValid point="start">
+                                        <xsl:value-of select="."/>
+                                </dateValid>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='n']">
+                                <dateValid point="end">
+                                        <xsl:value-of select="."/>
+                                </dateValid>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='j']">
+                                <dateModified>
+                                        <xsl:value-of select="."/>
+                                </dateModified>
+                        </xsl:for-each>
+                        <xsl:for-each
+                                select="marc:datafield[@tag=260]/marc:subfield[@code='b' or @code='c' or @code='g']">
+                                <xsl:choose>
+                                        <xsl:when test="@code='b'">
+                                                <publisher>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."/>
+                                                                <xsl:with-param name="punctuation">
+                                                                        <xsl:text>:,;/ </xsl:text>
+                                                                </xsl:with-param>
+                                                        </xsl:call-template>
+                                                </publisher>
+                                        </xsl:when>
+                                        <xsl:when test="@code='c'">
+                                                <dateIssued>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."/>
+                                                        </xsl:call-template>
+                                                </dateIssued>
+                                        </xsl:when>
+                                        <xsl:when test="@code='g'">
+                                                <dateCreated>
+                                                        <xsl:value-of select="."/>
+                                                </dateCreated>
+                                        </xsl:when>
+                                </xsl:choose>
+                        </xsl:for-each>
+                        <xsl:variable name="dataField260c">
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString"
+                                                select="marc:datafield[@tag=260]/marc:subfield[@code='c']"/>
+                                </xsl:call-template>
+                        </xsl:variable>
+                        <xsl:variable name="controlField008-7-10"
+                                select="normalize-space(substring($controlField008, 8, 4))"/>
+                        <xsl:variable name="controlField008-11-14"
+                                select="normalize-space(substring($controlField008, 12, 4))"/>
+                        <xsl:variable name="controlField008-6"
+                                select="normalize-space(substring($controlField008, 7, 1))"/>
+                        <xsl:if
+                                test="$controlField008-6='e' or $controlField008-6='p' or $controlField008-6='r' or $controlField008-6='t' or $controlField008-6='s'">
+                                <xsl:if test="$controlField008-7-10 and ($controlField008-7-10 != $dataField260c)">
+                                        <dateIssued encoding="marc">
+                                                <xsl:value-of select="$controlField008-7-10"/>
+                                        </dateIssued>
+                                </xsl:if>
+                        </xsl:if>
+                        <xsl:if
+                                test="$controlField008-6='c' or $controlField008-6='d' or $controlField008-6='i' or $controlField008-6='k' or $controlField008-6='m' or $controlField008-6='q' or $controlField008-6='u'">
+                                <xsl:if test="$controlField008-7-10">
+                                        <dateIssued encoding="marc" point="start">
+                                                <xsl:value-of select="$controlField008-7-10"/>
+                                        </dateIssued>
+                                </xsl:if>
+                        </xsl:if>
+                        <xsl:if
+                                test="$controlField008-6='c' or $controlField008-6='d' or $controlField008-6='i' or $controlField008-6='k' or $controlField008-6='m' or $controlField008-6='q' or $controlField008-6='u'">
+                                <xsl:if test="$controlField008-11-14">
+                                        <dateIssued encoding="marc" point="end">
+                                                <xsl:value-of select="$controlField008-11-14"/>
+                                        </dateIssued>
+                                </xsl:if>
+                        </xsl:if>
+                        <xsl:if test="$controlField008-6='q'">
+                                <xsl:if test="$controlField008-7-10">
+                                        <dateIssued encoding="marc" point="start" qualifier="questionable">
+                                                <xsl:value-of select="$controlField008-7-10"/>
+                                        </dateIssued>
+                                </xsl:if>
+                        </xsl:if>
+                        <xsl:if test="$controlField008-6='q'">
+                                <xsl:if test="$controlField008-11-14">
+                                        <dateIssued encoding="marc" point="end" qualifier="questionable">
+                                                <xsl:value-of select="$controlField008-11-14"/>
+                                        </dateIssued>
+                                </xsl:if>
+                        </xsl:if>
+                        <xsl:if test="$controlField008-6='t'">
+                                <xsl:if test="$controlField008-11-14">
+                                        <copyrightDate encoding="marc">
+                                                <xsl:value-of select="$controlField008-11-14"/>
+                                        </copyrightDate>
+                                </xsl:if>
+                        </xsl:if>
+                        <xsl:for-each
+                                select="marc:datafield[@tag=033][@ind1=0 or @ind1=1]/marc:subfield[@code='a']">
+                                <dateCaptured encoding="iso8601">
+                                        <xsl:value-of select="."/>
+                                </dateCaptured>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=033][@ind1=2]/marc:subfield[@code='a'][1]">
+                                <dateCaptured encoding="iso8601" point="start">
+                                        <xsl:value-of select="."/>
+                                </dateCaptured>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=033][@ind1=2]/marc:subfield[@code='a'][2]">
+                                <dateCaptured encoding="iso8601" point="end">
+                                        <xsl:value-of select="."/>
+                                </dateCaptured>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=250]/marc:subfield[@code='a']">
+                                <edition>
+                                        <xsl:value-of select="."/>
+                                </edition>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:leader">
+                                <issuance>
+                                        <xsl:choose>
+                                                <xsl:when
+                                                        test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'"
+                                                        >monographic</xsl:when>
+                                                <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'"
+                                                >continuing</xsl:when>
+                                        </xsl:choose>
+                                </issuance>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=310]|marc:datafield[@tag=321]">
+                                <frequency>
+                                        <xsl:call-template name="subfieldSelect">
+                                                <xsl:with-param name="codes">ab</xsl:with-param>
+                                        </xsl:call-template>
+                                </frequency>
+                        </xsl:for-each>
+                </originInfo>
+                <xsl:variable name="controlField008-35-37"
+                        select="normalize-space(translate(substring($controlField008,36,3),'|#',''))"/>
+                <xsl:if test="$controlField008-35-37">
+                        <language>
+                                <languageTerm authority="iso639-2b" type="code">
+                                        <xsl:value-of select="substring($controlField008,36,3)"/>
+                                </languageTerm>
+                        </language>
+                </xsl:if>
+                <xsl:for-each select="marc:datafield[@tag=041]">
+                        <xsl:for-each
+                                select="marc:subfield[@code='a' or @code='b' or @code='d' or @code='e' or @code='f' or @code='g' or @code='h']">
+                                <xsl:variable name="langCodes" select="."/>
+                                <xsl:choose>
+                                        <xsl:when test="../marc:subfield[@code='2']='rfc3066'">
+                                                <!-- not stacked but could be repeated -->
+                                                <xsl:call-template name="rfcLanguages">
+                                                        <xsl:with-param name="nodeNum">
+                                                                <xsl:value-of select="1"/>
+                                                        </xsl:with-param>
+                                                        <xsl:with-param name="usedLanguages">
+                                                                <xsl:text/>
+                                                        </xsl:with-param>
+                                                        <xsl:with-param name="controlField008-35-37">
+                                                                <xsl:value-of select="$controlField008-35-37"/>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <!-- iso -->
+                                                <xsl:variable name="allLanguages">
+                                                        <xsl:copy-of select="$langCodes"/>
+                                                </xsl:variable>
+                                                <xsl:variable name="currentLanguage">
+                                                        <xsl:value-of select="substring($allLanguages,1,3)"/>
+                                                </xsl:variable>
+                                                <xsl:call-template name="isoLanguage">
+                                                        <xsl:with-param name="currentLanguage">
+                                                                <xsl:value-of select="substring($allLanguages,1,3)"/>
+                                                        </xsl:with-param>
+                                                        <xsl:with-param name="remainingLanguages">
+                                                                <xsl:value-of
+                                                                        select="substring($allLanguages,4,string-length($allLanguages)-3)"
+                                                                />
+                                                        </xsl:with-param>
+                                                        <xsl:with-param name="usedLanguages">
+                                                                <xsl:if test="$controlField008-35-37">
+                                                                        <xsl:value-of select="$controlField008-35-37"/>
+                                                                </xsl:if>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                        </xsl:for-each>
+                </xsl:for-each>
+                <xsl:variable name="physicalDescription">
+                        <!--3.2 change tmee 007/11 -->
+                        <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='a']">
+                                <digitalOrigin>reformatted digital</digitalOrigin>
+                        </xsl:if>
+                        <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='b']">
+                                <digitalOrigin>digitized microfilm</digitalOrigin>
+                        </xsl:if>
+                        <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='d']">
+                                <digitalOrigin>digitized other analog</digitalOrigin>
+                        </xsl:if>
+                        <xsl:variable name="controlField008-23" select="substring($controlField008,24,1)"/>
+                        <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
+                        <xsl:variable name="check008-23">
+                                <xsl:if
+                                        test="$typeOf008='BK' or $typeOf008='MU' or $typeOf008='SE' or $typeOf008='MM'">
+                                        <xsl:value-of select="true()"/>
+                                </xsl:if>
+                        </xsl:variable>
+                        <xsl:variable name="check008-29">
+                                <xsl:if test="$typeOf008='MP' or $typeOf008='VM'">
+                                        <xsl:value-of select="true()"/>
+                                </xsl:if>
+                        </xsl:variable>
+                        <xsl:choose>
+                                <xsl:when
+                                        test="($check008-23 and $controlField008-23='f') or ($check008-29 and $controlField008-29='f')">
+                                        <form authority="marcform">braille</form>
+                                </xsl:when>
+                                <xsl:when
+                                        test="($controlField008-23=' ' and ($leader6='c' or $leader6='d')) or (($typeOf008='BK' or $typeOf008='SE') and ($controlField008-23=' ' or $controlField008='r'))">
+                                        <form authority="marcform">print</form>
+                                </xsl:when>
+                                <xsl:when
+                                        test="$leader6 = 'm' or ($check008-23 and $controlField008-23='s') or ($check008-29 and $controlField008-29='s')">
+                                        <form authority="marcform">electronic</form>
+                                </xsl:when>
+                                <xsl:when
+                                        test="($check008-23 and $controlField008-23='b') or ($check008-29 and $controlField008-29='b')">
+                                        <form authority="marcform">microfiche</form>
+                                </xsl:when>
+                                <xsl:when
+                                        test="($check008-23 and $controlField008-23='a') or ($check008-29 and $controlField008-29='a')">
+                                        <form authority="marcform">microfilm</form>
+                                </xsl:when>
+                        </xsl:choose>
+                        <!-- 1/04 fix -->
+                        <xsl:if test="marc:datafield[@tag=130]/marc:subfield[@code='h']">
+                                <form authority="gmd">
+                                        <xsl:call-template name="chopBrackets">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:datafield[@tag=130]/marc:subfield[@code='h']"
+                                                        />
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </form>
+                        </xsl:if>
+                        <xsl:if test="marc:datafield[@tag=240]/marc:subfield[@code='h']">
+                                <form authority="gmd">
+                                        <xsl:call-template name="chopBrackets">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:datafield[@tag=240]/marc:subfield[@code='h']"
+                                                        />
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </form>
+                        </xsl:if>
+                        <xsl:if test="marc:datafield[@tag=242]/marc:subfield[@code='h']">
+                                <form authority="gmd">
+                                        <xsl:call-template name="chopBrackets">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:datafield[@tag=242]/marc:subfield[@code='h']"
+                                                        />
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </form>
+                        </xsl:if>
+                        <xsl:if test="marc:datafield[@tag=245]/marc:subfield[@code='h']">
+                                <form authority="gmd">
+                                        <xsl:call-template name="chopBrackets">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:datafield[@tag=245]/marc:subfield[@code='h']"
+                                                        />
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </form>
+                        </xsl:if>
+                        <xsl:if test="marc:datafield[@tag=246]/marc:subfield[@code='h']">
+                                <form authority="gmd">
+                                        <xsl:call-template name="chopBrackets">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:datafield[@tag=246]/marc:subfield[@code='h']"
+                                                        />
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </form>
+                        </xsl:if>
+                        <xsl:if test="marc:datafield[@tag=730]/marc:subfield[@code='h']">
+                                <form authority="gmd">
+                                        <xsl:call-template name="chopBrackets">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="marc:datafield[@tag=730]/marc:subfield[@code='h']"
+                                                        />
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </form>
+                        </xsl:if>
+                        <xsl:for-each select="marc:datafield[@tag=256]/marc:subfield[@code='a']">
+                                <form>
+                                        <xsl:value-of select="."/>
+                                </form>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:controlfield[@tag=007][substring(text(),1,1)='c']">
+                                <xsl:choose>
+                                        <xsl:when test="substring(text(),14,1)='a'">
+                                                <reformattingQuality>access</reformattingQuality>
+                                        </xsl:when>
+                                        <xsl:when test="substring(text(),14,1)='p'">
+                                                <reformattingQuality>preservation</reformattingQuality>
+                                        </xsl:when>
+                                        <xsl:when test="substring(text(),14,1)='r'">
+                                                <reformattingQuality>replacement</reformattingQuality>
+                                        </xsl:when>
+                                </xsl:choose>
+                        </xsl:for-each>
+                        <!--3.2 change tmee 007/01 -->
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='b']">
+                                <form authority="smd">chip cartridge</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='c']">
+                                <form authority="smd">computer optical disc cartridge</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='j']">
+                                <form authority="smd">magnetic disc</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='m']">
+                                <form authority="smd">magneto-optical disc</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='o']">
+                                <form authority="smd">optical disc</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='r']">
+                                <form authority="smd">remote</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='a']">
+                                <form authority="smd">tape cartridge</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='f']">
+                                <form authority="smd">tape cassette</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='h']">
+                                <form authority="smd">tape reel</form>
+                        </xsl:if>
+
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='a']">
+                                <form authority="smd">celestial globe</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='e']">
+                                <form authority="smd">earth moon globe</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='b']">
+                                <form authority="smd">planetary or lunar globe</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='c']">
+                                <form authority="smd">terrestrial globe</form>
+                        </xsl:if>
+
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='o'][substring(text(),2,1)='o']">
+                                <form authority="smd">kit</form>
+                        </xsl:if>
+
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='d']">
+                                <form authority="smd">atlas</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='g']">
+                                <form authority="smd">diagram</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='j']">
+                                <form authority="smd">map</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
+                                <form authority="smd">model</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='k']">
+                                <form authority="smd">profile</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='r']">
+                                <form authority="smd">remote-sensing image</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='s']">
+                                <form authority="smd">section</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='y']">
+                                <form authority="smd">view</form>
+                        </xsl:if>
+
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='a']">
+                                <form authority="smd">aperture card</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='e']">
+                                <form authority="smd">microfiche</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='f']">
+                                <form authority="smd">microfiche cassette</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='b']">
+                                <form authority="smd">microfilm cartridge</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='c']">
+                                <form authority="smd">microfilm cassette</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='d']">
+                                <form authority="smd">microfilm reel</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='g']">
+                                <form authority="smd">microopaque</form>
+                        </xsl:if>
+
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='m'][substring(text(),2,1)='c']">
+                                <form authority="smd">film cartridge</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='m'][substring(text(),2,1)='f']">
+                                <form authority="smd">film cassette</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='m'][substring(text(),2,1)='r']">
+                                <form authority="smd">film reel</form>
+                        </xsl:if>
+
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='n']">
+                                <form authority="smd">chart</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='c']">
+                                <form authority="smd">collage</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='d']">
+                                <form authority="smd">drawing</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='o']">
+                                <form authority="smd">flash card</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='e']">
+                                <form authority="smd">painting</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='f']">
+                                <form authority="smd">photomechanical print</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='g']">
+                                <form authority="smd">photonegative</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='h']">
+                                <form authority="smd">photoprint</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='i']">
+                                <form authority="smd">picture</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='j']">
+                                <form authority="smd">print</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='l']">
+                                <form authority="smd">technical drawing</form>
+                        </xsl:if>
+
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='q'][substring(text(),2,1)='q']">
+                                <form authority="smd">notated music</form>
+                        </xsl:if>
+
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='d']">
+                                <form authority="smd">filmslip</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='c']">
+                                <form authority="smd">filmstrip cartridge</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='o']">
+                                <form authority="smd">filmstrip roll</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='f']">
+                                <form authority="smd">other filmstrip type</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='s']">
+                                <form authority="smd">slide</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='t']">
+                                <form authority="smd">transparency</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='r'][substring(text(),2,1)='r']">
+                                <form authority="smd">remote-sensing image</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='e']">
+                                <form authority="smd">cylinder</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='q']">
+                                <form authority="smd">roll</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='g']">
+                                <form authority="smd">sound cartridge</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='s']">
+                                <form authority="smd">sound cassette</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='d']">
+                                <form authority="smd">sound disc</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='t']">
+                                <form authority="smd">sound-tape reel</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='i']">
+                                <form authority="smd">sound-track film</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='w']">
+                                <form authority="smd">wire recording</form>
+                        </xsl:if>
+
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='c']">
+                                <form authority="smd">braille</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='b']">
+                                <form authority="smd">combination</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='a']">
+                                <form authority="smd">moon</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='d']">
+                                <form authority="smd">tactile, with no writing system</form>
+                        </xsl:if>
+
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='c']">
+                                <form authority="smd">braille</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='b']">
+                                <form authority="smd">large print</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='a']">
+                                <form authority="smd">regular print</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='d']">
+                                <form authority="smd">text in looseleaf binder</form>
+                        </xsl:if>
+
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='c']">
+                                <form authority="smd">videocartridge</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='f']">
+                                <form authority="smd">videocassette</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='d']">
+                                <form authority="smd">videodisc</form>
+                        </xsl:if>
+                        <xsl:if
+                                test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='r']">
+                                <form authority="smd">videoreel</form>
+                        </xsl:if>
+
+                        <xsl:for-each
+                                select="marc:datafield[@tag=856]/marc:subfield[@code='q'][string-length(.)>1]">
+                                <internetMediaType>
+                                        <xsl:value-of select="."/>
+                                </internetMediaType>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=300]">
+                                <extent>
+                                        <xsl:call-template name="subfieldSelect">
+                                                <xsl:with-param name="codes">abce</xsl:with-param>
+                                        </xsl:call-template>
+                                </extent>
+                        </xsl:for-each>
+                </xsl:variable>
+                <xsl:if test="string-length(normalize-space($physicalDescription))">
+                        <physicalDescription>
+                                <xsl:copy-of select="$physicalDescription"/>
+                        </physicalDescription>
+                </xsl:if>
+                <xsl:for-each select="marc:datafield[@tag=520]">
+                        <abstract>
+                                <xsl:call-template name="uri"/>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </abstract>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=505]">
+                        <tableOfContents>
+                                <xsl:call-template name="uri"/>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">agrt</xsl:with-param>
+                                </xsl:call-template>
+                        </tableOfContents>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=521]">
+                        <targetAudience>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </targetAudience>
+                </xsl:for-each>
+                <xsl:if test="$typeOf008='BK' or $typeOf008='CF' or $typeOf008='MU' or $typeOf008='VM'">
+                        <xsl:variable name="controlField008-22" select="substring($controlField008,23,1)"/>
+                        <xsl:choose>
+                                <!-- 01/04 fix -->
+                                <xsl:when test="$controlField008-22='d'">
+                                        <targetAudience authority="marctarget">adolescent</targetAudience>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-22='e'">
+                                        <targetAudience authority="marctarget">adult</targetAudience>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-22='g'">
+                                        <targetAudience authority="marctarget">general</targetAudience>
+                                </xsl:when>
+                                <xsl:when
+                                        test="$controlField008-22='b' or $controlField008-22='c' or $controlField008-22='j'">
+                                        <targetAudience authority="marctarget">juvenile</targetAudience>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-22='a'">
+                                        <targetAudience authority="marctarget">preschool</targetAudience>
+                                </xsl:when>
+                                <xsl:when test="$controlField008-22='f'">
+                                        <targetAudience authority="marctarget">specialized</targetAudience>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:if>
+                <xsl:for-each select="marc:datafield[@tag=245]/marc:subfield[@code='c']">
+                        <note type="statement of responsibility">
+                                <xsl:value-of select="."/>
+                        </note>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=500]">
+                        <note>
+                                <xsl:value-of select="marc:subfield[@code='a']"/>
+                                <xsl:call-template name="uri"/>
+                        </note>
+                </xsl:for-each>
+
+                <!--3.2 change tmee additional note fields-->
+
+                <xsl:for-each select="marc:datafield[@tag=502]">
+                        <note type="thesis">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=504]">
+                        <note type="bibliography">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=508]">
+                        <note type="creation/production credits">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=506]">
+                        <note type="restrictions">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=510]">
+                        <note type="citation/reference">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+
+                <xsl:for-each select="marc:datafield[@tag=511]">
+                        <note type="performers">
+                                <xsl:call-template name="uri"/>
+                                <xsl:value-of select="marc:subfield[@code='a']"/>
+                        </note>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=518]">
+                        <note type="venue">
+                                <xsl:call-template name="uri"/>
+                                <xsl:value-of select="marc:subfield[@code='a']"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=530]">
+                        <note type="additional physical form">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=533]">
+                        <note type="reproduction">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=534]">
+                        <note type="original version">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=538]">
+                        <note type="system details">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=583]">
+                        <note type="action">
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+
+                <xsl:for-each
+                        select="marc:datafield[@tag=501 or @tag=507 or @tag=513 or @tag=514 or @tag=515 or @tag=516 or @tag=522 or @tag=524 or @tag=525 or @tag=526 or @tag=535 or @tag=536 or @tag=540 or @tag=541 or @tag=544 or @tag=545 or @tag=546 or @tag=547 or @tag=550 or @tag=552 or @tag=555 or @tag=556 or @tag=561 or @tag=562 or @tag=565 or @tag=567 or @tag=580 or @tag=581 or @tag=584 or @tag=585 or @tag=586]">
+                        <note>
+                                <xsl:call-template name="uri"/>
+                                <xsl:variable name="str">
+                                        <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
+                                                <xsl:value-of select="."/>
+                                                <xsl:text> </xsl:text>
+                                        </xsl:for-each>
+                                </xsl:variable>
+                                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+                        </note>
+                </xsl:for-each>
+                <xsl:for-each
+                        select="marc:datafield[@tag=034][marc:subfield[@code='d' or @code='e' or @code='f' or @code='g']]">
+                        <subject>
+                                <cartographics>
+                                        <coordinates>
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">defg</xsl:with-param>
+                                                </xsl:call-template>
+                                        </coordinates>
+                                </cartographics>
+                        </subject>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=043]">
+                        <subject>
+                                <xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='c']">
+                                        <geographicCode>
+                                                <xsl:attribute name="authority">
+                                                        <xsl:if test="@code='a'">
+                                                                <xsl:text>marcgac</xsl:text>
+                                                        </xsl:if>
+                                                        <xsl:if test="@code='b'">
+                                                                <xsl:value-of select="following-sibling::marc:subfield[@code=2]"/>
+                                                        </xsl:if>
+                                                        <xsl:if test="@code='c'">
+                                                                <xsl:text>iso3166</xsl:text>
+                                                        </xsl:if>
+                                                </xsl:attribute>
+                                                <xsl:value-of select="self::marc:subfield"/>
+                                        </geographicCode>
+                                </xsl:for-each>
+                        </subject>
+                </xsl:for-each>
+                <!-- tmee 2006/11/27 -->
+                <xsl:for-each select="marc:datafield[@tag=255]">
+                        <subject>
+                                <xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='c']">
+                                        <cartographics>
+                                                <xsl:if test="@code='a'">
+                                                        <scale>
+                                                                <xsl:value-of select="."/>
+                                                        </scale>
+                                                </xsl:if>
+                                                <xsl:if test="@code='b'">
+                                                        <projection>
+                                                                <xsl:value-of select="."/>
+                                                        </projection>
+                                                </xsl:if>
+                                                <xsl:if test="@code='c'">
+                                                        <coordinates>
+                                                                <xsl:value-of select="."/>
+                                                        </coordinates>
+                                                </xsl:if>
+                                        </cartographics>
+                                </xsl:for-each>
+                        </subject>
+                </xsl:for-each>
+
+                <xsl:apply-templates select="marc:datafield[653 >= @tag and @tag >= 600]"/>
+                <xsl:apply-templates select="marc:datafield[@tag=656]"/>
+                <xsl:for-each select="marc:datafield[@tag=752 or @tag=662]">
+                        <subject>
+                                <hierarchicalGeographic>
+                                        <xsl:for-each select="marc:subfield[@code='a']">
+                                                <country>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."/>
+                                                        </xsl:call-template>
+                                                </country>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='b']">
+                                                <state>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."/>
+                                                        </xsl:call-template>
+                                                </state>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='c']">
+                                                <county>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."/>
+                                                        </xsl:call-template>
+                                                </county>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='d']">
+                                                <city>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."/>
+                                                        </xsl:call-template>
+                                                </city>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='e']">
+                                                <citySection>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."/>
+                                                        </xsl:call-template>
+                                                </citySection>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='g']">
+                                                <region>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."/>
+                                                        </xsl:call-template>
+                                                </region>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='h']">
+                                                <extraterrestrialArea>
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString" select="."/>
+                                                        </xsl:call-template>
+                                                </extraterrestrialArea>
+                                        </xsl:for-each>
+                                </hierarchicalGeographic>
+                        </subject>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=045][marc:subfield[@code='b']]">
+                        <subject>
+                                <xsl:choose>
+                                        <xsl:when test="@ind1=2">
+                                                <temporal encoding="iso8601" point="start">
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString">
+                                                                        <xsl:value-of select="marc:subfield[@code='b'][1]"/>
+                                                                </xsl:with-param>
+                                                        </xsl:call-template>
+                                                </temporal>
+                                                <temporal encoding="iso8601" point="end">
+                                                        <xsl:call-template name="chopPunctuation">
+                                                                <xsl:with-param name="chopString">
+                                                                        <xsl:value-of select="marc:subfield[@code='b'][2]"/>
+                                                                </xsl:with-param>
+                                                        </xsl:call-template>
+                                                </temporal>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <xsl:for-each select="marc:subfield[@code='b']">
+                                                        <temporal encoding="iso8601">
+                                                                <xsl:call-template name="chopPunctuation">
+                                                                        <xsl:with-param name="chopString" select="."/>
+                                                                </xsl:call-template>
+                                                        </temporal>
+                                                </xsl:for-each>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                        </subject>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=050]">
+                        <xsl:for-each select="marc:subfield[@code='b']">
+                                <classification authority="lcc">
+                                        <xsl:if test="../marc:subfield[@code='3']">
+                                                <xsl:attribute name="displayLabel">
+                                                        <xsl:value-of select="../marc:subfield[@code='3']"/>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                        <xsl:value-of select="preceding-sibling::marc:subfield[@code='a'][1]"/>
+                                        <xsl:text> </xsl:text>
+                                        <xsl:value-of select="text()"/>
+                                </classification>
+                        </xsl:for-each>
+                        <xsl:for-each
+                                select="marc:subfield[@code='a'][not(following-sibling::marc:subfield[@code='b'])]">
+                                <classification authority="lcc">
+                                        <xsl:if test="../marc:subfield[@code='3']">
+                                                <xsl:attribute name="displayLabel">
+                                                        <xsl:value-of select="../marc:subfield[@code='3']"/>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                        <xsl:value-of select="text()"/>
+                                </classification>
+                        </xsl:for-each>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=082]">
+                        <classification authority="ddc">
+                                <xsl:if test="marc:subfield[@code='2']">
+                                        <xsl:attribute name="edition">
+                                                <xsl:value-of select="marc:subfield[@code='2']"/>
+                                        </xsl:attribute>
+                                </xsl:if>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=080]">
+                        <classification authority="udc">
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">abx</xsl:with-param>
+                                </xsl:call-template>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=060]">
+                        <classification authority="nlm">
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=086][@ind1=0]">
+                        <classification authority="sudocs">
+                                <xsl:value-of select="marc:subfield[@code='a']"/>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=086][@ind1=1]">
+                        <classification authority="candoc">
+                                <xsl:value-of select="marc:subfield[@code='a']"/>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=086]">
+                        <classification>
+                                <xsl:attribute name="authority">
+                                        <xsl:value-of select="marc:subfield[@code='2']"/>
+                                </xsl:attribute>
+                                <xsl:value-of select="marc:subfield[@code='a']"/>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=084]">
+                        <classification>
+                                <xsl:attribute name="authority">
+                                        <xsl:value-of select="marc:subfield[@code='2']"/>
+                                </xsl:attribute>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </classification>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=440]">
+                        <relatedItem type="series">
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="subfieldSelect">
+                                                                        <xsl:with-param name="codes">av</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="part"/>
+                                </titleInfo>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=490][@ind1=0]">
+                        <relatedItem type="series">
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="subfieldSelect">
+                                                                        <xsl:with-param name="codes">av</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="part"/>
+                                </titleInfo>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=510]">
+                        <relatedItem type="isReferencedBy">
+                                <note>
+                                        <xsl:call-template name="subfieldSelect">
+                                                <xsl:with-param name="codes">abcx3</xsl:with-param>
+                                        </xsl:call-template>
+                                </note>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=534]">
+                        <relatedItem type="original">
+                                <xsl:call-template name="relatedTitle"/>
+                                <xsl:call-template name="relatedName"/>
+                                <xsl:if test="marc:subfield[@code='b' or @code='c']">
+                                        <originInfo>
+                                                <xsl:for-each select="marc:subfield[@code='c']">
+                                                        <publisher>
+                                                                <xsl:value-of select="."/>
+                                                        </publisher>
+                                                </xsl:for-each>
+                                                <xsl:for-each select="marc:subfield[@code='b']">
+                                                        <edition>
+                                                                <xsl:value-of select="."/>
+                                                        </edition>
+                                                </xsl:for-each>
+                                        </originInfo>
+                                </xsl:if>
+                                <xsl:call-template name="relatedIdentifierISSN"/>
+                                <xsl:for-each select="marc:subfield[@code='z']">
+                                        <identifier type="isbn">
+                                                <xsl:value-of select="."/>
+                                        </identifier>
+                                </xsl:for-each>
+                                <xsl:call-template name="relatedNote"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=700][marc:subfield[@code='t']]">
+                        <relatedItem>
+                                <xsl:call-template name="constituentOrRelatedType"/>
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">g</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="part"/>
+                                </titleInfo>
+                                <name type="personal">
+                                        <namePart>
+                                                <xsl:call-template name="specialSubfieldSelect">
+                                                        <xsl:with-param name="anyCodes">aq</xsl:with-param>
+                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                        <xsl:with-param name="beforeCodes">g</xsl:with-param>
+                                                </xsl:call-template>
+                                        </namePart>
+                                        <xsl:call-template name="termsOfAddress"/>
+                                        <xsl:call-template name="nameDate"/>
+                                        <xsl:call-template name="role"/>
+                                </name>
+                                <xsl:call-template name="relatedForm"/>
+                                <xsl:call-template name="relatedIdentifierISSN"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=710][marc:subfield[@code='t']]">
+                        <relatedItem>
+                                <xsl:call-template name="constituentOrRelatedType"/>
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">dg</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="relatedPartNumName"/>
+                                </titleInfo>
+                                <name type="corporate">
+                                        <xsl:for-each select="marc:subfield[@code='a']">
+                                                <namePart>
+                                                        <xsl:value-of select="."/>
+                                                </namePart>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='b']">
+                                                <namePart>
+                                                        <xsl:value-of select="."/>
+                                                </namePart>
+                                        </xsl:for-each>
+                                        <xsl:variable name="tempNamePart">
+                                                <xsl:call-template name="specialSubfieldSelect">
+                                                        <xsl:with-param name="anyCodes">c</xsl:with-param>
+                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                        <xsl:with-param name="beforeCodes">dgn</xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:variable>
+                                        <xsl:if test="normalize-space($tempNamePart)">
+                                                <namePart>
+                                                        <xsl:value-of select="$tempNamePart"/>
+                                                </namePart>
+                                        </xsl:if>
+                                        <xsl:call-template name="role"/>
+                                </name>
+                                <xsl:call-template name="relatedForm"/>
+                                <xsl:call-template name="relatedIdentifierISSN"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=711][marc:subfield[@code='t']]">
+                        <relatedItem>
+                                <xsl:call-template name="constituentOrRelatedType"/>
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">tfklsv</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">g</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="relatedPartNumName"/>
+                                </titleInfo>
+                                <name type="conference">
+                                        <namePart>
+                                                <xsl:call-template name="specialSubfieldSelect">
+                                                        <xsl:with-param name="anyCodes">aqdc</xsl:with-param>
+                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                        <xsl:with-param name="beforeCodes">gn</xsl:with-param>
+                                                </xsl:call-template>
+                                        </namePart>
+                                </name>
+                                <xsl:call-template name="relatedForm"/>
+                                <xsl:call-template name="relatedIdentifierISSN"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=730][@ind2=2]">
+                        <relatedItem>
+                                <xsl:call-template name="constituentOrRelatedType"/>
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="subfieldSelect">
+                                                                        <xsl:with-param name="codes">adfgklmorsv</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="part"/>
+                                </titleInfo>
+                                <xsl:call-template name="relatedForm"/>
+                                <xsl:call-template name="relatedIdentifierISSN"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=740][@ind2=2]">
+                        <relatedItem>
+                                <xsl:call-template name="constituentOrRelatedType"/>
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:value-of select="marc:subfield[@code='a']"/>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="part"/>
+                                </titleInfo>
+                                <xsl:call-template name="relatedForm"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=760]|marc:datafield[@tag=762]">
+                        <relatedItem type="series">
+                                <xsl:call-template name="relatedItem76X-78X"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each
+                        select="marc:datafield[@tag=765]|marc:datafield[@tag=767]|marc:datafield[@tag=777]|marc:datafield[@tag=787]">
+                        <relatedItem>
+                                <xsl:call-template name="relatedItem76X-78X"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=775]">
+                        <relatedItem type="otherVersion">
+                                <xsl:call-template name="relatedItem76X-78X"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=770]|marc:datafield[@tag=774]">
+                        <relatedItem type="constituent">
+                                <xsl:call-template name="relatedItem76X-78X"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=772]|marc:datafield[@tag=773]">
+                        <relatedItem type="host">
+                                <xsl:call-template name="relatedItem76X-78X"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=776]">
+                        <relatedItem type="otherFormat">
+                                <xsl:call-template name="relatedItem76X-78X"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=780]">
+                        <relatedItem type="preceding">
+                                <xsl:call-template name="relatedItem76X-78X"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=785]">
+                        <relatedItem type="succeeding">
+                                <xsl:call-template name="relatedItem76X-78X"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=786]">
+                        <relatedItem type="original">
+                                <xsl:call-template name="relatedItem76X-78X"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=800]">
+                        <relatedItem type="series">
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">g</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="part"/>
+                                </titleInfo>
+                                <name type="personal">
+                                        <namePart>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">aq</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="beforeCodes">g</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </namePart>
+                                        <xsl:call-template name="termsOfAddress"/>
+                                        <xsl:call-template name="nameDate"/>
+                                        <xsl:call-template name="role"/>
+                                </name>
+                                <xsl:call-template name="relatedForm"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=810]">
+                        <relatedItem type="series">
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">dg</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="relatedPartNumName"/>
+                                </titleInfo>
+                                <name type="corporate">
+                                        <xsl:for-each select="marc:subfield[@code='a']">
+                                                <namePart>
+                                                        <xsl:value-of select="."/>
+                                                </namePart>
+                                        </xsl:for-each>
+                                        <xsl:for-each select="marc:subfield[@code='b']">
+                                                <namePart>
+                                                        <xsl:value-of select="."/>
+                                                </namePart>
+                                        </xsl:for-each>
+                                        <namePart>
+                                                <xsl:call-template name="specialSubfieldSelect">
+                                                        <xsl:with-param name="anyCodes">c</xsl:with-param>
+                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                        <xsl:with-param name="beforeCodes">dgn</xsl:with-param>
+                                                </xsl:call-template>
+                                        </namePart>
+                                        <xsl:call-template name="role"/>
+                                </name>
+                                <xsl:call-template name="relatedForm"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=811]">
+                        <relatedItem type="series">
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="specialSubfieldSelect">
+                                                                        <xsl:with-param name="anyCodes">tfklsv</xsl:with-param>
+                                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                                        <xsl:with-param name="afterCodes">g</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="relatedPartNumName"/>
+                                </titleInfo>
+                                <name type="conference">
+                                        <namePart>
+                                                <xsl:call-template name="specialSubfieldSelect">
+                                                        <xsl:with-param name="anyCodes">aqdc</xsl:with-param>
+                                                        <xsl:with-param name="axis">t</xsl:with-param>
+                                                        <xsl:with-param name="beforeCodes">gn</xsl:with-param>
+                                                </xsl:call-template>
+                                        </namePart>
+                                        <xsl:call-template name="role"/>
+                                </name>
+                                <xsl:call-template name="relatedForm"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='830']">
+                        <relatedItem type="series">
+                                <titleInfo>
+                                        <title>
+                                                <xsl:call-template name="chopPunctuation">
+                                                        <xsl:with-param name="chopString">
+                                                                <xsl:call-template name="subfieldSelect">
+                                                                        <xsl:with-param name="codes">adfgklmorsv</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:with-param>
+                                                </xsl:call-template>
+                                        </title>
+                                        <xsl:call-template name="part"/>
+                                </titleInfo>
+                                <xsl:call-template name="relatedForm"/>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='856'][@ind2='2']/marc:subfield[@code='q']">
+                        <relatedItem>
+                                <internetMediaType>
+                                        <xsl:value-of select="."/>
+                                </internetMediaType>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='020']">
+                        <xsl:call-template name="isInvalid">
+                                <xsl:with-param name="type">isbn</xsl:with-param>
+                        </xsl:call-template>
+                        <xsl:if test="marc:subfield[@code='a']">
+                                <identifier type="isbn">
+                                        <xsl:value-of select="marc:subfield[@code='a']"/>
+                                </identifier>
+                        </xsl:if>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='024'][@ind1='0']">
+                        <xsl:call-template name="isInvalid">
+                                <xsl:with-param name="type">isrc</xsl:with-param>
+                        </xsl:call-template>
+                        <xsl:if test="marc:subfield[@code='a']">
+                                <identifier type="isrc">
+                                        <xsl:value-of select="marc:subfield[@code='a']"/>
+                                </identifier>
+                        </xsl:if>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='024'][@ind1='2']">
+                        <xsl:call-template name="isInvalid">
+                                <xsl:with-param name="type">ismn</xsl:with-param>
+                        </xsl:call-template>
+                        <xsl:if test="marc:subfield[@code='a']">
+                                <identifier type="ismn">
+                                        <xsl:value-of select="marc:subfield[@code='a']"/>
+                                </identifier>
+                        </xsl:if>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='024'][@ind1='4']">
+                        <xsl:call-template name="isInvalid">
+                                <xsl:with-param name="type">sici</xsl:with-param>
+                        </xsl:call-template>
+                        <identifier type="sici">
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </identifier>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='022']">
+                        <xsl:if test="marc:subfield[@code='a']">
+                                <xsl:call-template name="isInvalid">
+                                        <xsl:with-param name="type">issn</xsl:with-param>
+                                </xsl:call-template>
+                                <identifier type="issn">
+                                        <xsl:value-of select="marc:subfield[@code='a']"/>
+                                </identifier>
+                        </xsl:if>
+                        <xsl:if test="marc:subfield[@code='l']">
+                                <xsl:call-template name="isInvalid">
+                                        <xsl:with-param name="type">issn-l</xsl:with-param>
+                                </xsl:call-template>
+                                <identifier type="issn-l">
+                                        <xsl:value-of select="marc:subfield[@code='l']"/>
+                                </identifier>
+                        </xsl:if>
+                </xsl:for-each>
+
+
+
+                <xsl:for-each select="marc:datafield[@tag='010']">
+                        <xsl:call-template name="isInvalid">
+                                <xsl:with-param name="type">lccn</xsl:with-param>
+                        </xsl:call-template>
+                        <identifier type="lccn">
+                                <xsl:value-of select="normalize-space(marc:subfield[@code='a'])"/>
+                        </identifier>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='028']">
+                        <identifier>
+                                <xsl:attribute name="type">
+                                        <xsl:choose>
+                                                <xsl:when test="@ind1='0'">issue number</xsl:when>
+                                                <xsl:when test="@ind1='1'">matrix number</xsl:when>
+                                                <xsl:when test="@ind1='2'">music plate</xsl:when>
+                                                <xsl:when test="@ind1='3'">music publisher</xsl:when>
+                                                <xsl:when test="@ind1='4'">videorecording identifier</xsl:when>
+                                        </xsl:choose>
+                                </xsl:attribute>
+                                <!--<xsl:call-template name="isInvalid"/>-->
+                                <!-- no $z in 028 -->
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">
+                                                <xsl:choose>
+                                                        <xsl:when test="@ind1='0'">ba</xsl:when>
+                                                        <xsl:otherwise>ab</xsl:otherwise>
+                                                </xsl:choose>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </identifier>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='037']">
+                        <identifier type="stock number">
+                                <!--<xsl:call-template name="isInvalid"/>-->
+                                <!-- no $z in 037 -->
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">ab</xsl:with-param>
+                                </xsl:call-template>
+                        </identifier>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag='856'][marc:subfield[@code='u']]">
+                        <identifier>
+                                <xsl:attribute name="type">
+                                        <xsl:choose>
+                                                <xsl:when
+                                                        test="starts-with(marc:subfield[@code='u'],'urn:doi') or starts-with(marc:subfield[@code='u'],'doi')"
+                                                        >doi</xsl:when>
+                                                <xsl:when
+                                                        test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl') or starts-with(marc:subfield[@code='u'],'http://hdl.loc.gov')"
+                                                        >hdl</xsl:when>
+                                                <xsl:otherwise>uri</xsl:otherwise>
+                                        </xsl:choose>
+                                </xsl:attribute>
+                                <xsl:choose>
+                                        <xsl:when
+                                                test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl') or starts-with(marc:subfield[@code='u'],'http://hdl.loc.gov') ">
+                                                <xsl:value-of
+                                                        select="concat('hdl:',substring-after(marc:subfield[@code='u'],'http://hdl.loc.gov/'))"
+                                                />
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                                <xsl:value-of select="marc:subfield[@code='u']"/>
+                                        </xsl:otherwise>
+                                </xsl:choose>
+                        </identifier>
+                        <xsl:if
+                                test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl')">
+                                <identifier type="hdl">
+                                        <xsl:if test="marc:subfield[@code='y' or @code='3' or @code='z']">
+                                                <xsl:attribute name="displayLabel">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">y3z</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                        <xsl:value-of
+                                                select="concat('hdl:',substring-after(marc:subfield[@code='u'],'http://hdl.loc.gov/'))"
+                                        />
+                                </identifier>
+                        </xsl:if>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=024][@ind1=1]">
+                        <identifier type="upc">
+                                <xsl:call-template name="isInvalid"/>
+                                <xsl:value-of select="marc:subfield[@code='a']"/>
+                        </identifier>
+                </xsl:for-each>
+
+                <!-- 1/04 fix added $y -->
+
+                <!-- 1.21  tmee-->
+                <xsl:for-each select="marc:datafield[@tag=856][@ind2=1][marc:subfield[@code='u']]">
+                        <relatedItem type="otherVersion">
+                                <location>
+                                        <url>
+                                                <xsl:if test="marc:subfield[@code='y' or @code='3']">
+                                                        <xsl:attribute name="displayLabel">
+                                                                <xsl:call-template name="subfieldSelect">
+                                                                        <xsl:with-param name="codes">y3</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:attribute>
+                                                </xsl:if>
+                                                <xsl:if test="marc:subfield[@code='z' ]">
+                                                        <xsl:attribute name="note">
+                                                                <xsl:call-template name="subfieldSelect">
+                                                                        <xsl:with-param name="codes">z</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:attribute>
+                                                </xsl:if>
+                                                <xsl:value-of select="marc:subfield[@code='u']"/>
+                                        </url>
+                                </location>
+                        </relatedItem>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=856][@ind2=2][marc:subfield[@code='u']]">
+                        <relatedItem>
+                                <location>
+                                        <url>
+                                                <xsl:if test="marc:subfield[@code='y' or @code='3']">
+                                                        <xsl:attribute name="displayLabel">
+                                                                <xsl:call-template name="subfieldSelect">
+                                                                        <xsl:with-param name="codes">y3</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:attribute>
+                                                </xsl:if>
+                                                <xsl:if test="marc:subfield[@code='z' ]">
+                                                        <xsl:attribute name="note">
+                                                                <xsl:call-template name="subfieldSelect">
+                                                                        <xsl:with-param name="codes">z</xsl:with-param>
+                                                                </xsl:call-template>
+                                                        </xsl:attribute>
+                                                </xsl:if>
+                                                <xsl:value-of select="marc:subfield[@code='u']"/>
+                                        </url>
+                                </location>
+                        </relatedItem>
+                </xsl:for-each>
+
+                <!-- 3.2 change tmee 856z  -->
+
+                <!-- 1.24  tmee  -->
+                <xsl:for-each select="marc:datafield[@tag=852]">
+                        <location>
+                                <xsl:if test="marc:subfield[@code='a' or @code='b' or @code='e']">
+                                        <physicalLocation>
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">abe</xsl:with-param>
+                                                </xsl:call-template>
+                                        </physicalLocation>
+                                </xsl:if>
+
+                                <xsl:if test="marc:subfield[@code='u']">
+                                        <physicalLocation>
+                                                <xsl:call-template name="uri"/>
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">u</xsl:with-param>
+                                                </xsl:call-template>
+                                        </physicalLocation>
+                                </xsl:if>
+
+                                <xsl:if
+                                        test="marc:subfield[@code='h' or @code='i' or @code='j' or @code='k' or @code='l' or @code='m' or @code='t']">
+                                        <shelfLocation>
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">hijklmt</xsl:with-param>
+                                                </xsl:call-template>
+                                        </shelfLocation>
+                                </xsl:if>
+                        </location>
+                </xsl:for-each>
+
+                <xsl:for-each select="marc:datafield[@tag=506]">
+                        <accessCondition type="restrictionOnAccess">
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">abcd35</xsl:with-param>
+                                </xsl:call-template>
+                        </accessCondition>
+                </xsl:for-each>
+                <xsl:for-each select="marc:datafield[@tag=540]">
+                        <accessCondition type="useAndReproduction">
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">abcde35</xsl:with-param>
+                                </xsl:call-template>
+                        </accessCondition>
+                </xsl:for-each>
+
+                <recordInfo>
+                        <!-- 1.25  tmee-->
+
+
+                        <xsl:for-each select="marc:leader[substring($leader,19,1)='a']">
+                                <descriptionStandard>aacr2</descriptionStandard>
+                        </xsl:for-each>
+
+                        <xsl:for-each select="marc:datafield[@tag=040]">
+                                <xsl:if test="marc:subfield[@code='e']">
+                                        <descriptionStandard>
+                                                <xsl:value-of select="marc:subfield[@code='e']"/>
+                                        </descriptionStandard>
+                                </xsl:if>
+                                <recordContentSource authority="marcorg">
+                                        <xsl:value-of select="marc:subfield[@code='a']"/>
+                                </recordContentSource>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:controlfield[@tag=008]">
+                                <recordCreationDate encoding="marc">
+                                        <xsl:value-of select="substring(.,1,6)"/>
+                                </recordCreationDate>
+                        </xsl:for-each>
+
+                        <xsl:for-each select="marc:controlfield[@tag=005]">
+                                <recordChangeDate encoding="iso8601">
+                                        <xsl:value-of select="."/>
+                                </recordChangeDate>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:controlfield[@tag=001]">
+                                <recordIdentifier>
+                                        <xsl:if test="../marc:controlfield[@tag=003]">
+                                                <xsl:attribute name="source">
+                                                        <xsl:value-of select="../marc:controlfield[@tag=003]"/>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                        <xsl:value-of select="."/>
+                                </recordIdentifier>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:datafield[@tag=040]/marc:subfield[@code='b']">
+                                <languageOfCataloging>
+                                        <languageTerm authority="iso639-2b" type="code">
+                                                <xsl:value-of select="."/>
+                                        </languageTerm>
+                                </languageOfCataloging>
+                        </xsl:for-each>
+                </recordInfo>
+        </xsl:template>
+        <xsl:template name="displayForm">
+                <xsl:for-each select="marc:subfield[@code='c']">
+                        <displayForm>
+                                <xsl:value-of select="."/>
+                        </displayForm>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="affiliation">
+                <xsl:for-each select="marc:subfield[@code='u']">
+                        <affiliation>
+                                <xsl:value-of select="."/>
+                        </affiliation>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="uri">
+                <xsl:for-each select="marc:subfield[@code='u']">
+                        <xsl:attribute name="xlink:href">
+                                <xsl:value-of select="."/>
+                        </xsl:attribute>
+                </xsl:for-each>
+                <xsl:for-each select="marc:subfield[@code='0']">
+                        <xsl:choose>
+                                <xsl:when test="contains(text(), ')')">
+                                        <xsl:attribute name="xlink:href">
+                                                <xsl:value-of select="substring-after(text(), ')')"></xsl:value-of>
+                                        </xsl:attribute>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                        <xsl:attribute name="xlink:href">
+                                                <xsl:value-of select="."></xsl:value-of>
+                                        </xsl:attribute>
+                                </xsl:otherwise>
+                        </xsl:choose>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="role">
+                <xsl:for-each select="marc:subfield[@code='e']">
+                        <role>
+                                <roleTerm type="text">
+                                        <xsl:value-of select="."/>
+                                </roleTerm>
+                        </role>
+                </xsl:for-each>
+                <xsl:for-each select="marc:subfield[@code='4']">
+                        <role>
+                                <roleTerm authority="marcrelator" type="code">
+                                        <xsl:value-of select="."/>
+                                </roleTerm>
+                        </role>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="part">
+                <xsl:variable name="partNumber">
+                        <xsl:call-template name="specialSubfieldSelect">
+                                <xsl:with-param name="axis">n</xsl:with-param>
+                                <xsl:with-param name="anyCodes">n</xsl:with-param>
+                                <xsl:with-param name="afterCodes">fgkdlmor</xsl:with-param>
+                        </xsl:call-template>
+                </xsl:variable>
+                <xsl:variable name="partName">
+                        <xsl:call-template name="specialSubfieldSelect">
+                                <xsl:with-param name="axis">p</xsl:with-param>
+                                <xsl:with-param name="anyCodes">p</xsl:with-param>
+                                <xsl:with-param name="afterCodes">fgkdlmor</xsl:with-param>
+                        </xsl:call-template>
+                </xsl:variable>
+                <xsl:if test="string-length(normalize-space($partNumber))">
+                        <partNumber>
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString" select="$partNumber"/>
+                                </xsl:call-template>
+                        </partNumber>
+                </xsl:if>
+                <xsl:if test="string-length(normalize-space($partName))">
+                        <partName>
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString" select="$partName"/>
+                                </xsl:call-template>
+                        </partName>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="relatedPart">
+                <xsl:if test="@tag=773">
+                        <xsl:for-each select="marc:subfield[@code='g']">
+                                <part>
+                                        <text>
+                                                <xsl:value-of select="."/>
+                                        </text>
+                                </part>
+                        </xsl:for-each>
+                        <xsl:for-each select="marc:subfield[@code='q']">
+                                <part>
+                                        <xsl:call-template name="parsePart"/>
+                                </part>
+                        </xsl:for-each>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="relatedPartNumName">
+                <xsl:variable name="partNumber">
+                        <xsl:call-template name="specialSubfieldSelect">
+                                <xsl:with-param name="axis">g</xsl:with-param>
+                                <xsl:with-param name="anyCodes">g</xsl:with-param>
+                                <xsl:with-param name="afterCodes">pst</xsl:with-param>
+                        </xsl:call-template>
+                </xsl:variable>
+                <xsl:variable name="partName">
+                        <xsl:call-template name="specialSubfieldSelect">
+                                <xsl:with-param name="axis">p</xsl:with-param>
+                                <xsl:with-param name="anyCodes">p</xsl:with-param>
+                                <xsl:with-param name="afterCodes">fgkdlmor</xsl:with-param>
+                        </xsl:call-template>
+                </xsl:variable>
+                <xsl:if test="string-length(normalize-space($partNumber))">
+                        <partNumber>
+                                <xsl:value-of select="$partNumber"/>
+                        </partNumber>
+                </xsl:if>
+                <xsl:if test="string-length(normalize-space($partName))">
+                        <partName>
+                                <xsl:value-of select="$partName"/>
+                        </partName>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="relatedName">
+                <xsl:for-each select="marc:subfield[@code='a']">
+                        <name>
+                                <namePart>
+                                        <xsl:value-of select="."/>
+                                </namePart>
+                        </name>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedForm">
+                <xsl:for-each select="marc:subfield[@code='h']">
+                        <physicalDescription>
+                                <form>
+                                        <xsl:value-of select="."/>
+                                </form>
+                        </physicalDescription>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedExtent">
+                <xsl:for-each select="marc:subfield[@code='h']">
+                        <physicalDescription>
+                                <extent>
+                                        <xsl:value-of select="."/>
+                                </extent>
+                        </physicalDescription>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedNote">
+                <xsl:for-each select="marc:subfield[@code='n']">
+                        <note>
+                                <xsl:value-of select="."/>
+                        </note>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedSubject">
+                <xsl:for-each select="marc:subfield[@code='j']">
+                        <subject>
+                                <temporal encoding="iso8601">
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString" select="."/>
+                                        </xsl:call-template>
+                                </temporal>
+                        </subject>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedIdentifierISSN">
+                <xsl:for-each select="marc:subfield[@code='x']">
+                        <identifier type="issn">
+                                <xsl:value-of select="."/>
+                        </identifier>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedIdentifierLocal">
+                <xsl:for-each select="marc:subfield[@code='w']">
+                        <identifier type="local">
+                                <xsl:value-of select="."/>
+                        </identifier>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedIdentifier">
+                <xsl:for-each select="marc:subfield[@code='o']">
+                        <identifier>
+                                <xsl:value-of select="."/>
+                        </identifier>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedItem76X-78X">
+                <xsl:call-template name="displayLabel"/>
+                <xsl:call-template name="relatedTitle76X-78X"/>
+                <xsl:call-template name="relatedName"/>
+                <xsl:call-template name="relatedOriginInfo"/>
+                <xsl:call-template name="relatedLanguage"/>
+                <xsl:call-template name="relatedExtent"/>
+                <xsl:call-template name="relatedNote"/>
+                <xsl:call-template name="relatedSubject"/>
+                <xsl:call-template name="relatedIdentifier"/>
+                <xsl:call-template name="relatedIdentifierISSN"/>
+                <xsl:call-template name="relatedIdentifierLocal"/>
+                <xsl:call-template name="relatedPart"/>
+        </xsl:template>
+        <xsl:template name="subjectGeographicZ">
+                <geographic>
+                        <xsl:call-template name="chopPunctuation">
+                                <xsl:with-param name="chopString" select="."/>
+                        </xsl:call-template>
+                </geographic>
+        </xsl:template>
+        <xsl:template name="subjectTemporalY">
+                <temporal>
+                        <xsl:call-template name="chopPunctuation">
+                                <xsl:with-param name="chopString" select="."/>
+                        </xsl:call-template>
+                </temporal>
+        </xsl:template>
+        <xsl:template name="subjectTopic">
+                <topic>
+                        <xsl:call-template name="chopPunctuation">
+                                <xsl:with-param name="chopString" select="."/>
+                        </xsl:call-template>
+                </topic>
+        </xsl:template>
+        <!-- 3.2 change tmee 6xx $v genre -->
+        <xsl:template name="subjectGenre">
+                <genre>
+                        <xsl:call-template name="chopPunctuation">
+                                <xsl:with-param name="chopString" select="."/>
+                        </xsl:call-template>
+                </genre>
+        </xsl:template>
+
+        <xsl:template name="nameABCDN">
+                <xsl:for-each select="marc:subfield[@code='a']">
+                        <namePart>
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString" select="."/>
+                                </xsl:call-template>
+                        </namePart>
+                </xsl:for-each>
+                <xsl:for-each select="marc:subfield[@code='b']">
+                        <namePart>
+                                <xsl:value-of select="."/>
+                        </namePart>
+                </xsl:for-each>
+                <xsl:if
+                        test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
+                        <namePart>
+                                <xsl:call-template name="subfieldSelect">
+                                        <xsl:with-param name="codes">cdn</xsl:with-param>
+                                </xsl:call-template>
+                        </namePart>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="nameABCDQ">
+                <namePart>
+                        <xsl:call-template name="chopPunctuation">
+                                <xsl:with-param name="chopString">
+                                        <xsl:call-template name="subfieldSelect">
+                                                <xsl:with-param name="codes">aq</xsl:with-param>
+                                        </xsl:call-template>
+                                </xsl:with-param>
+                                <xsl:with-param name="punctuation">
+                                        <xsl:text>:,;/ </xsl:text>
+                                </xsl:with-param>
+                        </xsl:call-template>
+                </namePart>
+                <xsl:call-template name="termsOfAddress"/>
+                <xsl:call-template name="nameDate"/>
+        </xsl:template>
+        <xsl:template name="nameACDEQ">
+                <namePart>
+                        <xsl:call-template name="subfieldSelect">
+                                <xsl:with-param name="codes">acdeq</xsl:with-param>
+                        </xsl:call-template>
+                </namePart>
+        </xsl:template>
+        <xsl:template name="constituentOrRelatedType">
+                <xsl:if test="@ind2=2">
+                        <xsl:attribute name="type">constituent</xsl:attribute>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="relatedTitle">
+                <xsl:for-each select="marc:subfield[@code='t']">
+                        <titleInfo>
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="."/>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                        </titleInfo>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedTitle76X-78X">
+                <xsl:for-each select="marc:subfield[@code='t']">
+                        <titleInfo>
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="."/>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']">
+                                        <xsl:call-template name="relatedPartNumName"/>
+                                </xsl:if>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:subfield[@code='p']">
+                        <titleInfo type="abbreviated">
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="."/>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']">
+                                        <xsl:call-template name="relatedPartNumName"/>
+                                </xsl:if>
+                        </titleInfo>
+                </xsl:for-each>
+                <xsl:for-each select="marc:subfield[@code='s']">
+                        <titleInfo type="uniform">
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:value-of select="."/>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']">
+                                        <xsl:call-template name="relatedPartNumName"/>
+                                </xsl:if>
+                        </titleInfo>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="relatedOriginInfo">
+                <xsl:if test="marc:subfield[@code='b' or @code='d'] or marc:subfield[@code='f']">
+                        <originInfo>
+                                <xsl:if test="@tag=775">
+                                        <xsl:for-each select="marc:subfield[@code='f']">
+                                                <place>
+                                                        <placeTerm>
+                                                                <xsl:attribute name="type">code</xsl:attribute>
+                                                                <xsl:attribute name="authority">marcgac</xsl:attribute>
+                                                                <xsl:value-of select="."/>
+                                                        </placeTerm>
+                                                </place>
+                                        </xsl:for-each>
+                                </xsl:if>
+                                <xsl:for-each select="marc:subfield[@code='d']">
+                                        <publisher>
+                                                <xsl:value-of select="."/>
+                                        </publisher>
+                                </xsl:for-each>
+                                <xsl:for-each select="marc:subfield[@code='b']">
+                                        <edition>
+                                                <xsl:value-of select="."/>
+                                        </edition>
+                                </xsl:for-each>
+                        </originInfo>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="relatedLanguage">
+                <xsl:for-each select="marc:subfield[@code='e']">
+                        <xsl:call-template name="getLanguage">
+                                <xsl:with-param name="langString">
+                                        <xsl:value-of select="."/>
+                                </xsl:with-param>
+                        </xsl:call-template>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="nameDate">
+                <xsl:for-each select="marc:subfield[@code='d']">
+                        <namePart type="date">
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString" select="."/>
+                                </xsl:call-template>
+                        </namePart>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="subjectAuthority">
+                <xsl:if test="@ind2!=4">
+                        <xsl:if test="@ind2!=' '">
+                                <xsl:if test="@ind2!=8">
+                                        <xsl:if test="@ind2!=9">
+                                                <xsl:attribute name="authority">
+                                                        <xsl:choose>
+                                                                <xsl:when test="@ind2=0">lcsh</xsl:when>
+                                                                <xsl:when test="@ind2=1">lcshac</xsl:when>
+                                                                <xsl:when test="@ind2=2">mesh</xsl:when>
+                                                                <!-- 1/04 fix -->
+                                                                <xsl:when test="@ind2=3">nal</xsl:when>
+                                                                <xsl:when test="@ind2=5">csh</xsl:when>
+                                                                <xsl:when test="@ind2=6">rvm</xsl:when>
+                                                                <xsl:when test="@ind2=7">
+                                                                        <xsl:value-of select="marc:subfield[@code='2']"/>
+                                                                </xsl:when>
+                                                        </xsl:choose>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                </xsl:if>
+                        </xsl:if>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="subjectAnyOrder">
+                <xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
+                        <xsl:choose>
+                                <xsl:when test="@code='v'">
+                                        <xsl:call-template name="subjectGenre"/>
+                                </xsl:when>
+                                <xsl:when test="@code='x'">
+                                        <xsl:call-template name="subjectTopic"/>
+                                </xsl:when>
+                                <xsl:when test="@code='y'">
+                                        <xsl:call-template name="subjectTemporalY"/>
+                                </xsl:when>
+                                <xsl:when test="@code='z'">
+                                        <xsl:call-template name="subjectGeographicZ"/>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:for-each>
+        </xsl:template>
+        <xsl:template name="specialSubfieldSelect">
+                <xsl:param name="anyCodes"/>
+                <xsl:param name="axis"/>
+                <xsl:param name="beforeCodes"/>
+                <xsl:param name="afterCodes"/>
+                <xsl:variable name="str">
+                        <xsl:for-each select="marc:subfield">
+                                <xsl:if
+                                        test="contains($anyCodes, @code)      or (contains($beforeCodes, at code) and following-sibling::marc:subfield[@code=$axis])      or (contains($afterCodes, at code) and preceding-sibling::marc:subfield[@code=$axis])">
+                                        <xsl:value-of select="text()"/>
+                                        <xsl:text> </xsl:text>
+                                </xsl:if>
+                        </xsl:for-each>
+                </xsl:variable>
+                <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+        </xsl:template>
+
+        <!-- 3.2 change tmee 6xx $v genre -->
+        <xsl:template match="marc:datafield[@tag=600]">
+                <subject>
+                        <xsl:call-template name="subjectAuthority"/>
+                        <name type="personal">
+                                <xsl:call-template name="termsOfAddress"/>
+                                <namePart>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">aq</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </namePart>
+                                <xsl:call-template name="nameDate"/>
+                                <xsl:call-template name="affiliation"/>
+                                <xsl:call-template name="role"/>
+                        </name>
+                        <xsl:call-template name="subjectAnyOrder"/>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=610]">
+                <subject>
+                        <xsl:call-template name="subjectAuthority"/>
+                        <name type="corporate">
+                                <xsl:for-each select="marc:subfield[@code='a']">
+                                        <namePart>
+                                                <xsl:value-of select="."/>
+                                        </namePart>
+                                </xsl:for-each>
+                                <xsl:for-each select="marc:subfield[@code='b']">
+                                        <namePart>
+                                                <xsl:value-of select="."/>
+                                        </namePart>
+                                </xsl:for-each>
+                                <xsl:if test="marc:subfield[@code='c' or @code='d' or @code='n' or @code='p']">
+                                        <namePart>
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">cdnp</xsl:with-param>
+                                                </xsl:call-template>
+                                        </namePart>
+                                </xsl:if>
+                                <xsl:call-template name="role"/>
+                        </name>
+                        <xsl:call-template name="subjectAnyOrder"/>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=611]">
+                <subject>
+                        <xsl:call-template name="subjectAuthority"/>
+                        <name type="conference">
+                                <namePart>
+                                        <xsl:call-template name="subfieldSelect">
+                                                <xsl:with-param name="codes">abcdeqnp</xsl:with-param>
+                                        </xsl:call-template>
+                                </namePart>
+                                <xsl:for-each select="marc:subfield[@code='4']">
+                                        <role>
+                                                <roleTerm authority="marcrelator" type="code">
+                                                        <xsl:value-of select="."/>
+                                                </roleTerm>
+                                        </role>
+                                </xsl:for-each>
+                        </name>
+                        <xsl:call-template name="subjectAnyOrder"/>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=630]">
+                <subject>
+                        <xsl:call-template name="subjectAuthority"/>
+                        <titleInfo>
+                                <title>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString">
+                                                        <xsl:call-template name="subfieldSelect">
+                                                                <xsl:with-param name="codes">adfhklor</xsl:with-param>
+                                                        </xsl:call-template>
+                                                </xsl:with-param>
+                                        </xsl:call-template>
+                                </title>
+                                <xsl:call-template name="part"/>
+                        </titleInfo>
+                        <xsl:call-template name="subjectAnyOrder"/>
+                </subject>
+        </xsl:template>
+        <!-- 1.27 648 tmee-->
+        <xsl:template match="marc:datafield[@tag=648]">
+                <subject>
+                        <xsl:if test="marc:subfield[@code=2]">
+                                <xsl:attribute name="authority">
+                                        <xsl:value-of select="marc:subfield[@code=2]"/>
+                                </xsl:attribute>
+                        </xsl:if>
+                        <xsl:call-template name="uri"/>
+
+                        <xsl:call-template name="subjectAuthority"/>
+                        <temporal>
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">abcd</xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </temporal>
+                        <xsl:call-template name="subjectAnyOrder"/>
+
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=650]">
+                <subject>
+                        <xsl:call-template name="subjectAuthority"/>
+                        <topic>
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">abcd</xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </topic>
+                        <xsl:call-template name="subjectAnyOrder"/>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=651]">
+                <subject>
+                        <xsl:call-template name="subjectAuthority"/>
+                        <xsl:for-each select="marc:subfield[@code='a']">
+                                <geographic>
+                                        <xsl:call-template name="chopPunctuation">
+                                                <xsl:with-param name="chopString" select="."/>
+                                        </xsl:call-template>
+                                </geographic>
+                        </xsl:for-each>
+                        <xsl:call-template name="subjectAnyOrder"/>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=653]">
+                <subject>
+                        <xsl:for-each select="marc:subfield[@code='a']">
+                                <topic>
+                                        <xsl:value-of select="."/>
+                                </topic>
+                        </xsl:for-each>
+                </subject>
+        </xsl:template>
+        <xsl:template match="marc:datafield[@tag=656]">
+                <subject>
+                        <xsl:if test="marc:subfield[@code=2]">
+                                <xsl:attribute name="authority">
+                                        <xsl:value-of select="marc:subfield[@code=2]"/>
+                                </xsl:attribute>
+                        </xsl:if>
+                        <occupation>
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:value-of select="marc:subfield[@code='a']"/>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </occupation>
+                </subject>
+        </xsl:template>
+        <xsl:template name="termsOfAddress">
+                <xsl:if test="marc:subfield[@code='b' or @code='c']">
+                        <namePart type="termsOfAddress">
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">bc</xsl:with-param>
+                                                </xsl:call-template>
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </namePart>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="displayLabel">
+                <xsl:if test="marc:subfield[@code='i']">
+                        <xsl:attribute name="displayLabel">
+                                <xsl:value-of select="marc:subfield[@code='i']"/>
+                        </xsl:attribute>
+                </xsl:if>
+                <xsl:if test="marc:subfield[@code='3']">
+                        <xsl:attribute name="displayLabel">
+                                <xsl:value-of select="marc:subfield[@code='3']"/>
+                        </xsl:attribute>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="isInvalid">
+                <xsl:param name="type"/>
+                <xsl:if
+                        test="marc:subfield[@code='z'] or marc:subfield[@code='y']  or marc:subfield[@code='m']">
+                        <identifier>
+                                <xsl:attribute name="type">
+                                        <xsl:value-of select="$type"/>
+                                </xsl:attribute>
+                                <xsl:attribute name="invalid">
+                                        <xsl:text>yes</xsl:text>
+                                </xsl:attribute>
+                                <xsl:if test="marc:subfield[@code='z']">
+                                        <xsl:value-of select="marc:subfield[@code='z']"/>
+                                </xsl:if>
+                                <xsl:if test="marc:subfield[@code='y']">
+                                        <xsl:value-of select="marc:subfield[@code='y']"/>
+                                </xsl:if>
+                                <xsl:if test="marc:subfield[@code='m']">
+                                        <xsl:value-of select="marc:subfield[@code='m']"/>
+                                </xsl:if>
+                        </identifier>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="subtitle">
+                <xsl:if test="marc:subfield[@code='b']">
+                        <subTitle>
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString">
+                                                <xsl:value-of select="marc:subfield[@code='b']"/>
+                                                <!--<xsl:call-template name="subfieldSelect">
+                                                        <xsl:with-param name="codes">b</xsl:with-param>
+                                                </xsl:call-template>-->
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </subTitle>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="script">
+                <xsl:param name="scriptCode"/>
+                <xsl:attribute name="script">
+                        <xsl:choose>
+                                <xsl:when test="$scriptCode='(3'">Arabic</xsl:when>
+                                <xsl:when test="$scriptCode='(B'">Latin</xsl:when>
+                                <xsl:when test="$scriptCode='$1'">Chinese, Japanese, Korean</xsl:when>
+                                <xsl:when test="$scriptCode='(N'">Cyrillic</xsl:when>
+                                <xsl:when test="$scriptCode='(2'">Hebrew</xsl:when>
+                                <xsl:when test="$scriptCode='(S'">Greek</xsl:when>
+                        </xsl:choose>
+                </xsl:attribute>
+        </xsl:template>
+        <xsl:template name="parsePart">
+                <!-- assumes 773$q= 1:2:3<4
+                     with up to 3 levels and one optional start page
+                -->
+                <xsl:variable name="level1">
+                        <xsl:choose>
+                                <xsl:when test="contains(text(),':')">
+                                        <!-- 1:2 -->
+                                        <xsl:value-of select="substring-before(text(),':')"/>
+                                </xsl:when>
+                                <xsl:when test="not(contains(text(),':'))">
+                                        <!-- 1 or 1<3 -->
+                                        <xsl:if test="contains(text(),'<')">
+                                                <!-- 1<3 -->
+                                                <xsl:value-of select="substring-before(text(),'<')"/>
+                                        </xsl:if>
+                                        <xsl:if test="not(contains(text(),'<'))">
+                                                <!-- 1 -->
+                                                <xsl:value-of select="text()"/>
+                                        </xsl:if>
+                                </xsl:when>
+                        </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="sici2">
+                        <xsl:choose>
+                                <xsl:when test="starts-with(substring-after(text(),$level1),':')">
+                                        <xsl:value-of select="substring(substring-after(text(),$level1),2)"/>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                        <xsl:value-of select="substring-after(text(),$level1)"/>
+                                </xsl:otherwise>
+                        </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="level2">
+                        <xsl:choose>
+                                <xsl:when test="contains($sici2,':')">
+                                        <!--  2:3<4  -->
+                                        <xsl:value-of select="substring-before($sici2,':')"/>
+                                </xsl:when>
+                                <xsl:when test="contains($sici2,'<')">
+                                        <!-- 1: 2<4 -->
+                                        <xsl:value-of select="substring-before($sici2,'<')"/>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                        <xsl:value-of select="$sici2"/>
+                                        <!-- 1:2 -->
+                                </xsl:otherwise>
+                        </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="sici3">
+                        <xsl:choose>
+                                <xsl:when test="starts-with(substring-after($sici2,$level2),':')">
+                                        <xsl:value-of select="substring(substring-after($sici2,$level2),2)"/>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                        <xsl:value-of select="substring-after($sici2,$level2)"/>
+                                </xsl:otherwise>
+                        </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="level3">
+                        <xsl:choose>
+                                <xsl:when test="contains($sici3,'<')">
+                                        <!-- 2<4 -->
+                                        <xsl:value-of select="substring-before($sici3,'<')"/>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                        <xsl:value-of select="$sici3"/>
+                                        <!-- 3 -->
+                                </xsl:otherwise>
+                        </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="page">
+                        <xsl:if test="contains(text(),'<')">
+                                <xsl:value-of select="substring-after(text(),'<')"/>
+                        </xsl:if>
+                </xsl:variable>
+                <xsl:if test="$level1">
+                        <detail level="1">
+                                <number>
+                                        <xsl:value-of select="$level1"/>
+                                </number>
+                        </detail>
+                </xsl:if>
+                <xsl:if test="$level2">
+                        <detail level="2">
+                                <number>
+                                        <xsl:value-of select="$level2"/>
+                                </number>
+                        </detail>
+                </xsl:if>
+                <xsl:if test="$level3">
+                        <detail level="3">
+                                <number>
+                                        <xsl:value-of select="$level3"/>
+                                </number>
+                        </detail>
+                </xsl:if>
+                <xsl:if test="$page">
+                        <extent unit="page">
+                                <start>
+                                        <xsl:value-of select="$page"/>
+                                </start>
+                        </extent>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="getLanguage">
+                <xsl:param name="langString"/>
+                <xsl:param name="controlField008-35-37"/>
+                <xsl:variable name="length" select="string-length($langString)"/>
+                <xsl:choose>
+                        <xsl:when test="$length=0"/>
+                        <xsl:when test="$controlField008-35-37=substring($langString,1,3)">
+                                <xsl:call-template name="getLanguage">
+                                        <xsl:with-param name="langString" select="substring($langString,4,$length)"/>
+                                        <xsl:with-param name="controlField008-35-37" select="$controlField008-35-37"/>
+                                </xsl:call-template>
+                        </xsl:when>
+                        <xsl:otherwise>
+                                <language>
+                                        <languageTerm authority="iso639-2b" type="code">
+                                                <xsl:value-of select="substring($langString,1,3)"/>
+                                        </languageTerm>
+                                </language>
+                                <xsl:call-template name="getLanguage">
+                                        <xsl:with-param name="langString" select="substring($langString,4,$length)"/>
+                                        <xsl:with-param name="controlField008-35-37" select="$controlField008-35-37"/>
+                                </xsl:call-template>
+                        </xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+        <xsl:template name="isoLanguage">
+                <xsl:param name="currentLanguage"/>
+                <xsl:param name="usedLanguages"/>
+                <xsl:param name="remainingLanguages"/>
+                <xsl:choose>
+                        <xsl:when test="string-length($currentLanguage)=0"/>
+                        <xsl:when test="not(contains($usedLanguages, $currentLanguage))">
+                                <language>
+                                        <xsl:if test="@code!='a'">
+                                                <xsl:attribute name="objectPart">
+                                                        <xsl:choose>
+                                                                <xsl:when test="@code='b'">summary or subtitle</xsl:when>
+                                                                <xsl:when test="@code='d'">sung or spoken text</xsl:when>
+                                                                <xsl:when test="@code='e'">libretto</xsl:when>
+                                                                <xsl:when test="@code='f'">table of contents</xsl:when>
+                                                                <xsl:when test="@code='g'">accompanying material</xsl:when>
+                                                                <xsl:when test="@code='h'">translation</xsl:when>
+                                                        </xsl:choose>
+                                                </xsl:attribute>
+                                        </xsl:if>
+                                        <languageTerm authority="iso639-2b" type="code">
+                                                <xsl:value-of select="$currentLanguage"/>
+                                        </languageTerm>
+                                </language>
+                                <xsl:call-template name="isoLanguage">
+                                        <xsl:with-param name="currentLanguage">
+                                                <xsl:value-of select="substring($remainingLanguages,1,3)"/>
+                                        </xsl:with-param>
+                                        <xsl:with-param name="usedLanguages">
+                                                <xsl:value-of select="concat($usedLanguages,$currentLanguage)"/>
+                                        </xsl:with-param>
+                                        <xsl:with-param name="remainingLanguages">
+                                                <xsl:value-of
+                                                        select="substring($remainingLanguages,4,string-length($remainingLanguages))"
+                                                />
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </xsl:when>
+                        <xsl:otherwise>
+                                <xsl:call-template name="isoLanguage">
+                                        <xsl:with-param name="currentLanguage">
+                                                <xsl:value-of select="substring($remainingLanguages,1,3)"/>
+                                        </xsl:with-param>
+                                        <xsl:with-param name="usedLanguages">
+                                                <xsl:value-of select="concat($usedLanguages,$currentLanguage)"/>
+                                        </xsl:with-param>
+                                        <xsl:with-param name="remainingLanguages">
+                                                <xsl:value-of
+                                                        select="substring($remainingLanguages,4,string-length($remainingLanguages))"
+                                                />
+                                        </xsl:with-param>
+                                </xsl:call-template>
+                        </xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+        <xsl:template name="chopBrackets">
+                <xsl:param name="chopString"/>
+                <xsl:variable name="string">
+                        <xsl:call-template name="chopPunctuation">
+                                <xsl:with-param name="chopString" select="$chopString"/>
+                        </xsl:call-template>
+                </xsl:variable>
+                <xsl:if test="substring($string, 1,1)='['">
+                        <xsl:value-of select="substring($string,2, string-length($string)-2)"/>
+                </xsl:if>
+                <xsl:if test="substring($string, 1,1)!='['">
+                        <xsl:value-of select="$string"/>
+                </xsl:if>
+        </xsl:template>
+        <xsl:template name="rfcLanguages">
+                <xsl:param name="nodeNum"/>
+                <xsl:param name="usedLanguages"/>
+                <xsl:param name="controlField008-35-37"/>
+                <xsl:variable name="currentLanguage" select="."/>
+                <xsl:choose>
+                        <xsl:when test="not($currentLanguage)"/>
+                        <xsl:when
+                                test="$currentLanguage!=$controlField008-35-37 and $currentLanguage!='rfc3066'">
+                                <xsl:if test="not(contains($usedLanguages,$currentLanguage))">
+                                        <language>
+                                                <xsl:if test="@code!='a'">
+                                                        <xsl:attribute name="objectPart">
+                                                                <xsl:choose>
+                                                                        <xsl:when test="@code='b'">summary or subtitle</xsl:when>
+                                                                        <xsl:when test="@code='d'">sung or spoken text</xsl:when>
+                                                                        <xsl:when test="@code='e'">libretto</xsl:when>
+                                                                        <xsl:when test="@code='f'">table of contents</xsl:when>
+                                                                        <xsl:when test="@code='g'">accompanying material</xsl:when>
+                                                                        <xsl:when test="@code='h'">translation</xsl:when>
+                                                                </xsl:choose>
+                                                        </xsl:attribute>
+                                                </xsl:if>
+                                                <languageTerm authority="rfc3066" type="code">
+                                                        <xsl:value-of select="$currentLanguage"/>
+                                                </languageTerm>
+                                        </language>
+                                </xsl:if>
+                        </xsl:when>
+                        <xsl:otherwise> </xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+
+    <xsl:template name="datafield">
+                <xsl:param name="tag"/>
+                <xsl:param name="ind1">
+                        <xsl:text> </xsl:text>
+                </xsl:param>
+                <xsl:param name="ind2">
+                        <xsl:text> </xsl:text>
+                </xsl:param>
+                <xsl:param name="subfields"/>
+                <xsl:element name="marc:datafield">
+                        <xsl:attribute name="tag">
+                                <xsl:value-of select="$tag"/>
+                        </xsl:attribute>
+                        <xsl:attribute name="ind1">
+                                <xsl:value-of select="$ind1"/>
+                        </xsl:attribute>
+                        <xsl:attribute name="ind2">
+                                <xsl:value-of select="$ind2"/>
+                        </xsl:attribute>
+                        <xsl:copy-of select="$subfields"/>
+                </xsl:element>
+        </xsl:template>
+
+        <xsl:template name="subfieldSelect">
+                <xsl:param name="codes">abcdefghijklmnopqrstuvwxyz</xsl:param>
+                <xsl:param name="delimeter">
+                        <xsl:text> </xsl:text>
+                </xsl:param>
+                <xsl:variable name="str">
+                        <xsl:for-each select="marc:subfield">
+                                <xsl:if test="contains($codes, @code)">
+                                        <xsl:value-of select="text()"/>
+                                        <xsl:value-of select="$delimeter"/>
+                                </xsl:if>
+                        </xsl:for-each>
+                </xsl:variable>
+                <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
+        </xsl:template>
+
+        <xsl:template name="buildSpaces">
+                <xsl:param name="spaces"/>
+                <xsl:param name="char">
+                        <xsl:text> </xsl:text>
+                </xsl:param>
+                <xsl:if test="$spaces>0">
+                        <xsl:value-of select="$char"/>
+                        <xsl:call-template name="buildSpaces">
+                                <xsl:with-param name="spaces" select="$spaces - 1"/>
+                                <xsl:with-param name="char" select="$char"/>
+                        </xsl:call-template>
+                </xsl:if>
+        </xsl:template>
+
+        <xsl:template name="chopPunctuation">
+                <xsl:param name="chopString"/>
+                <xsl:param name="punctuation">
+                        <xsl:text>.:,;/ </xsl:text>
+                </xsl:param>
+                <xsl:variable name="length" select="string-length($chopString)"/>
+                <xsl:choose>
+                        <xsl:when test="$length=0"/>
+                        <xsl:when test="contains($punctuation, substring($chopString,$length,1))">
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
+                                        <xsl:with-param name="punctuation" select="$punctuation"/>
+                                </xsl:call-template>
+                        </xsl:when>
+                        <xsl:when test="not($chopString)"/>
+                        <xsl:otherwise>
+                                <xsl:value-of select="$chopString"/>
+                        </xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+
+        <xsl:template name="chopPunctuationFront">
+                <xsl:param name="chopString"/>
+                <xsl:variable name="length" select="string-length($chopString)"/>
+                <xsl:choose>
+                        <xsl:when test="$length=0"/>
+                        <xsl:when test="contains('.:,;/[ ', substring($chopString,1,1))">
+                                <xsl:call-template name="chopPunctuationFront">
+                                        <xsl:with-param name="chopString" select="substring($chopString,2,$length - 1)"
+                                        />
+                                </xsl:call-template>
+                        </xsl:when>
+                        <xsl:when test="not($chopString)"/>
+                        <xsl:otherwise>
+                                <xsl:value-of select="$chopString"/>
+                        </xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+
+        <xsl:template name="chopPunctuationBack">
+                <xsl:param name="chopString"/>
+                <xsl:param name="punctuation">
+                        <xsl:text>.:,;/] </xsl:text>
+                </xsl:param>
+                <xsl:variable name="length" select="string-length($chopString)"/>
+                <xsl:choose>
+                        <xsl:when test="$length=0"/>
+                        <xsl:when test="contains($punctuation, substring($chopString,$length,1))">
+                                <xsl:call-template name="chopPunctuation">
+                                        <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
+                                        <xsl:with-param name="punctuation" select="$punctuation"/>
+                                </xsl:call-template>
+                        </xsl:when>
+                        <xsl:when test="not($chopString)"/>
+                        <xsl:otherwise>
+                                <xsl:value-of select="$chopString"/>
+                        </xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+
+        <!-- nate added 12/14/2007 for lccn.loc.gov: url encode ampersand, etc. -->
+        <xsl:template name="url-encode">
+
+                <xsl:param name="str"/>
+
+                <xsl:if test="$str">
+                        <xsl:variable name="first-char" select="substring($str,1,1)"/>
+                        <xsl:choose>
+                                <xsl:when test="contains($safe,$first-char)">
+                                        <xsl:value-of select="$first-char"/>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                        <xsl:variable name="codepoint">
+                                                <xsl:choose>
+                                                        <xsl:when test="contains($ascii,$first-char)">
+                                                                <xsl:value-of
+                                                                        select="string-length(substring-before($ascii,$first-char)) + 32"
+                                                                />
+                                                        </xsl:when>
+                                                        <xsl:when test="contains($latin1,$first-char)">
+                                                                <xsl:value-of
+                                                                        select="string-length(substring-before($latin1,$first-char)) + 160"/>
+                                                                <!-- was 160 -->
+                                                        </xsl:when>
+                                                        <xsl:otherwise>
+                                                                <xsl:message terminate="no">Warning: string contains a character
+                                                                        that is out of range! Substituting "?".</xsl:message>
+                                                                <xsl:text>63</xsl:text>
+                                                        </xsl:otherwise>
+                                                </xsl:choose>
+                                        </xsl:variable>
+                                        <xsl:variable name="hex-digit1"
+                                                select="substring($hex,floor($codepoint div 16) + 1,1)"/>
+                                        <xsl:variable name="hex-digit2" select="substring($hex,$codepoint mod 16 + 1,1)"/>
+                                        <!-- <xsl:value-of select="concat('%',$hex-digit2)"/> -->
+                                        <xsl:value-of select="concat('%',$hex-digit1,$hex-digit2)"/>
+                                </xsl:otherwise>
+                        </xsl:choose>
+                        <xsl:if test="string-length($str) > 1">
+                                <xsl:call-template name="url-encode">
+                                        <xsl:with-param name="str" select="substring($str,2)"/>
+                                </xsl:call-template>
+                        </xsl:if>
+                </xsl:if>
+        </xsl:template>
+</xsl:stylesheet>$XXXX$ where name = $$mods33$$;
+
+
+
+SELECT evergreen.upgrade_deps_block_check('1103', :eg_version);
+
+INSERT INTO config.metabib_field (id, field_class, name, label, browse_field)
+    VALUES (45, 'keyword', 'blob', 'All searchable fields', FALSE);
+
+INSERT INTO config.metabib_field (id, field_class, name, format, weight,
+    label, xpath, display_field, search_field, browse_field, facet_field)
+VALUES (
+    53, 'title', 'maintitle', 'marcxml', 10,
+    oils_i18n_gettext(53, 'Main Title', 'cmf', 'label'),
+    $$//*[@tag='245']/*[@code='a']$$,
+    FALSE, TRUE, FALSE, FALSE
+);
+
+INSERT INTO config.metabib_field_virtual_map (real, virtual)
+    SELECT  id,
+            45
+      FROM  config.metabib_field
+      WHERE search_field
+            AND id NOT IN (15, 45, 38, 40) -- keyword|keyword, self, edition, publisher
+            AND id NOT IN (SELECT real FROM config.metabib_field_virtual_map);
+
+UPDATE config.metabib_field SET xpath=$$//mods32:mods/mods32:subject[not(descendant::mods32:geographicCode)]$$ WHERE id = 16;
+
+UPDATE config.metabib_field_virtual_map SET weight = -1 WHERE real = 39;
+UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 41;
+UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 42;
+UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 46;
+UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 47;
+UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 48;
+UPDATE config.metabib_field_virtual_map SET weight = 0 WHERE real = 50;
+UPDATE config.metabib_field_virtual_map SET weight = 8 WHERE real = 6;
+UPDATE config.metabib_field_virtual_map SET weight = 8 WHERE real = 8;
+UPDATE config.metabib_field_virtual_map SET weight = 8 WHERE real = 16;
+UPDATE config.metabib_field_virtual_map SET weight = 12 WHERE real = 53;
+
+-- Stemming for genre
+INSERT INTO config.metabib_field_ts_map (metabib_field, ts_config)
+    SELECT 33, 'english_nostop' WHERE NOT EXISTS (
+        SELECT 1 FROM config.metabib_field_ts_map WHERE metabib_field = 33 AND ts_config = 'english_nostop'
+    )
+;
+
+
+SELECT evergreen.upgrade_deps_block_check('1104', :eg_version);
+
+INSERT INTO config.org_unit_setting_type
+( name, grp, label, description, datatype )
+VALUES
+	('circ.clear_hold_on_checkout',
+	 'circ',
+ 	oils_i18n_gettext('circ.clear_hold_on_checkout',
+     		'Clear hold when other patron checks out item',
+     		'coust', 'label'),
+        oils_i18n_gettext('circ.clear_hold_on_checkout',
+            'Default to cancel the hold when patron A checks out item on hold for patron B.',
+     		'coust', 'description'),
+   	'bool');
+
+
+
+SELECT evergreen.upgrade_deps_block_check('1105', :eg_version);
+
+INSERT into config.org_unit_setting_type (name, label, grp, description, datatype) 
+values ('webstaff.circ.itemsout_notice_count_excludes_courtesies','Exclude Courtesy Notices from Patrons Itemsout Notices Count',
+    'circ', 'Exclude Courtesy Notices from Patron Itemsout Notices Count', 'bool');
+
+
+SELECT evergreen.upgrade_deps_block_check('1106', :eg_version);
+
+ALTER TABLE money.billing
+	ADD COLUMN create_date TIMESTAMP WITH TIME ZONE,
+	ADD COLUMN period_start    TIMESTAMP WITH TIME ZONE,
+	ADD COLUMN period_end  TIMESTAMP WITH TIME ZONE;
+
+--Disable materialized update trigger
+--It takes forever, and doesn't matter yet for what we are doing, as the
+--view definition is unchanged (still using billing_ts)
+ALTER TABLE money.billing DISABLE TRIGGER mat_summary_upd_tgr;
+
+--Limit to btype=1 / 'Overdue Materials'
+--Update day-granular fines first (i.e. 24 hour, 1 day, 2 day, etc., all of which are multiples of 86400 seconds), and simply remove the time portion of timestamp
+UPDATE money.billing mb
+	SET period_start = date_trunc('day', billing_ts), period_end = date_trunc('day', billing_ts) + (ac.fine_interval - '1 second')
+	FROM action.circulation ac
+WHERE mb.xact = ac.id
+	AND mb.btype = 1
+	AND (EXTRACT(EPOCH FROM ac.fine_interval))::integer % 86400 = 0;
+
+--Update fines for non-day intervals
+UPDATE money.billing mb
+	SET period_start = billing_ts - ac.fine_interval + interval '1 sec', period_end = billing_ts
+	FROM action.circulation ac
+WHERE mb.xact = ac.id
+	AND mb.btype = 1
+	AND (EXTRACT(EPOCH FROM ac.fine_interval))::integer % 86400 > 0;
+
+SET CONSTRAINTS ALL IMMEDIATE;
+UPDATE money.billing SET create_date = COALESCE(period_start, billing_ts);
+
+--Re-enable update trigger
+ALTER TABLE money.billing ENABLE TRIGGER mat_summary_upd_tgr;
+
+ALTER TABLE money.billing ALTER COLUMN create_date SET DEFAULT NOW();
+ALTER TABLE money.billing ALTER COLUMN create_date SET NOT NULL;
+
+CREATE INDEX m_b_create_date_idx ON money.billing (create_date);
+CREATE INDEX m_b_period_start_idx ON money.billing (period_start);
+CREATE INDEX m_b_period_end_idx ON money.billing (period_end);
+
+CREATE OR REPLACE FUNCTION money.maintain_billing_ts () RETURNS TRIGGER AS $$
+BEGIN
+	NEW.billing_ts := COALESCE(NEW.period_end, NEW.create_date);
+	RETURN NEW;
+END;
+$$ LANGUAGE PLPGSQL;
+CREATE TRIGGER maintain_billing_ts_tgr BEFORE INSERT OR UPDATE ON money.billing FOR EACH ROW EXECUTE PROCEDURE money.maintain_billing_ts();
+
+  
+SELECT evergreen.upgrade_deps_block_check('1107', :eg_version);
+
+CREATE OR REPLACE FUNCTION asset.merge_record_assets( target_record BIGINT, source_record BIGINT ) RETURNS INT AS $func$
+DECLARE
+    moved_objects INT := 0;
+    source_cn     asset.call_number%ROWTYPE;
+    target_cn     asset.call_number%ROWTYPE;
+    metarec       metabib.metarecord%ROWTYPE;
+    hold          action.hold_request%ROWTYPE;
+    ser_rec       serial.record_entry%ROWTYPE;
+    ser_sub       serial.subscription%ROWTYPE;
+    acq_lineitem  acq.lineitem%ROWTYPE;
+    acq_request   acq.user_request%ROWTYPE;
+    booking       booking.resource_type%ROWTYPE;
+    source_part   biblio.monograph_part%ROWTYPE;
+    target_part   biblio.monograph_part%ROWTYPE;
+    multi_home    biblio.peer_bib_copy_map%ROWTYPE;
+    uri_count     INT := 0;
+    counter       INT := 0;
+    uri_datafield TEXT;
+    uri_text      TEXT := '';
+BEGIN
+
+    -- move any 856 entries on records that have at least one MARC-mapped URI entry
+    SELECT  INTO uri_count COUNT(*)
+      FROM  asset.uri_call_number_map m
+            JOIN asset.call_number cn ON (m.call_number = cn.id)
+      WHERE cn.record = source_record;
+
+    IF uri_count > 0 THEN
+        
+        -- This returns more nodes than you might expect:
+        -- 7 instead of 1 for an 856 with $u $y $9
+        SELECT  COUNT(*) INTO counter
+          FROM  oils_xpath_table(
+                    'id',
+                    'marc',
+                    'biblio.record_entry',
+                    '//*[@tag="856"]',
+                    'id=' || source_record
+                ) as t(i int,c text);
+    
+        FOR i IN 1 .. counter LOOP
+            SELECT  '<datafield xmlns="http://www.loc.gov/MARC21/slim"' || 
+			' tag="856"' ||
+			' ind1="' || FIRST(ind1) || '"'  ||
+			' ind2="' || FIRST(ind2) || '">' ||
+                        STRING_AGG(
+                            '<subfield code="' || subfield || '">' ||
+                            regexp_replace(
+                                regexp_replace(
+                                    regexp_replace(data,'&','&','g'),
+                                    '>', '>', 'g'
+                                ),
+                                '<', '<', 'g'
+                            ) || '</subfield>', ''
+                        ) || '</datafield>' INTO uri_datafield
+              FROM  oils_xpath_table(
+                        'id',
+                        'marc',
+                        'biblio.record_entry',
+                        '//*[@tag="856"][position()=' || i || ']/@ind1|' ||
+                        '//*[@tag="856"][position()=' || i || ']/@ind2|' ||
+                        '//*[@tag="856"][position()=' || i || ']/*/@code|' ||
+                        '//*[@tag="856"][position()=' || i || ']/*[@code]',
+                        'id=' || source_record
+                    ) as t(id int,ind1 text, ind2 text,subfield text,data text);
+
+            -- As most of the results will be NULL, protect against NULLifying
+            -- the valid content that we do generate
+            uri_text := uri_text || COALESCE(uri_datafield, '');
+        END LOOP;
+
+        IF uri_text <> '' THEN
+            UPDATE  biblio.record_entry
+              SET   marc = regexp_replace(marc,'(</[^>]*record>)', uri_text || E'\\1')
+              WHERE id = target_record;
+        END IF;
+
+    END IF;
+
+	-- Find and move metarecords to the target record
+	SELECT	INTO metarec *
+	  FROM	metabib.metarecord
+	  WHERE	master_record = source_record;
+
+	IF FOUND THEN
+		UPDATE	metabib.metarecord
+		  SET	master_record = target_record,
+			mods = NULL
+		  WHERE	id = metarec.id;
+
+		moved_objects := moved_objects + 1;
+	END IF;
+
+	-- Find call numbers attached to the source ...
+	FOR source_cn IN SELECT * FROM asset.call_number WHERE record = source_record LOOP
+
+		SELECT	INTO target_cn *
+		  FROM	asset.call_number
+		  WHERE	label = source_cn.label
+            AND prefix = source_cn.prefix
+            AND suffix = source_cn.suffix
+			AND owning_lib = source_cn.owning_lib
+			AND record = target_record
+			AND NOT deleted;
+
+		-- ... and if there's a conflicting one on the target ...
+		IF FOUND THEN
+
+			-- ... move the copies to that, and ...
+			UPDATE	asset.copy
+			  SET	call_number = target_cn.id
+			  WHERE	call_number = source_cn.id;
+
+			-- ... move V holds to the move-target call number
+			FOR hold IN SELECT * FROM action.hold_request WHERE target = source_cn.id AND hold_type = 'V' LOOP
+		
+				UPDATE	action.hold_request
+				  SET	target = target_cn.id
+				  WHERE	id = hold.id;
+		
+				moved_objects := moved_objects + 1;
+			END LOOP;
+        
+            UPDATE asset.call_number SET deleted = TRUE WHERE id = source_cn.id;
+
+		-- ... if not ...
+		ELSE
+			-- ... just move the call number to the target record
+			UPDATE	asset.call_number
+			  SET	record = target_record
+			  WHERE	id = source_cn.id;
+		END IF;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find T holds targeting the source record ...
+	FOR hold IN SELECT * FROM action.hold_request WHERE target = source_record AND hold_type = 'T' LOOP
+
+		-- ... and move them to the target record
+		UPDATE	action.hold_request
+		  SET	target = target_record
+		  WHERE	id = hold.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find serial records targeting the source record ...
+	FOR ser_rec IN SELECT * FROM serial.record_entry WHERE record = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	serial.record_entry
+		  SET	record = target_record
+		  WHERE	id = ser_rec.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find serial subscriptions targeting the source record ...
+	FOR ser_sub IN SELECT * FROM serial.subscription WHERE record_entry = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	serial.subscription
+		  SET	record_entry = target_record
+		  WHERE	id = ser_sub.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find booking resource types targeting the source record ...
+	FOR booking IN SELECT * FROM booking.resource_type WHERE record = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	booking.resource_type
+		  SET	record = target_record
+		  WHERE	id = booking.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find acq lineitems targeting the source record ...
+	FOR acq_lineitem IN SELECT * FROM acq.lineitem WHERE eg_bib_id = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	acq.lineitem
+		  SET	eg_bib_id = target_record
+		  WHERE	id = acq_lineitem.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find acq user purchase requests targeting the source record ...
+	FOR acq_request IN SELECT * FROM acq.user_request WHERE eg_bib = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	acq.user_request
+		  SET	eg_bib = target_record
+		  WHERE	id = acq_request.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find parts attached to the source ...
+	FOR source_part IN SELECT * FROM biblio.monograph_part WHERE record = source_record LOOP
+
+		SELECT	INTO target_part *
+		  FROM	biblio.monograph_part
+		  WHERE	label = source_part.label
+			AND record = target_record;
+
+		-- ... and if there's a conflicting one on the target ...
+		IF FOUND THEN
+
+			-- ... move the copy-part maps to that, and ...
+			UPDATE	asset.copy_part_map
+			  SET	part = target_part.id
+			  WHERE	part = source_part.id;
+
+			-- ... move P holds to the move-target part
+			FOR hold IN SELECT * FROM action.hold_request WHERE target = source_part.id AND hold_type = 'P' LOOP
+		
+				UPDATE	action.hold_request
+				  SET	target = target_part.id
+				  WHERE	id = hold.id;
+		
+				moved_objects := moved_objects + 1;
+			END LOOP;
+
+		-- ... if not ...
+		ELSE
+			-- ... just move the part to the target record
+			UPDATE	biblio.monograph_part
+			  SET	record = target_record
+			  WHERE	id = source_part.id;
+		END IF;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find multi_home items attached to the source ...
+	FOR multi_home IN SELECT * FROM biblio.peer_bib_copy_map WHERE peer_record = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	biblio.peer_bib_copy_map
+		  SET	peer_record = target_record
+		  WHERE	id = multi_home.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- And delete mappings where the item's home bib was merged with the peer bib
+	DELETE FROM biblio.peer_bib_copy_map WHERE peer_record = (
+		SELECT (SELECT record FROM asset.call_number WHERE id = call_number)
+		FROM asset.copy WHERE id = target_copy
+	);
+
+    -- replace book bag entries of source_record with target_record
+    UPDATE container.biblio_record_entry_bucket_item
+        SET target_biblio_record_entry = target_record
+        WHERE bucket IN (SELECT id FROM container.biblio_record_entry_bucket WHERE btype = 'bookbag')
+        AND target_biblio_record_entry = source_record;
+
+    -- Finally, "delete" the source record
+    DELETE FROM biblio.record_entry WHERE id = source_record;
+
+	-- That's all, folks!
+	RETURN moved_objects;
+END;
+$func$ LANGUAGE plpgsql;
+
+
+SELECT evergreen.upgrade_deps_block_check('1108', :eg_version);
+
+CREATE OR REPLACE FUNCTION asset.merge_record_assets( target_record BIGINT, source_record BIGINT ) RETURNS INT AS $func$
+DECLARE
+    moved_objects INT := 0;
+    source_cn     asset.call_number%ROWTYPE;
+    target_cn     asset.call_number%ROWTYPE;
+    metarec       metabib.metarecord%ROWTYPE;
+    hold          action.hold_request%ROWTYPE;
+    ser_rec       serial.record_entry%ROWTYPE;
+    ser_sub       serial.subscription%ROWTYPE;
+    acq_lineitem  acq.lineitem%ROWTYPE;
+    acq_request   acq.user_request%ROWTYPE;
+    booking       booking.resource_type%ROWTYPE;
+    source_part   biblio.monograph_part%ROWTYPE;
+    target_part   biblio.monograph_part%ROWTYPE;
+    multi_home    biblio.peer_bib_copy_map%ROWTYPE;
+    uri_count     INT := 0;
+    counter       INT := 0;
+    uri_datafield TEXT;
+    uri_text      TEXT := '';
+BEGIN
+
+    -- move any 856 entries on records that have at least one MARC-mapped URI entry
+    SELECT  INTO uri_count COUNT(*)
+      FROM  asset.uri_call_number_map m
+            JOIN asset.call_number cn ON (m.call_number = cn.id)
+      WHERE cn.record = source_record;
+
+    IF uri_count > 0 THEN
+        
+        -- This returns more nodes than you might expect:
+        -- 7 instead of 1 for an 856 with $u $y $9
+        SELECT  COUNT(*) INTO counter
+          FROM  oils_xpath_table(
+                    'id',
+                    'marc',
+                    'biblio.record_entry',
+                    '//*[@tag="856"]',
+                    'id=' || source_record
+                ) as t(i int,c text);
+    
+        FOR i IN 1 .. counter LOOP
+            SELECT  '<datafield xmlns="http://www.loc.gov/MARC21/slim"' || 
+			' tag="856"' ||
+			' ind1="' || FIRST(ind1) || '"'  ||
+			' ind2="' || FIRST(ind2) || '">' ||
+                        STRING_AGG(
+                            '<subfield code="' || subfield || '">' ||
+                            regexp_replace(
+                                regexp_replace(
+                                    regexp_replace(data,'&','&','g'),
+                                    '>', '>', 'g'
+                                ),
+                                '<', '<', 'g'
+                            ) || '</subfield>', ''
+                        ) || '</datafield>' INTO uri_datafield
+              FROM  oils_xpath_table(
+                        'id',
+                        'marc',
+                        'biblio.record_entry',
+                        '//*[@tag="856"][position()=' || i || ']/@ind1|' ||
+                        '//*[@tag="856"][position()=' || i || ']/@ind2|' ||
+                        '//*[@tag="856"][position()=' || i || ']/*/@code|' ||
+                        '//*[@tag="856"][position()=' || i || ']/*[@code]',
+                        'id=' || source_record
+                    ) as t(id int,ind1 text, ind2 text,subfield text,data text);
+
+            -- As most of the results will be NULL, protect against NULLifying
+            -- the valid content that we do generate
+            uri_text := uri_text || COALESCE(uri_datafield, '');
+        END LOOP;
+
+        IF uri_text <> '' THEN
+            UPDATE  biblio.record_entry
+              SET   marc = regexp_replace(marc,'(</[^>]*record>)', uri_text || E'\\1')
+              WHERE id = target_record;
+        END IF;
+
+    END IF;
+
+	-- Find and move metarecords to the target record
+	SELECT	INTO metarec *
+	  FROM	metabib.metarecord
+	  WHERE	master_record = source_record;
+
+	IF FOUND THEN
+		UPDATE	metabib.metarecord
+		  SET	master_record = target_record,
+			mods = NULL
+		  WHERE	id = metarec.id;
+
+		moved_objects := moved_objects + 1;
+	END IF;
+
+	-- Find call numbers attached to the source ...
+	FOR source_cn IN SELECT * FROM asset.call_number WHERE record = source_record LOOP
+
+		SELECT	INTO target_cn *
+		  FROM	asset.call_number
+		  WHERE	label = source_cn.label
+            AND prefix = source_cn.prefix
+            AND suffix = source_cn.suffix
+			AND owning_lib = source_cn.owning_lib
+			AND record = target_record
+			AND NOT deleted;
+
+		-- ... and if there's a conflicting one on the target ...
+		IF FOUND THEN
+
+			-- ... move the copies to that, and ...
+			UPDATE	asset.copy
+			  SET	call_number = target_cn.id
+			  WHERE	call_number = source_cn.id;
+
+			-- ... move V holds to the move-target call number
+			FOR hold IN SELECT * FROM action.hold_request WHERE target = source_cn.id AND hold_type = 'V' LOOP
+		
+				UPDATE	action.hold_request
+				  SET	target = target_cn.id
+				  WHERE	id = hold.id;
+		
+				moved_objects := moved_objects + 1;
+			END LOOP;
+        
+            UPDATE asset.call_number SET deleted = TRUE WHERE id = source_cn.id;
+
+		-- ... if not ...
+		ELSE
+			-- ... just move the call number to the target record
+			UPDATE	asset.call_number
+			  SET	record = target_record
+			  WHERE	id = source_cn.id;
+		END IF;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find T holds targeting the source record ...
+	FOR hold IN SELECT * FROM action.hold_request WHERE target = source_record AND hold_type = 'T' LOOP
+
+		-- ... and move them to the target record
+		UPDATE	action.hold_request
+		  SET	target = target_record
+		  WHERE	id = hold.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find serial records targeting the source record ...
+	FOR ser_rec IN SELECT * FROM serial.record_entry WHERE record = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	serial.record_entry
+		  SET	record = target_record
+		  WHERE	id = ser_rec.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find serial subscriptions targeting the source record ...
+	FOR ser_sub IN SELECT * FROM serial.subscription WHERE record_entry = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	serial.subscription
+		  SET	record_entry = target_record
+		  WHERE	id = ser_sub.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find booking resource types targeting the source record ...
+	FOR booking IN SELECT * FROM booking.resource_type WHERE record = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	booking.resource_type
+		  SET	record = target_record
+		  WHERE	id = booking.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find acq lineitems targeting the source record ...
+	FOR acq_lineitem IN SELECT * FROM acq.lineitem WHERE eg_bib_id = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	acq.lineitem
+		  SET	eg_bib_id = target_record
+		  WHERE	id = acq_lineitem.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find acq user purchase requests targeting the source record ...
+	FOR acq_request IN SELECT * FROM acq.user_request WHERE eg_bib = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	acq.user_request
+		  SET	eg_bib = target_record
+		  WHERE	id = acq_request.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find parts attached to the source ...
+	FOR source_part IN SELECT * FROM biblio.monograph_part WHERE record = source_record LOOP
+
+		SELECT	INTO target_part *
+		  FROM	biblio.monograph_part
+		  WHERE	label = source_part.label
+			AND record = target_record;
+
+		-- ... and if there's a conflicting one on the target ...
+		IF FOUND THEN
+
+			-- ... move the copy-part maps to that, and ...
+			UPDATE	asset.copy_part_map
+			  SET	part = target_part.id
+			  WHERE	part = source_part.id;
+
+			-- ... move P holds to the move-target part
+			FOR hold IN SELECT * FROM action.hold_request WHERE target = source_part.id AND hold_type = 'P' LOOP
+		
+				UPDATE	action.hold_request
+				  SET	target = target_part.id
+				  WHERE	id = hold.id;
+		
+				moved_objects := moved_objects + 1;
+			END LOOP;
+
+		-- ... if not ...
+		ELSE
+			-- ... just move the part to the target record
+			UPDATE	biblio.monograph_part
+			  SET	record = target_record
+			  WHERE	id = source_part.id;
+		END IF;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- Find multi_home items attached to the source ...
+	FOR multi_home IN SELECT * FROM biblio.peer_bib_copy_map WHERE peer_record = source_record LOOP
+		-- ... and move them to the target record
+		UPDATE	biblio.peer_bib_copy_map
+		  SET	peer_record = target_record
+		  WHERE	id = multi_home.id;
+
+		moved_objects := moved_objects + 1;
+	END LOOP;
+
+	-- And delete mappings where the item's home bib was merged with the peer bib
+	DELETE FROM biblio.peer_bib_copy_map WHERE peer_record = (
+		SELECT (SELECT record FROM asset.call_number WHERE id = call_number)
+		FROM asset.copy WHERE id = target_copy
+	);
+
+    -- Apply merge tracking
+    UPDATE biblio.record_entry 
+        SET merge_date = NOW() WHERE id = target_record;
+
+    UPDATE biblio.record_entry
+        SET merge_date = NOW(), merged_to = target_record
+        WHERE id = source_record;
+
+    -- replace book bag entries of source_record with target_record
+    UPDATE container.biblio_record_entry_bucket_item
+        SET target_biblio_record_entry = target_record
+        WHERE bucket IN (SELECT id FROM container.biblio_record_entry_bucket WHERE btype = 'bookbag')
+        AND target_biblio_record_entry = source_record;
+
+    -- Finally, "delete" the source record
+    DELETE FROM biblio.record_entry WHERE id = source_record;
+
+	-- That's all, folks!
+	RETURN moved_objects;
+END;
+$func$ LANGUAGE plpgsql;
+
+
+SELECT evergreen.upgrade_deps_block_check('1109', :eg_version);
+
+INSERT into config.org_unit_setting_type (name, label, grp, description, datatype)
+values ('circ.staff_placed_holds_fallback_to_ws_ou','Workstation OU fallback for staff-placed holds',
+        'circ', 'For staff-placed holds, in the absence of a patron preferred pickup location, fall back to using the staff workstation OU (rather than patron home OU)', 'bool');
+
+
+COMMIT;
+
+\qecho 
+\qecho Reingesting all records.  This may take a while. 
+\qecho This command can be stopped (control-c) and rerun later if needed: 
+\qecho 
+\qecho DO $FUNC$
+\qecho DECLARE
+\qecho     same_marc BOOL;
+\qecho BEGIN
+\qecho     SELECT INTO same_marc enabled FROM config.internal_flag WHERE name = 'ingest.reingest.force_on_same_marc';
+\qecho     UPDATE config.internal_flag SET enabled = true WHERE name = 'ingest.reingest.force_on_same_marc';
+\qecho     UPDATE biblio.record_entry SET id=id WHERE not deleted AND id > 0;
+\qecho     UPDATE config.internal_flag SET enabled = same_marc WHERE name = 'ingest.reingest.force_on_same_marc';
+\qecho END;
+\qecho $FUNC$;
+
+DO $FUNC$
+DECLARE
+    same_marc BOOL;
+BEGIN
+    SELECT INTO same_marc enabled FROM config.internal_flag WHERE name = 'ingest.reingest.force_on_same_marc';
+    UPDATE config.internal_flag SET enabled = true WHERE name = 'ingest.reingest.force_on_same_marc';
+    UPDATE biblio.record_entry SET id=id WHERE not deleted AND id > 0;
+    UPDATE config.internal_flag SET enabled = same_marc WHERE name = 'ingest.reingest.force_on_same_marc';
+END;
+$FUNC$;
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/about.html b/Open-ILS/xul/staff_client/chrome/content/main/about.html
index b2b87b6..eaee13a 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/about.html
+++ b/Open-ILS/xul/staff_client/chrome/content/main/about.html
@@ -1,7 +1,7 @@
 <html><head><script></script></head><body onload="var x = document.getElementById('version'); var version ='/xul/server/'.split(/\//)[2]; if (version == 'server') { version = 'versionless debug build'; } x.appendChild(document.createTextNode(version));">
 <h1 style="text-decoration: underline">Evergreen</h1>
 <p>Target Server ID: <span id="version"></span></p>
-<p>$HeadURL$</p>
+<p>http://git.evergreen-ils.org/?p=Evergreen.git;a=shortlog;h=refs/heads/tags/rel_3_1_0</p>
 <h2>What is Evergreen?</h2>
 <blockquote>
 <p>
diff --git a/Open-ILS/xul/staff_client/defaults/preferences/prefs.js b/Open-ILS/xul/staff_client/defaults/preferences/prefs.js
index 0613a13..b084118 100644
--- a/Open-ILS/xul/staff_client/defaults/preferences/prefs.js
+++ b/Open-ILS/xul/staff_client/defaults/preferences/prefs.js
@@ -11,7 +11,7 @@ pref("toolkit.singletonWindowType", "eg_main");
 pref("open-ils.enable_join_tabs", true);
 
 // We'll use this one to help brand some build information into the client, and rely on subversion keywords
-pref("open-ils.repository.headURL","$HeadURL$");
+pref("open-ils.repository.headURL","http://git.evergreen-ils.org/?p=Evergreen.git;a=shortlog;h=refs/heads/tags/rel_3_1_0");
 pref("open-ils.repository.author","$Author$");
 pref("open-ils.repository.revision","$Revision$");
 pref("open-ils.repository.date","$Date$");
diff --git a/Open-ILS/xul/staff_client/windowssetup.nsi b/Open-ILS/xul/staff_client/windowssetup.nsi
index a954357..ae0bbdf 100644
--- a/Open-ILS/xul/staff_client/windowssetup.nsi
+++ b/Open-ILS/xul/staff_client/windowssetup.nsi
@@ -3,7 +3,7 @@
 ; HM NIS Edit Wizard helper defines
 ; Old versions of makensis don't like this, moved to Makefile
 ;!define /file PRODUCT_VERSION "client/VERSION"
-!define PRODUCT_TAG "Master"
+!define PRODUCT_TAG "3.1"
 !define PRODUCT_INSTALL_TAG "${PRODUCT_TAG}"
 !define UI_IMAGESET "beta"
 ;!define UI_IMAGESET "release"
diff --git a/README b/README
deleted file mode 120000
index 1ee2103..0000000
--- a/README
+++ /dev/null
@@ -1 +0,0 @@
-docs/installation/server_installation.adoc
\ No newline at end of file
diff --git a/README b/README
new file mode 100644
index 0000000..9741340
--- /dev/null
+++ b/README
@@ -0,0 +1,685 @@
+Installing the Evergreen server
+===============================
+:toc:
+:numbered:
+
+Preamble: referenced user accounts
+----------------------------------
+
+In subsequent sections, we will refer to a number of different accounts, as
+follows:
+
+  * Linux user accounts:
+    ** The *user* Linux account is the account that you use to log onto the
+       Linux system as a regular user.
+    ** The *root* Linux account is an account that has system administrator
+       privileges. On Debian you can switch to this account from
+       your *user* account by issuing the `su -` command and entering the
+       password for the *root* account when prompted. On Ubuntu you can switch
+       to this account from your *user* account using the `sudo su -` command
+       and entering the password for your *user* account when prompted.
+    ** The *opensrf* Linux account is an account that you create when installing
+       OpenSRF. You can switch to this account from the *root* account by
+       issuing the `su - opensrf` command.
+    ** The *postgres* Linux account is created automatically when you install
+       the PostgreSQL database server. You can switch to this account from the
+       *root* account by issuing the `su - postgres` command.
+  * PostgreSQL user accounts:
+    ** The *evergreen* PostgreSQL account is a superuser account that you will
+       create to connect to the PostgreSQL database server.
+  * Evergreen administrator account:
+    ** The *egadmin* Evergreen account is an administrator account for
+       Evergreen that you will use to test connectivity and configure your
+       Evergreen instance.
+
+Preamble: developer instructions
+--------------------------------
+
+[NOTE]
+Skip this section if you are using an official release tarball downloaded
+from http://evergreen-ils.org/egdownloads
+
+Developers working directly with the source code from the Git repository,
+rather than an official release tarball, must perform one step before they 
+can proceed with the `./configure` step.
+
+As the *user* Linux account, issue the following command in the Evergreen
+source directory to generate the configure script and Makefiles:
+
+[source, bash]
+------------------------------------------------------------------------------
+autoreconf -i
+------------------------------------------------------------------------------
+
+Installing prerequisites
+------------------------
+
+  * **PostgreSQL**: The minimum supported version is 9.4.
+  * **Linux**: Evergreen has been tested on Debian Stretch (9), 
+    Debian Jessie (8), Debian Wheezy (7), Ubuntu Xenial Xerus (16.04), 
+    and Ubuntu Trusty Tahr (14.04).
+    If you are running an older version of these distributions, you may want 
+    to upgrade before upgrading Evergreen. For instructions on upgrading these
+    distributions, visit the Debian or Ubuntu websites.
+  * **OpenSRF**: The minimum supported version of OpenSRF is 3.0.0.
+
+
+Evergreen has a number of prerequisite packages that must be installed
+before you can successfully configure, compile, and install Evergreen.
+
+1. Begin by installing the most recent version of OpenSRF (3.0.0 or later).
+   You can download OpenSRF releases from http://evergreen-ils.org/opensrf-downloads/
+2. On some distributions, it is necessary to install PostgreSQL 9.4+ from external
+   repositories.
++
+  * Debian (Wheezy) and Ubuntu (Trusty) comes with older versions of 
+    PostgreSQL, so steps are taken to automatically utilize the 
+    PostgreSQL community's apt sources. 
+    (For complete details, see: https://wiki.postgresql.org/wiki/Apt)
+  * Debian (Jessie/Stretch) and Ubuntu (Xenial) comes with PostgreSQL 9.4+,
+    so no additional steps are required.
++
+3. Issue the following commands as the *root* Linux account to install
+   prerequisites using the `Makefile.install` prerequisite installer,
+   substituting `debian-stretch`, `debian-jessie`, `debian-wheezy`,
+   `ubuntu-xenial`, or `ubuntu-trusty` for <osname> below:
++
+[source, bash]
+------------------------------------------------------------------------------
+make -f Open-ILS/src/extras/Makefile.install <osname>
+------------------------------------------------------------------------------
++
+4. Add the libdbi-libdbd libraries to the system dynamic library path by
+   issuing the following commands as the *root* Linux account:
++
+[NOTE]
+You should skip this step if installing on Ubuntu Trusty/Xenial or Debian Jessie/Stretch. The Ubuntu
+and Debian Jessie/Stretch targets use libdbd-pgsql from packages.
++
+.Debian Wheezy
+[source, bash]
+------------------------------------------------------------------------------
+echo "/usr/local/lib/dbd" > /etc/ld.so.conf.d/eg.conf
+ldconfig
+------------------------------------------------------------------------------
+
+[[optional_developer_additions]]
+5. OPTIONAL: Developer additions
++
+To perform certain developer tasks from a Git source code checkout, 
+additional packages may be required.  As the *root* Linux account:
++
+ * To install packages needed for retrieving and managing web dependencies,
+   use the <osname>-developer Makefile.install target.  Currently, 
+   this is only needed for building and installing the (preview) browser 
+   staff client.
++
+[source, bash]
+------------------------------------------------------------------------------
+make -f Open-ILS/src/extras/Makefile.install <osname>-developer
+------------------------------------------------------------------------------
++
+ * To install packages required for building Evergreen translations, use
+   the <osname>-translator Makefile.install target.
++
+[source, bash]
+------------------------------------------------------------------------------
+make -f Open-ILS/src/extras/Makefile.install <osname>-translator
+------------------------------------------------------------------------------
++
+ * To install packages required for building Evergreen release bundles, use
+   the <osname>-packager Makefile.install target.
++
+[source, bash]
+------------------------------------------------------------------------------
+make -f Open-ILS/src/extras/Makefile.install <osname>-packager
+------------------------------------------------------------------------------
+
+Extra steps for web staff client
+--------------------------------
+
+[NOTE]
+Skip this entire section if you are using an official release tarball downloaded
+from http://evergreen-ils.org/downloads
+
+Install dependencies for web staff client
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+[NOTE]
+You may skip this section if you have installed the
+<<optional_developer_additions,optional developer additions>>.  You will still need to do the following
+steps in <<install_files_for_web_staff_client,Install files for web staff client>>.
+
+1. Install the long-term stability (LTS) release of
+https://nodejs.org[Node.js]. Add the Node.js `/bin` directory to your
+environment variable `PATH`.
+
+[[install_files_for_web_staff_client]]
+Install files for web staff client
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1. Building, Testing, Minification: The remaining steps all take place within
+   the staff JS web root:
++
+[source,sh]
+------------------------------------------------------------------------------
+cd $EVERGREEN_ROOT/Open-ILS/web/js/ui/default/staff/
+------------------------------------------------------------------------------
++
+2. Install Project-local Dependencies. npm inspects the 'package.json' file
+   for dependencies and fetches them from the Node package network.
++
+[source,sh]
+------------------------------------------------------------------------------
+npm install   # fetch JS dependencies
+------------------------------------------------------------------------------
++
+3. Run the build script.
++
+[source,sh]
+------------------------------------------------------------------------------
+# build, run tests, concat+minify
+npm run build-prod
+npm run test
+------------------------------------------------------------------------------
+
+Configuration and compilation instructions
+------------------------------------------
+
+For the time being, we are still installing everything in the `/openils/`
+directory. From the Evergreen source directory, issue the following commands as
+the *user* Linux account to configure and build Evergreen:
+
+[source, bash]
+------------------------------------------------------------------------------
+PATH=/openils/bin:$PATH ./configure --prefix=/openils --sysconfdir=/openils/conf
+make
+------------------------------------------------------------------------------
+
+These instructions assume that you have also installed OpenSRF under `/openils/`.
+If not, please adjust PATH as needed so that the Evergreen `configure` script
+can find `osrf_config`.
+
+Installation instructions
+-------------------------
+
+1. Once you have configured and compiled Evergreen, issue the following
+   command as the *root* Linux account to install Evergreen, build the server
+   portion of the staff client, and copy example configuration files to
+   `/openils/conf`.
+   Change the value of the `STAFF_CLIENT_STAMP_ID` variable to match the version
+   of the staff client that you will use to connect to the Evergreen server.
++
+[source, bash]
+------------------------------------------------------------------------------
+make STAFF_CLIENT_STAMP_ID=rel_3_1_0 install
+------------------------------------------------------------------------------
++
+2. The server portion of the staff client expects `http://hostname/xul/server`
+   to resolve. Issue the following commands as the *root* Linux account to
+   create a symbolic link pointing to the `server` subdirectory of the server
+   portion of the staff client that we just built using the staff client ID
+   'rel_name':
++
+[source, bash]
+------------------------------------------------------------------------------
+cd /openils/var/web/xul
+ln -sf rel_name/server server
+------------------------------------------------------------------------------
+
+Change ownership of the Evergreen files
+---------------------------------------
+
+All files in the `/openils/` directory and subdirectories must be owned by the
+`opensrf` user. Issue the following command as the *root* Linux account to
+change the ownership on the files:
+
+[source, bash]
+------------------------------------------------------------------------------
+chown -R opensrf:opensrf /openils
+------------------------------------------------------------------------------
+
+Run ldconfig
+------------
+
+On Debian Stretch, run the following command as the root user:
+
+[source, bash]
+------------------------------------------------------------------------------
+ldconfig
+------------------------------------------------------------------------------
+
+Additional Instructions for Developers
+--------------------------------------
+
+[NOTE]
+Skip this section if you are using an official release tarball downloaded
+from http://evergreen-ils.org/egdownloads
+
+Developers working directly with the source code from the Git repository,
+rather than an official release tarball, need to install the Dojo Toolkit
+set of JavaScript libraries. The appropriate version of Dojo is included in
+Evergreen release tarballs. Developers should install the Dojo 1.3.3 version
+of Dojo by issuing the following commands as the *opensrf* Linux account:
+
+[source, bash]
+------------------------------------------------------------------------------
+wget http://download.dojotoolkit.org/release-1.3.3/dojo-release-1.3.3.tar.gz
+tar -C /openils/var/web/js -xzf dojo-release-1.3.3.tar.gz
+cp -r /openils/var/web/js/dojo-release-1.3.3/* /openils/var/web/js/dojo/.
+------------------------------------------------------------------------------
+
+
+Configure the Apache Web server
+-------------------------------
+
+. Use the example configuration files in `Open-ILS/examples/apache/` (for
+Apache versions below 2.4) or `Open-ILS/examples/apache_24/` (for Apache
+versions 2.4 or greater) to configure your Web server for the Evergreen
+catalog, staff client, Web services, and administration interfaces. Issue the
+following commands as the *root* Linux account:
++
+.Debian Wheezy
+[source,bash]
+------------------------------------------------------------------------------
+cp Open-ILS/examples/apache/eg.conf       /etc/apache2/sites-available/
+cp Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/
+cp Open-ILS/examples/apache/eg_startup    /etc/apache2/
+# Now set up SSL
+mkdir /etc/apache2/ssl
+cd /etc/apache2/ssl
+------------------------------------------------------------------------------
++
+.Ubuntu Trusty/Xenial and Debian Jessie/Stretch
+[source,bash]
+------------------------------------------------------------------------------------
+cp Open-ILS/examples/apache_24/eg_24.conf       /etc/apache2/sites-available/eg.conf
+cp Open-ILS/examples/apache_24/eg_vhost_24.conf /etc/apache2/eg_vhost.conf
+cp Open-ILS/examples/apache/eg_startup    	/etc/apache2/
+# Now set up SSL
+mkdir /etc/apache2/ssl
+cd /etc/apache2/ssl
+------------------------------------------------------------------------------------
++
+. The `openssl` command cuts a new SSL key for your Apache server. For a
+production server, you should purchase a signed SSL certificate, but you can
+just use a self-signed certificate and accept the warnings in the staff client
+and browser during testing and development. Create an SSL key for the Apache
+server by issuing the following command as the *root* Linux account:
++
+[source,bash]
+------------------------------------------------------------------------------
+openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
+------------------------------------------------------------------------------
++
+. As the *root* Linux account, edit the `eg.conf` file that you copied into
+place.
+  a. To enable access to the offline upload / execute interface from any
+     workstation on any network, make the following change (and note that
+     you *must* secure this for a production instance):
+     * (Apache 2.2): Replace `Allow from 10.0.0.0/8` with `Allow from all`
+     * (Apache 2.4): Replace `Require host 10.0.0.0/8` with `Require all granted`
+. Change the user for the Apache server.
+  * (Debian and Ubuntu): As the *root* Linux account, edit
+    `/etc/apache2/envvars`.  Change `export APACHE_RUN_USER=www-data` to 
+    `export APACHE_RUN_USER=opensrf`.
+. As the *root* Linux account, configure Apache with KeepAlive settings
+  appropriate for Evergreen. Higher values can improve the performance of a
+  single client by allowing multiple requests to be sent over the same TCP
+  connection, but increase the risk of using up all available Apache child
+  processes and memory.
+  * (Debian and Ubuntu): Edit `/etc/apache2/apache2.conf`.
+    a. Change `KeepAliveTimeout` to `1`.
+    b. Change `MaxKeepAliveRequests` to `100`.
+. As the *root* Linux account, configure the prefork module to start and keep
+  enough Apache servers available to provide quick responses to clients without
+  running out of memory. The following settings are a good starting point for a
+  site that exposes the default Evergreen catalogue to the web:
++
+.Debian Wheezy (`/etc/apache2/apache2.conf`)
+[source,bash]
+------------------------------------------------------------------------------
+<IfModule mpm_prefork_module>
+   StartServers         15
+   MinSpareServers       5
+   MaxSpareServers      15
+   MaxClients           75
+   MaxRequestsPerChild 500
+</IfModule>
+------------------------------------------------------------------------------
++
+.Ubuntu Trusty/Xenial, Debian Jessie/Stretch (`/etc/apache2/mods-available/mpm_prefork.conf`)
+[source,bash]
+------------------------------------------------------------------------------
+<IfModule mpm_prefork_module>
+   StartServers            15
+   MinSpareServers          5
+   MaxSpareServers         15
+   MaxRequestWorkers       75
+   MaxConnectionsPerChild 500
+</IfModule>
+------------------------------------------------------------------------------
++
+. (Ubuntu Trusty/Xenial, Debian Jessie/Stretch) As the *root* user,
+    enable the mpm_prefork module:
++
+[source,bash]
+------------------------------------------------------------------------------
+a2dismod mpm_event
+a2enmod mpm_prefork
+------------------------------------------------------------------------------
++
+. (Debian Wheezy): As the *root* Linux account, enable the Evergreen site:
++
+[source,bash]
+------------------------------------------------------------------------------
+a2dissite default  # OPTIONAL: disable the default site (the "It Works" page)
+a2ensite eg.conf
+------------------------------------------------------------------------------
++
+(Ubuntu Trusty/Xenial, Debian Jessie/Stretch):
++
+[source,bash]
+------------------------------------------------------------------------------
+a2dissite 000-default  # OPTIONAL: disable the default site (the "It Works" page)
+a2ensite eg.conf
+------------------------------------------------------------------------------
++
+. (Debian and Ubuntu): As the *root* Linux account, enable Apache to write
+   to the lock directory; this is currently necessary because Apache
+   is running as the `opensrf` user:
++
+[source,bash]
+------------------------------------------------------------------------------
+chown opensrf /var/lock/apache2
+------------------------------------------------------------------------------
+
+Learn more about additional Apache options in the following sections:
+
+  * <<_apache_rewrite_tricks,Apache Rewrite Tricks>>
+  * <<_apache_access_handler_perl_module,Apache Access Handler Perl Module>>
+
+Configure OpenSRF for the Evergreen application
+-----------------------------------------------
+There are a number of example OpenSRF configuration files in `/openils/conf/`
+that you can use as a template for your Evergreen installation. Issue the
+following commands as the *opensrf* Linux account:
+
+[source, bash]
+------------------------------------------------------------------------------
+cp -b /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
+cp -b /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
+------------------------------------------------------------------------------
+
+When you installed OpenSRF, you created four Jabber users on two
+separate domains and edited the `opensrf_core.xml` file accordingly. Please
+refer back to the OpenSRF README and, as the *opensrf* Linux account, edit the
+Evergreen version of the `opensrf_core.xml` file using the same Jabber users
+and domains as you used while installing and testing OpenSRF.
+
+[NOTE]
+The `-b` flag tells the `cp` command to create a backup version of the
+destination file. The backup version of the destination file has a tilde (`~`)
+appended to the file name, so if you have forgotten the Jabber users and
+domains, you can retrieve the settings from the backup version of the files.
+
+`eg_db_config`, described in <<_creating_the_evergreen_database,Creating the Evergreen
+database>>, sets the database connection information in `opensrf.xml` for you.
+
+Configure action triggers for the Evergreen application
+-------------------------------------------------------
+_Action Triggers_ provide hooks for the system to perform actions when a given
+event occurs; for example, to generate reminder or overdue notices, the
+`checkout.due` hook is processed and events are triggered for potential actions
+if there is no checkin time.
+
+To enable the default set of hooks, issue the following command as the
+*opensrf* Linux account:
+
+[source, bash]
+------------------------------------------------------------------------------
+cp -b /openils/conf/action_trigger_filters.json.example /openils/conf/action_trigger_filters.json
+------------------------------------------------------------------------------
+
+For more information about configuring and running action triggers, see
+<<_processing_action_triggers,Notifications / Action Triggers>>.
+
+Creating the Evergreen database
+-------------------------------
+
+Setting up the PostgreSQL server
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+For production use, most libraries install the PostgreSQL database server on a
+dedicated machine. Therefore, by default, the `Makefile.install` prerequisite
+installer does *not* install the PostgreSQL 9 database server that is required
+by every Evergreen system. You can install the packages required by Debian or
+Ubuntu on the machine of your choice using the following commands as the
+*root* Linux account:
+
+.(Debian / Ubuntu) Installing PostgreSQL server packages
+
+Each OS build target provides the postgres server installation packages
+required for each operating system.  To install Postgres server packages, 
+use the make target 'postgres-server-<OSTYPE>'.  Choose the most appropriate 
+command below based on your operating system.
+
+[source, bash]
+------------------------------------------------------------------------------
+make -f Open-ILS/src/extras/Makefile.install postgres-server-debian-stretch
+make -f Open-ILS/src/extras/Makefile.install postgres-server-debian-jessie
+make -f Open-ILS/src/extras/Makefile.install postgres-server-debian-wheezy
+make -f Open-ILS/src/extras/Makefile.install postgres-server-ubuntu-trusty
+make -f Open-ILS/src/extras/Makefile.install postgres-server-ubuntu-xenial
+------------------------------------------------------------------------------
+
+For a standalone PostgreSQL server, install the following Perl modules for your
+distribution as the *root* Linux account:
+
+.(Debian and Ubuntu) 
+No extra modules required for these distributions.
+
+You need to create a PostgreSQL superuser to create and access the database.
+Issue the following command as the *postgres* Linux account to create a new
+PostgreSQL superuser named `evergreen`. When prompted, enter the new user's
+password:
+
+[source, bash]
+------------------------------------------------------------------------------
+createuser -s -P evergreen
+------------------------------------------------------------------------------
+
+.Enabling connections to the PostgreSQL database
+
+Your PostgreSQL database may be configured by default to prevent connections,
+for example, it might reject attempts to connect via TCP/IP or from other
+servers. To enable TCP/IP connections from localhost, check your `pg_hba.conf`
+file, found in the `/etc/postgresql/` directory on Debian and Ubuntu.
+A simple way to enable TCP/IP
+connections from localhost to all databases with password authentication, which
+would be suitable for a test install of Evergreen on a single server, is to
+ensure the file contains the following entries _before_ any "host ... ident"
+entries:
+
+------------------------------------------------------------------------------
+host    all             all             ::1/128                 md5
+host    all             all             127.0.0.1/32            md5
+------------------------------------------------------------------------------
+
+When you change the `pg_hba.conf` file, you will need to reload PostgreSQL to
+make the changes take effect.  For more information on configuring connectivity
+to PostgreSQL, see
+http://www.postgresql.org/docs/devel/static/auth-pg-hba-conf.html
+
+Creating the Evergreen database and schema
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Once you have created the *evergreen* PostgreSQL account, you also need to
+create the database and schema, and configure your configuration files to point
+at the database server. Issue the following command as the *root* Linux account
+from inside the Evergreen source directory, replacing <user>, <password>,
+<hostname>, <port>, and <dbname> with the appropriate values for your
+PostgreSQL database (where <user> and <password> are for the *evergreen*
+PostgreSQL account you just created), and replace <admin-user> and <admin-pass>
+with the values you want for the *egadmin* Evergreen administrator account:
+
+[source, bash]
+------------------------------------------------------------------------------
+perl Open-ILS/src/support-scripts/eg_db_config --update-config \
+       --service all --create-database --create-schema --create-offline \
+       --user <user> --password <password> --hostname <hostname> --port <port> \
+       --database <dbname> --admin-user <admin-user> --admin-pass <admin-pass>
+------------------------------------------------------------------------------
+
+This creates the database and schema and configures all of the services in
+your `/openils/conf/opensrf.xml` configuration file to point to that database.
+It also creates the configuration files required by the Evergreen `cgi-bin`
+administration scripts, and sets the user name and password for the *egadmin*
+Evergreen administrator account to your requested values.
+
+You can get a complete set of options for `eg_db_config` by passing the
+`--help` parameter.
+
+Loading sample data
+~~~~~~~~~~~~~~~~~~~
+If you add the `--load-all-sample` parameter to the `eg_db_config` command,
+a set of authority and bibliographic records, call numbers, copies, staff
+and regular users, and transactions will be loaded into your target
+database. This sample dataset is commonly referred to as the _concerto_
+sample data, and can be useful for testing out Evergreen functionality and
+for creating problem reports that developers can easily recreate with their
+own copy of the _concerto_ sample data.
+
+Creating the database on a remote server
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+In a production instance of Evergreen, your PostgreSQL server should be
+installed on a dedicated server.
+
+PostgreSQL 9.4 and later
+^^^^^^^^^^^^^^^^^^^^^^^^
+To create the database instance on a remote database server running PostgreSQL
+9.4 or later, simply use the `--create-database` flag on `eg_db_config`.
+
+Starting Evergreen
+------------------
+1. As the *root* Linux account, start the `memcached` and `ejabberd` services
+(if they aren't already running):
++
+[source, bash]
+------------------------------------------------------------------------------
+/etc/init.d/ejabberd start
+/etc/init.d/memcached start
+------------------------------------------------------------------------------
++
+2. As the *opensrf* Linux account, start Evergreen. The `-l` flag in the
+following command is only necessary if you want to force Evergreen to treat the
+hostname as `localhost`; if you configured `opensrf.xml` using the real
+hostname of your machine as returned by `perl -ENet::Domain 'print
+Net::Domain::hostfqdn() . "\n";'`, you should not use the `-l` flag.
++
+[source, bash]
+------------------------------------------------------------------------------
+osrf_control -l --start-all
+------------------------------------------------------------------------------
++
+  ** If you receive the error message `bash: osrf_control: command not found`,
+     then your environment variable `PATH` does not include the `/openils/bin`
+     directory; this should have been set in the *opensrf* Linux account's
+     `.bashrc` configuration file. To manually set the `PATH` variable, edit the
+     configuration file `~/.bashrc` as the *opensrf* Linux account and add the
+     following line:
++
+[source, bash]
+------------------------------------------------------------------------------
+export PATH=$PATH:/openils/bin
+------------------------------------------------------------------------------
++
+3. As the *opensrf* Linux account, generate the Web files needed by the staff
+   client and catalogue and update the organization unit proximity (you need to do
+   this the first time you start Evergreen, and after that each time you change the library org unit configuration.
+):
++
+[source, bash]
+------------------------------------------------------------------------------
+autogen.sh
+------------------------------------------------------------------------------
++
+4. As the *root* Linux account, restart the Apache Web server:
++
+[source, bash]
+------------------------------------------------------------------------------
+/etc/init.d/apache2 restart
+------------------------------------------------------------------------------
++
+If the Apache Web server was running when you started the OpenSRF services, you
+might not be able to successfully log in to the OPAC or staff client until the
+Apache Web server is restarted.
+
+Testing connections to Evergreen
+--------------------------------
+
+Once you have installed and started Evergreen, test your connection to
+Evergreen via `srfsh`. As the *opensrf* Linux account, issue the following
+commands to start `srfsh` and try to log onto the Evergreen server using the
+*egadmin* Evergreen administrator user name and password that you set using the
+`eg_db_config` command:
+
+[source, bash]
+------------------------------------------------------------------------------
+/openils/bin/srfsh
+srfsh% login <admin-user> <admin-pass>
+------------------------------------------------------------------------------
+
+You should see a result like:
+
+    Received Data: "250bf1518c7527a03249858687714376"
+    ------------------------------------
+    Request Completed Successfully
+    Request Time in seconds: 0.045286
+    ------------------------------------
+
+    Received Data: {
+       "ilsevent":0,
+       "textcode":"SUCCESS",
+       "desc":" ",
+       "pid":21616,
+       "stacktrace":"oils_auth.c:304",
+       "payload":{
+          "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
+          "authtime":420
+       }
+
+    }
+
+    ------------------------------------
+    Request Completed Successfully
+    Request Time in seconds: 1.336568
+    ------------------------------------
+[[install-troubleshooting-1]]
+If this does not work, it's time to do some troubleshooting.
+
+  * As the *opensrf* Linux account, run the `settings-tester.pl` script to see
+    if it finds any system configuration problems. The script is found at
+    `Open-ILS/src/support-scripts/settings-tester.pl` in the Evergreen source
+    tree.
+  * Follow the steps in the http://evergreen-ils.org/dokuwiki/doku.php?id=troubleshooting:checking_for_errors[troubleshooting guide].
+  * If you have faithfully followed the entire set of installation steps
+    listed here, you are probably extremely close to a working system.
+    Gather your configuration files and log files and contact the
+    http://evergreen-ils.org/communicate/mailing-lists/[Evergreen development 
+mailing list] for assistance before making any drastic changes to your system
+    configuration.
+
+Getting help
+------------
+
+Need help installing or using Evergreen? Join the mailing lists at
+http://evergreen-ils.org/communicate/mailing-lists/ or contact us on the Freenode
+IRC network on the #evergreen channel.
+
+License
+-------
+This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
+Unported License. To view a copy of this license, visit
+http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative
+Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
diff --git a/configure.ac b/configure.ac
index dacb5a3..a7eb26c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,8 +20,8 @@
 
 export PATH=${PATH}:/usr/sbin
 AC_PREREQ(2.61)
-AC_INIT(Open-ILS, trunk, open-ils-dev at list.georgialibraries.org)
-AM_INIT_AUTOMAKE([OpenILS], [trunk])
+AC_INIT(Open-ILS, 3.1.0, open-ils-dev at list.georgialibraries.org)
+AM_INIT_AUTOMAKE([OpenILS], [3.1.0])
 AC_REVISION($Revision: 0.1 $)
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_SUBDIRS([Open-ILS/xul/staff_client/external/libmar])
diff --git a/docs/installation/server_upgrade.adoc b/docs/installation/server_upgrade.adoc
index 3f1c7ea..ea22f29 100644
--- a/docs/installation/server_upgrade.adoc
+++ b/docs/installation/server_upgrade.adoc
@@ -7,7 +7,7 @@ Software Prerequisites
 ~~~~~~~~~~~~~~~~~~~~~~
 
   * **PostgreSQL**: The minimum supported version is 9.4.
-  * **Linux**: Evergreen 2.12.0 has been tested on Debian Stretch (9.0),
+  * **Linux**: Evergreen 3.1.0 has been tested on Debian Stretch (9.0),
     Debian Jessie (8.0), Debian Wheezy (7.0), Ubuntu Xenial Xerus (16.04),
     and Ubuntu Trusty Tahr (14.04).
     If you are running an older version of these distributions, you may want
@@ -43,12 +43,12 @@ osrf_control --localhost --stop-all
  .. Back up the /openils directory.
 . Upgrade OpenSRF. Download and install the latest version of OpenSRF from
 the https://evergreen-ils.org/opensrf-downloads/[OpenSRF download page].
-. As the *opensrf* user, download and extract Evergreen 2.12.0:
+. As the *opensrf* user, download and extract Evergreen 3.1.0:
 +
 [source, bash]
 -----------------------------------------------
-wget https://evergreen-ils.org/downloads/Evergreen-ILS-2.12.0.tar.gz
-tar xzf Evergreen-ILS-2.12.0.tar.gz
+wget https://evergreen-ils.org/downloads/Evergreen-ILS-3.1.rc.tar.gz
+tar xzf Evergreen-ILS-3.1.rc.tar.gz
 -----------------------------------------------
 +
 [NOTE]
@@ -58,7 +58,7 @@ For the latest edition of Evergreen, check the https://evergreen-ils.org/egdownl
 +
 [source, bash]
 ---------------------------------------------
-cd /home/opensrf/Evergreen-ILS-2.12.0
+cd /home/opensrf/Evergreen-ILS-3.1.rc
 ---------------------------------------------
 +
 On the next command, replace `[distribution]` with one of these values for your
@@ -82,7 +82,7 @@ make -f Open-ILS/src/extras/Makefile.install [distribution]
 +
 [source, bash]
 ------------------------------------------------------------
-cd /home/opensrf/Evergreen-ILS-2.12.0
+cd /home/opensrf/Evergreen-ILS-3.1.rc
 PATH=/openils/bin:$PATH ./configure --prefix=/openils --sysconfdir=/openils/conf
 make
 ------------------------------------------------------------
@@ -93,8 +93,8 @@ These instructions assume that you have also installed OpenSRF under /openils/.
 +
 [source, bash]
 ------------------------------------------------------------
-cd /home/opensrf/Evergreen-ILS-2.12.0
-make STAFF_CLIENT_STAMP_ID=rel_2_12_rc install
+cd /home/opensrf/Evergreen-ILS-3.1.rc
+make STAFF_CLIENT_STAMP_ID=rel_3_1_0 install
 ------------------------------------------------------------
 +
 . As the *root* user, change all files to be owned by the opensrf user and group:
@@ -110,7 +110,7 @@ chown -R opensrf:opensrf /openils
 -----------------------------------------------------------
 cd /openils/var/web/xul/
 rm server
-ln -sf rel_2_12_rc/server server
+ln -sf rel_3_1_0/server server
 ----------------------------------------------------------
 +
 . As the *opensrf* user, update opensrf_core.xml and opensrf.xml by copying the
@@ -130,7 +130,7 @@ Copying these configuration files will remove any customizations you have made t
 +
 [source, bash]
 -------------------------------------------------------------------------
-cd /home/opensrf/Evergreen-ILS-2.12.0
+cd /home/opensrf/Evergreen-ILS-3.1.rc
 perl Open-ILS/src/support-scripts/eg_db_config --update-config --service all \
 --create-offline --database evergreen --host localhost --user evergreen --password evergreen
 -------------------------------------------------------------------------
@@ -154,21 +154,21 @@ The diff command can be used to show the differences between the distribution ve
 +
 [source, bash]
 ----------------------------------------------------------
-cp /home/opensrf/Evergreen-ILS-2.12.0/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup
+cp /home/opensrf/Evergreen-ILS-3.1.rc/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup
 ----------------------------------------------------------
 +
 .. Update /etc/apache2/eg_vhost.conf by copying the example from Open-ILS/examples/apache/eg_vhost.conf.
 +
 [source, bash]
 ----------------------------------------------------------
-cp /home/opensrf/Evergreen-ILS-2.12.0/Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/eg_vhost.conf
+cp /home/opensrf/Evergreen-ILS-3.1.rc/Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/eg_vhost.conf
 ----------------------------------------------------------
 +
 .. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/examples/apache/eg.conf.
 +
 [source, bash]
 ----------------------------------------------------------
-cp /home/opensrf/Evergreen-ILS-2.12.0/Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/eg.conf
+cp /home/opensrf/Evergreen-ILS-3.1.rc/Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/eg.conf
 ----------------------------------------------------------
 
 Upgrade the Evergreen database schema
@@ -191,14 +191,11 @@ anything goes wrong during the upgrade.
 =============
 Evergreen provides incremental upgrade scripts that allow you to upgrade
 from one minor version to the next until you have the current version of
-the schema. For example, if you want to upgrade from 2.5.1 to 2.12.0, you
-would run the following upgrade scripts:
+the schema. In addition, upgrade scripts are provided for incrementing 
+major versions, but only from the minor revision available at the time
+of each major release. For example, if you want to upgrade from 2.7.0 to
+2.11.0, you would run the following upgrade scripts:
 
-- 2.5.1-2.5.2-upgrade-db.sql
-- 2.5.2-2.5.3-upgrade-db.sql
-- 2.5.3-2.6.0-upgrade-db.sql (this is a major version upgrade)
-- 2.6.2-2.6.3-upgrade-db.sql
-- 2.6.3-2.7.0-upgrade-db.sql (this is a major version upgrade)
 - 2.7.0-2.7.1-upgrade-db.sql
 - 2.7.1-2.7.2-upgrade-db.sql
 - 2.7.2-2.7.3-upgrade-db.sql
@@ -212,7 +209,7 @@ would run the following upgrade scripts:
 - 2.9.0-2.9.1-upgrade-db.sql
 - 2.9.1-2.9.2-upgrade-db.sql
 - 2.9.2-2.9.3-upgrade-db.sql
-- 2.9.3-2.10.0-upgrade-db.sql
+- 2.9.3-2.10.0-upgrade-db.sql (this is a major version upgrade)
 - 2.10.0-2.10.1-upgrade-db.sql
 - 2.10.1-2.10.2-upgrade-db.sql
 - 2.10.2-2.10.3-upgrade-db.sql
@@ -221,38 +218,11 @@ would run the following upgrade scripts:
 - 2.10.5-2.10.6-upgrade-db.sql
 - 2.10.6-2.10.7-upgrade-db.sql
 - 2.10.7-2.11.0-upgrade-db.sql (this is a major version upgrade)
-- 2.11.0-2.11.1-upgrade-db.sql
-- 2.11.1-2.11.2-upgrade-db.sql
-- 2.11.2-2.11.3-upgrade-db.sql
-- 2.11.3-2.12.0-upgrade-db.sql (this is a major version upgrade)
 
-Note that you do *not* want to run additional 2.5 scripts to upgrade to the
-newest version of 2.5, since currently there is no automated way to upgrade
-from 2.5.4+ to 2.6. Only upgrade as far as necessary to reach the major
-version upgrade script (in this example, as far as 2.5.3).
-
-To upgrade across multiple major versions (e.g. from 2.3.0 to 2.12.0), use
-the same logic to utilize the provided major version upgrade scripts. For
-example:
-
-- 2.3-2.4.0-upgrade-db.sql
-- 2.3-2.4-supplemental.sh
-- (run all incremental scripts from 2.4.0 to 2.4.3)
-- 2.4.3-2.5.0-upgrade-db.sql
-- (run all incremental scripts from 2.5.0 to 2.5.3)
-- 2.5.3-2.6.0-upgrade-db.sql
-- (run all incremental scripts from 2.6.0 to 2.6.3)
-- 2.6.3-2.7.0-upgrade-db.sql
-- (run all incremental scripts from 2.7.0 to 2.7.4)
-- 2.7.4-2.8.0-upgrade-db.sql
-- (run all incremental scripts from 2.8.0 to 2.8.4)
-- 2.8.4-2.9.0-upgrade-db.sql
-- (run all incremental scripts from 2.9.0 to 2.9.3)
-- 2.9.3-2.10.0-upgrade-db.sql
-- (run all incremental scripts from 2.10.0 to 2.10.7)
-- 2.10.7-2.11.0-upgrade-db.sql
-- (run all incremental scripts from 2.11.0 to 2.11.3)
-- 2.11.3-2.12.0-upgrade-db.sql
+Note that you do *not* want to run additional 2.7 scripts to upgrade to the
+newest version of 2.7, since currently there is no automated way to upgrade
+from 2.7.5+ to 2.8. Only upgrade as far as necessary to reach the major
+version upgrade script (in this example, as far as 2.7.4).
 
 =============
 
@@ -267,8 +237,8 @@ as a user with the ability to connect to the database server.
 
 [source, bash]
 ----------------------------------------------------------
-cd /home/opensrf/Evergreen-ILS-2.12.0/Open-ILS/src/sql/Pg
-psql -U evergreen -h localhost -f version-upgrade/2.11.3-2.12.0-upgrade-db.sql evergreen
+cd /home/opensrf/Evergreen-ILS-3.1.rc/Open-ILS/src/sql/Pg
+psql -U evergreen -h localhost -f version-upgrade/3.0.5-3.1.0-upgrade-db.sql evergreen
 ----------------------------------------------------------
 
 [TIP]

commit 44766aa54d66b9b2c402b83ee58f42f11b1bb71d
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Mon Mar 26 09:38:52 2018 -0400

    Bumping Perl version string
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS.pm b/Open-ILS/src/perlmods/lib/OpenILS.pm
index d7235ce..155e5a1 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS.pm
@@ -6,6 +6,6 @@ OpenILS - Client and server support for the Evergreen open source library system
 
 =cut
 
-our $VERSION = '2.4';
+our $VERSION = '3.0100';
 
 1;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list