fix broken prefix and namespace URI for the mods32 transform
authorgmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 23 Nov 2010 14:11:51 +0000 (14:11 +0000)
committergmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 23 Nov 2010 14:11:51 +0000 (14:11 +0000)
This breakage can be found in databases that started out at
version 1.2 or earlier; matters since in-DB ingest is stricter
with its XPATH processing.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

git-svn-id: svn://svn.open-ils.org/ILS/trunk@18835 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql

index 4b7eef6..7d3f43c 100644 (file)
@@ -16340,6 +16340,21 @@ this stylesheet will transform it to the equivalent of
     
 </xsl:stylesheet>$$);
 
+-- fix broken prefix and namespace URI for the
+-- mods32 transform found in some databases
+-- that started out at version 1.2 or earlier
+UPDATE config.xml_transform
+SET namespace_uri = 'http://www.loc.gov/mods/v3'
+WHERE name = 'mods32'
+AND namespace_uri = 'http://www.loc.gov/mods/'
+AND xslt LIKE '%xmlns="http://www.loc.gov/mods/v3"%';
+
+UPDATE config.xml_transform
+SET prefix = 'mods32'
+WHERE name = 'mods32'
+AND prefix = 'mods'
+AND EXISTS (SELECT xpath FROM config.metabib_field WHERE xpath ~ 'mods32:');
+
 -- Splitting the ingest trigger up into little bits
 
 CREATE TEMPORARY TABLE eg_0301_check_if_has_contents (