Skip to content

Instantly share code, notes, and snippets.

@raffazizzi
Created August 3, 2012 16:22
Show Gist options
  • Save raffazizzi/3249171 to your computer and use it in GitHub Desktop.
Save raffazizzi/3249171 to your computer and use it in GitHub Desktop.
METS for CHARM

The AHRC Research Centre for the History and Analysis of Recorded Music (CHARM) has been active between 2004 and 2010. Amongst other activities, they digitized a large collection of out-of-copyright 78rpm records.

In 2009 I have been asked to prepare a METS model to record descriptive metadata about each record (or multiple records, in case of sets) and, most importantly, administrative metadata about the conversion process (the tools used and some key settings). Given the nature of the project, administrative metadata was structured using The Library of Congress' Audio MD for describing the source object and DigiProv MD for the digitization process.

The data was given to me in a very large MS Excel table; it was produced way before we could set up a more efficient way to get the digitizers to enter data. I wrote the XSLT included here to generate the METS from a Open Office version of the file. There is also an example output METS file.

<?xml version="1.0" encoding="UTF-8"?>
<mets:mets xmlns:charm="charm.cch.kcl.ac.uk" xmlns:amd="http://www.loc.gov/AMD/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:pmd="http://www.loc.gov/PMD/"
xmlns:mets="http://www.loc.gov/METS/"
xmlns="http://www.loc.gov/METS/"
xsi:schemaLocation="http://www.loc.gov/METS/ http://curlew.cch.kcl.ac.uk/charm-kcl/apps/schemas/mets.xsd"
ID="METS_2-032019">
<mets:metsHdr CREATEDATE="2009-01-30T17:07:29" RECORDSTATUS="Complete">
<mets:agent ROLE="CREATOR" TYPE="ORGANIZATION">
<mets:name>King's College London</mets:name>
</mets:agent>
</mets:metsHdr>
<mets:dmdSec ID="Disc_01_METS_2-032019">
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" LABEL="CHARM">
<mets:xmlData>
<charm:discDesc>
<charm:label>HMV</charm:label>
<charm:series/>
<charm:catNumber>2-032019</charm:catNumber>
</charm:discDesc>
</mets:xmlData>
</mets:mdWrap>
</mets:dmdSec>
<mets:dmdSec ID="Disc_01_Side01_METS_2-032019">
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" LABEL="CHARM">
<mets:xmlData>
<charm:sideDesc>
<charm:matrixNr>HO_1036ac</charm:matrixNr>
<charm:singleSideNr>2-032019</charm:singleSideNr>
<charm:dateRecording>1915/09/10</charm:dateRecording>
<charm:composer>Massenet</charm:composer>
<charm:artist>Samuel, William</charm:artist>
<charm:artist type="ensemble">orchestra</charm:artist>
<charm:conductor>Bath, Hubert</charm:conductor>
<charm:title>Vision Fugitive - "Herodiade"</charm:title>
<charm:instrument>baritone</charm:instrument>
<charm:speed>78</charm:speed>
<charm:notes>Baritone with orchestra. Single-sided disc subsequently coupled on
D196</charm:notes>
</charm:sideDesc>
</mets:xmlData>
</mets:mdWrap>
</mets:dmdSec>
<mets:amdSec>
<mets:techMD ID="Disc_01_Tech01_METS_2-032019">
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" LABEL="AMD Audio MetaData">
<mets:xmlData>
<amd:AUDIOMD ANALOGDIGITALFLAG="FileDigital" ID="Disc_01_Side_01_master01_METS_2-032019">
<amd:file_data>
<charm:fileDesc>
<charm:file_name>2-032019_HO_1036ac</charm:file_name>
<charm:mimetype>audio/wav</charm:mimetype>
<charm:file_size>20349418</charm:file_size>
</charm:fileDesc>
<amd:audio_data_encoding>PCM</amd:audio_data_encoding>
<amd:bits_per_sample>24</amd:bits_per_sample>
<amd:data_rate_mode>Fixed</amd:data_rate_mode>
<amd:sampling_frequency>44.1</amd:sampling_frequency>
<amd:use>Master</amd:use>
</amd:file_data>
<amd:audio_info>
<amd:duration>03:50</amd:duration>
<amd:num_channels>mono</amd:num_channels>
</amd:audio_info>
</amd:AUDIOMD>
<amd:AUDIOMD ANALOGDIGITALFLAG="FileDigital" ID="Disc_01_Side_01_service01_METS_2-032019">
<amd:file_data>
<charm:fileDesc>
<charm:file_name>
2-032019_HO_1036ac
</charm:file_name>
<charm:mimetype>audio/x-flac</charm:mimetype>
<charm:file_size>12363043</charm:file_size>
</charm:fileDesc>
<amd:audio_data_encoding>PCM</amd:audio_data_encoding>
<amd:bits_per_sample>16</amd:bits_per_sample>
<amd:data_rate_mode>Fixed</amd:data_rate_mode>
<amd:sampling_frequency>44.1</amd:sampling_frequency>
<amd:use>Service</amd:use>
</amd:file_data>
<amd:audio_info>
<amd:duration>03:50</amd:duration>
<amd:num_channels>mono</amd:num_channels>
</amd:audio_info>
</amd:AUDIOMD>
</mets:xmlData>
</mets:mdWrap>
</mets:techMD>
<mets:rightsMD ID="Right_Disc_01_METS_2-032019"/>
<mets:sourceMD ID="Source_Disc_01_METS_2-032019">
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" LABEL="AMD Audio MetaData">
<mets:xmlData>
<amd:AUDIOSRC ANALOGDIGITALFLAG="Analog">
<amd:physical_data>
<amd:dimensions DIAMETER="12"/>
<amd:groove>lateral</amd:groove>
<amd:phys_format>78rpm</amd:phys_format>
</amd:physical_data>
</amd:AUDIOSRC>
</mets:xmlData>
</mets:mdWrap>
</mets:sourceMD>
<mets:digiprovMD ID="Disc_01_process01_METS_2-032019">
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" LABEL="DigiProvMD">
<mets:xmlData>
<pmd:DIGIPROVMD>
<pmd:process_creator>Andrew Hallifax</pmd:process_creator>
<pmd:process_datetime>04/11/09T00:00:00</pmd:process_datetime>
<pmd:process_organization>Centre for the History and Analysis of Recorded
Music</pmd:process_organization>
<pmd:task>
<pmd:task_description>Hardware and Software settings</pmd:task_description>
<pmd:tool>
<pmd:tool_label>Stylus information</pmd:tool_label>
<pmd:settings>
<pmd:settings_label>Stylus Size</pmd:settings_label>
<pmd:settings_value>3.2</pmd:settings_value>
</pmd:settings>
<pmd:settings>
<pmd:settings_label>Stylus Weight</pmd:settings_label>
<pmd:settings_value>3</pmd:settings_value>
</pmd:settings>
</pmd:tool>
<pmd:tool>
<pmd:tool_label>Front End EQ</pmd:tool_label>
<pmd:settings>
<pmd:settings_label>bass</pmd:settings_label>
<pmd:settings_value>flat</pmd:settings_value>
</pmd:settings>
<pmd:settings>
<pmd:settings_label>mid</pmd:settings_label>
<pmd:settings_value/>
</pmd:settings>
<pmd:settings>
<pmd:settings_label>top</pmd:settings_label>
<pmd:settings_value/>
</pmd:settings>
<pmd:settings>
<pmd:settings_label>filter</pmd:settings_label>
<pmd:settings_value>8</pmd:settings_value>
</pmd:settings>
</pmd:tool>
<pmd:tool>
<pmd:tool_label>Digital EQ</pmd:tool_label>
<pmd:settings>
<pmd:settings_label>General settings</pmd:settings_label>
<pmd:settings_value>FFT roll off @ 48Hz</pmd:settings_value>
</pmd:settings>
</pmd:tool>
</pmd:task>
</pmd:DIGIPROVMD>
</mets:xmlData>
</mets:mdWrap>
</mets:digiprovMD>
</mets:amdSec>
<mets:fileSec>
<mets:fileGrp USE="ARCHIVE">
<mets:file ID="METS_2-032019_01" MIMETYPE="audio/x-flac">
<mets:FLocat LOCTYPE="URL" xlink:type="simple" xlink:href="2-032019_HO_1036ac.flac"/>
</mets:file>
</mets:fileGrp>
</mets:fileSec>
<mets:structMap TYPE="PHYSICAL">
<mets:div ID="disc" TYPE="PHYSICAL">
<mets:div ID="side1" TYPE="PHYSICAL" ORDER="1"/>
</mets:div>
</mets:structMap>
<mets:structMap TYPE="LOGICAL">
<mets:div ID="disc_log" TYPE="LOGICAL"
DMDID="Right_Disc_01_METS_2-032019 Source_Disc_01_METS_2-032019">
<mets:div ID="side1_log" TYPE="LOGICAL" ORDER="1"
DMDID="Disc_01_Side01_METS_2-032019 Disc_01_Tech01_METS_2-032019 Disc_01_process01_METS_2-032019"/>
</mets:div>
</mets:structMap>
</mets:mets>
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Project: CHARM
- Author: Raffaele Viglianti
- Started on: 05-03-2009
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" exclude-result-prefixes="#all">
<xsl:output encoding="UTF-8" method="xml" indent="yes"/>
<xsl:variable name="METSid">
<xsl:text>METS_</xsl:text>
<xsl:if test="//table:table-row[1]/table:table-cell[5][text:p]">
<xsl:value-of
select="translate(normalize-space(//table:table-row[1]/table:table-cell[5]/text:p), ' ()', '')"/>
<xsl:text>_</xsl:text>
</xsl:if>
<xsl:value-of
select="translate(normalize-space(//table:table-row[1]/table:table-cell[6]/text:p), ' ()','')"
/>
</xsl:variable>
<xsl:template match="/">
<xsl:result-document href="../final/{$METSid}.xml">
<mets:mets xmlns="http://www.loc.gov/METS/" xmlns:charm="charm.cch.kcl.ac.uk"
xmlns:amd="http://www.loc.gov/AMD/" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:pmd="http://www.loc.gov/PMD/" xmlns:mets="http://www.loc.gov/METS/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.loc.gov/METS/ http://curlew.cch.kcl.ac.uk/charm-kcl/apps/schemas/mets.xsd">
<xsl:attribute name="ID">
<xsl:value-of select="$METSid"/>
</xsl:attribute>
<!-- METS File header -->
<mets:metsHdr CREATEDATE="2009-01-30T17:07:29" RECORDSTATUS="Complete">
<mets:agent ROLE="CREATOR" TYPE="ORGANIZATION">
<mets:name>Automatically converted from MS Excel table</mets:name>
</mets:agent>
</mets:metsHdr>
<!-- Set -->
<mets:dmdSec ID="Set_{$METSid}">
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" LABEL="CHARM">
<mets:xmlData>
<charm:setDesc>
<charm:label>
<xsl:value-of
select="//table:table-row[1]/table:table-cell[4]/text:p"/>
</charm:label>
<charm:series>
<xsl:value-of
select="//table:table-row[1]/table:table-cell[5]/text:p"/>
</charm:series>
</charm:setDesc>
</mets:xmlData>
</mets:mdWrap>
</mets:dmdSec>
<xsl:for-each-group select="//table:table-row"
group-adjacent="table:table-cell[6]/text:p">
<xsl:message>
<xsl:value-of select="current-grouping-key()"/>
</xsl:message>
<xsl:variable name="discNum">
<xsl:choose>
<xsl:when test="position() &lt; 10">
<xsl:text>0</xsl:text>
<xsl:value-of select="position()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="position()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<mets:dmdSec ID="Disc_{$discNum}_{$METSid}">
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" LABEL="CHARM">
<mets:xmlData>
<charm:discDesc>
<charm:catNumber>
<xsl:value-of select="current-grouping-key()"/>
</charm:catNumber>
</charm:discDesc>
</mets:xmlData>
</mets:mdWrap>
</mets:dmdSec>
<xsl:for-each select="current-group()[self::table:table-row]">
<xsl:variable name="sideNum" select="position()"/>
<mets:dmdSec ID="Disc_{$discNum}_Side0{$sideNum}_{$METSid}">
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" LABEL="CHARM">
<mets:xmlData>
<charm:sideDesc>
<charm:matrixNr>
<xsl:value-of select="table:table-cell[8]/text:p"/>
</charm:matrixNr>
<xsl:if test="table:table-cell[9][text:p]">
<charm:singleSideNr>
<xsl:value-of select="table:table-cell[9]/text:p"/>
</charm:singleSideNr>
</xsl:if>
<xsl:if test="table:table-cell[10][text:p]">
<charm:dateRecording>
<xsl:value-of select="table:table-cell[10]/text:p"/>
</charm:dateRecording>
</xsl:if>
<charm:composer>
<xsl:value-of select="table:table-cell[11]/text:p"/>
</charm:composer>
<xsl:if test="table:table-cell[51][text:p]">
<charm:composer>
<xsl:value-of select="table:table-cell[51]/text:p"/>
</charm:composer>
</xsl:if>
<xsl:if test="table:table-cell[53][text:p]">
<charm:composer>
<xsl:value-of select="table:table-cell[53]/text:p"/>
</charm:composer>
</xsl:if>
<xsl:if test="table:table-cell[55][text:p]">
<charm:composer>
<xsl:value-of select="table:table-cell[55]/text:p"/>
</charm:composer>
</xsl:if>
<charm:artist>
<xsl:value-of select="table:table-cell[12]/text:p"/>
</charm:artist>
<xsl:if test="table:table-cell[41][text:p]">
<charm:artist type="accompanist">
<xsl:value-of select="table:table-cell[41]/text:p"/>
</charm:artist>
</xsl:if>
<xsl:if test="table:table-cell[43][text:p]">
<charm:artist>
<xsl:value-of select="table:table-cell[43]/text:p"/>
</charm:artist>
</xsl:if>
<xsl:if test="table:table-cell[45][text:p]">
<charm:artist>
<xsl:value-of select="table:table-cell[45]/text:p"/>
</charm:artist>
</xsl:if>
<xsl:if test="table:table-cell[46][text:p]">
<charm:artist>
<xsl:value-of select="table:table-cell[46]/text:p"/>
</charm:artist>
</xsl:if>
<xsl:if test="table:table-cell[47][text:p]">
<charm:artist>
<xsl:value-of select="table:table-cell[47]/text:p"/>
</charm:artist>
</xsl:if>
<xsl:if test="table:table-cell[48][text:p]">
<charm:artist>
<xsl:value-of select="table:table-cell[48]/text:p"/>
</charm:artist>
</xsl:if>
<xsl:if test="table:table-cell[49][text:p]">
<charm:artist>
<xsl:value-of select="table:table-cell[49]/text:p"/>
</charm:artist>
</xsl:if>
<xsl:if test="table:table-cell[50][text:p]">
<charm:artist type="ensemble">
<xsl:value-of select="table:table-cell[50]/text:p"/>
</charm:artist>
</xsl:if>
<xsl:if test="table:table-cell[13][text:p]">
<charm:conductor>
<xsl:value-of select="table:table-cell[13]/text:p"/>
</charm:conductor>
</xsl:if>
<xsl:if test="table:table-cell[35][text:p]">
<charm:arranger>
<xsl:value-of select="table:table-cell[35]/text:p"/>
</charm:arranger>
</xsl:if>
<xsl:if test="table:table-cell[36][text:p]">
<charm:arranger>
<xsl:value-of select="table:table-cell[36]/text:p"/>
</charm:arranger>
</xsl:if>
<xsl:if test="table:table-cell[37][text:p]">
<charm:writer>
<xsl:value-of select="table:table-cell[37]/text:p"/>
</charm:writer>
</xsl:if>
<xsl:if test="table:table-cell[38][text:p]">
<charm:writer>
<xsl:value-of select="table:table-cell[38]/text:p"/>
</charm:writer>
</xsl:if>
<xsl:if test="table:table-cell[39][text:p]">
<charm:writer>
<xsl:value-of select="table:table-cell[39]/text:p"/>
</charm:writer>
</xsl:if>
<charm:title>
<xsl:value-of select="table:table-cell[15]/text:p"/>
</charm:title>
<xsl:if test="table:table-cell[52][text:p]">
<charm:title>
<xsl:value-of select="table:table-cell[52]/text:p"/>
</charm:title>
</xsl:if>
<xsl:if test="table:table-cell[54][text:p]">
<charm:title>
<xsl:value-of select="table:table-cell[54]/text:p"/>
</charm:title>
</xsl:if>
<xsl:if test="table:table-cell[56][text:p]">
<charm:title>
<xsl:value-of select="table:table-cell[56]/text:p"/>
</charm:title>
</xsl:if>
<xsl:if test="table:table-cell[40][text:p]">
<charm:instrument>
<xsl:value-of select="table:table-cell[40]/text:p"/>
</charm:instrument>
</xsl:if>
<xsl:if test="table:table-cell[42][text:p]">
<charm:instrument>
<xsl:value-of select="table:table-cell[42]/text:p"/>
</charm:instrument>
</xsl:if>
<xsl:if test="table:table-cell[44][text:p]">
<charm:instrument>
<xsl:value-of select="table:table-cell[44]/text:p"/>
</charm:instrument>
</xsl:if>
<charm:speed>
<xsl:value-of select="table:table-cell[17]/text:p"/>
</charm:speed>
<xsl:if test="table:table-cell[16]/text:p">
<charm:notes>
<xsl:value-of select="table:table-cell[16]/text:p"/>
</charm:notes>
</xsl:if>
</charm:sideDesc>
</mets:xmlData>
</mets:mdWrap>
</mets:dmdSec>
</xsl:for-each>
</xsl:for-each-group>
<xsl:for-each-group select="//table:table-row"
group-adjacent="table:table-cell[6]/text:p">
<xsl:variable name="discNum">
<xsl:choose>
<xsl:when test="position() &lt; 10">
<xsl:text>0</xsl:text>
<xsl:value-of select="position()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="position()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<mets:amdSec>
<xsl:for-each select="current-group()[self::table:table-row]">
<xsl:variable name="sideNum" select="position()"/>
<mets:techMD ID="Disc_{$discNum}_Tech0{$sideNum}_{$METSid}">
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER"
LABEL="AMD Audio MetaData">
<mets:xmlData>
<amd:AUDIOMD ANALOGDIGITALFLAG="FileDigital"
ID="Disc_{$discNum}_Side_0{$sideNum}_master01_{$METSid}">
<amd:file_data>
<charm:fileDesc>
<charm:file_name>
<xsl:value-of select="table:table-cell[14]/text:p"
/>
</charm:file_name>
<charm:mimetype>audio/wav</charm:mimetype>
<charm:file_size>
<xsl:value-of select="table:table-cell[33]/text:p"
/>
</charm:file_size>
</charm:fileDesc>
<amd:audio_data_encoding>PCM</amd:audio_data_encoding>
<amd:bits_per_sample>24</amd:bits_per_sample>
<amd:data_rate_mode>Fixed</amd:data_rate_mode>
<amd:sampling_frequency>44.1</amd:sampling_frequency>
<amd:use>Master</amd:use>
</amd:file_data>
<amd:audio_info>
<amd:duration>
<xsl:value-of select="table:table-cell[34]/text:p"
/>
</amd:duration>
<amd:num_channels>mono</amd:num_channels>
</amd:audio_info>
</amd:AUDIOMD>
<amd:AUDIOMD ANALOGDIGITALFLAG="FileDigital"
ID="Disc_{$discNum}_Side_0{$sideNum}_service01_{$METSid}">
<amd:file_data>
<charm:fileDesc>
<charm:file_name>
<xsl:value-of select="table:table-cell[14]"/>
</charm:file_name>
<charm:mimetype>audio/x-flac</charm:mimetype>
<charm:file_size>
<xsl:value-of select="table:table-cell[32]/text:p"
/>
</charm:file_size>
</charm:fileDesc>
<amd:audio_data_encoding>PCM</amd:audio_data_encoding>
<amd:bits_per_sample>16</amd:bits_per_sample>
<amd:data_rate_mode>Fixed</amd:data_rate_mode>
<amd:sampling_frequency>44.1</amd:sampling_frequency>
<amd:use>Service</amd:use>
</amd:file_data>
<amd:audio_info>
<amd:duration>
<xsl:value-of select="table:table-cell[34]/text:p"
/>
</amd:duration>
<amd:num_channels>mono</amd:num_channels>
</amd:audio_info>
</amd:AUDIOMD>
</mets:xmlData>
</mets:mdWrap>
</mets:techMD>
</xsl:for-each>
<!-- Rights MetaData-->
<mets:rightsMD ID="Right_Disc_{$discNum}_{$METSid}"/>
<!-- Source MetaData -->
<mets:sourceMD ID="Source_Disc_{$discNum}_{$METSid}">
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER"
LABEL="AMD Audio MetaData">
<mets:xmlData>
<amd:AUDIOSRC ANALOGDIGITALFLAG="Analog">
<amd:physical_data>
<xsl:if
test="//table:table-row[1]/table:table-cell[7][text:p] or //table:table-row[1]/table:table-cell[7]/text:p = 'na'">
<amd:dimensions>
<xsl:attribute name="DIAMETER">
<xsl:value-of
select="//table:table-row[1]/table:table-cell[7]/text:p"
/>
</xsl:attribute>
</amd:dimensions>
</xsl:if>
<amd:groove>
<xsl:choose>
<xsl:when
test="contains(//table:table-row[1]/table:table-cell[24]/text:p, 'Vertical')"
> vertical </xsl:when>
<xsl:otherwise>lateral</xsl:otherwise>
</xsl:choose>
</amd:groove>
<amd:phys_format>78rpm</amd:phys_format>
<xsl:if test="table:table-cell[24]/text:p">
<charm:source_note>
<xsl:value-of select="table:table-cell[24]/text:p"
/>
</charm:source_note>
</xsl:if>
</amd:physical_data>
</amd:AUDIOSRC>
</mets:xmlData>
</mets:mdWrap>
</mets:sourceMD>
<xsl:for-each select="current-group()[self::table:table-row]">
<xsl:variable name="sideNum" select="position()"/>
<mets:digiprovMD ID="Disc_{$discNum}_process0{$sideNum}_{$METSid}">
<mets:mdWrap MIMETYPE="text/xml" MDTYPE="OTHER" LABEL="DigiProvMD">
<mets:xmlData>
<pmd:DIGIPROVMD>
<pmd:process_creator>Andrew
Hallifax</pmd:process_creator>
<xsl:if test="table:table-cell[25][text:p]">
<pmd:process_datetime>
<xsl:analyze-string
select="table:table-cell[25]/text:p"
regex="(\d+)\.(\d+)\.(\d+)">
<xsl:matching-substring>
<xsl:value-of
select="concat('20', regex-group(3))"/>
<xsl:text>-</xsl:text>
<xsl:choose>
<xsl:when test="matches(regex-group(2), '^\d$')">
<xsl:value-of select="concat('0', regex-group(2))"
/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="regex-group(2)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>-</xsl:text>
<xsl:choose>
<xsl:when test="matches(regex-group(1), '^\d$')">
<xsl:value-of select="concat('0', regex-group(1))"
/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="regex-group(1)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>T00:00:00</xsl:text>
</xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:value-of
select="concat(normalize-space(.), 'T00:00:00')"/>
</xsl:non-matching-substring>
</xsl:analyze-string>
</pmd:process_datetime>
</xsl:if>
<pmd:process_organization>Centre for the History and
Analysis of Recorded
Music</pmd:process_organization>
<pmd:task>
<pmd:task_description>Hardware and Software
settings</pmd:task_description>
<pmd:tool>
<pmd:tool_label>Stylus
information</pmd:tool_label>
<pmd:settings>
<pmd:settings_label>Stylus
Size</pmd:settings_label>
<pmd:settings_value>
<xsl:value-of select="table:table-cell[18]/text:p"
/>
</pmd:settings_value>
</pmd:settings>
<pmd:settings>
<pmd:settings_label>Stylus
Weight</pmd:settings_label>
<pmd:settings_value>
<xsl:value-of select="table:table-cell[19]/text:p"
/>
</pmd:settings_value>
</pmd:settings>
</pmd:tool>
<pmd:tool>
<pmd:tool_label>Front End EQ</pmd:tool_label>
<pmd:settings>
<pmd:settings_label>bass</pmd:settings_label>
<pmd:settings_value>
<xsl:value-of select="table:table-cell[20]/text:p"
/>
</pmd:settings_value>
</pmd:settings>
<pmd:settings>
<pmd:settings_label>mid</pmd:settings_label>
<pmd:settings_value>
<xsl:value-of select="table:table-cell[21]/text:p"
/>
</pmd:settings_value>
</pmd:settings>
<pmd:settings>
<pmd:settings_label>top</pmd:settings_label>
<pmd:settings_value>
<xsl:value-of select="table:table-cell[22]/text:p"
/>
</pmd:settings_value>
</pmd:settings>
<pmd:settings>
<pmd:settings_label>filter</pmd:settings_label>
<pmd:settings_value>
<xsl:value-of select="table:table-cell[23]/text:p"
/>
</pmd:settings_value>
</pmd:settings>
</pmd:tool>
<xsl:if test="table:table-cell[26][text:p]">
<pmd:tool>
<pmd:tool_label>Digital EQ</pmd:tool_label>
<pmd:settings>
<pmd:settings_label>General
settings</pmd:settings_label>
<pmd:settings_value>
<xsl:value-of select="table:table-cell[26]/text:p"
/>
</pmd:settings_value>
</pmd:settings>
</pmd:tool>
</xsl:if>
<xsl:if test="table:table-cell[27][text:p]">
<pmd:tool>
<pmd:tool_label>Waves x-crackle</pmd:tool_label>
<pmd:settings>
<pmd:settings_label>General
settings</pmd:settings_label>
<pmd:settings_value>
<xsl:value-of select="table:table-cell[27]/text:p"
/>
</pmd:settings_value>
</pmd:settings>
</pmd:tool>
</xsl:if>
<xsl:if test="table:table-cell[28][text:p]">
<pmd:tool>
<pmd:tool_label>Waves x-hum</pmd:tool_label>
<pmd:settings>
<pmd:settings_label>General
settings</pmd:settings_label>
<pmd:settings_value>
<xsl:value-of select="table:table-cell[28]/text:p"
/>
</pmd:settings_value>
</pmd:settings>
</pmd:tool>
</xsl:if>
<xsl:if test="table:table-cell[29][text:p]">
<pmd:tool>
<pmd:tool_label>Waves x-noise</pmd:tool_label>
<pmd:settings>
<pmd:settings_label>General
settings</pmd:settings_label>
<pmd:settings_value>
<xsl:value-of select="table:table-cell[29]/text:p"
/>
</pmd:settings_value>
</pmd:settings>
</pmd:tool>
</xsl:if>
<xsl:if test="table:table-cell[30][text:p]">
<pmd:tool>
<pmd:tool_label>Waves x-click</pmd:tool_label>
<pmd:settings>
<pmd:settings_label>General
settings</pmd:settings_label>
<pmd:settings_value>
<xsl:value-of select="table:table-cell[30]/text:p"
/>
</pmd:settings_value>
</pmd:settings>
</pmd:tool>
</xsl:if>
</pmd:task>
</pmd:DIGIPROVMD>
</mets:xmlData>
</mets:mdWrap>
</mets:digiprovMD>
</xsl:for-each>
</mets:amdSec>
</xsl:for-each-group>
<mets:fileSec>
<xsl:for-each-group select="//table:table-row"
group-adjacent="table:table-cell[6]/text:p">
<xsl:variable name="discNum">
<xsl:choose>
<xsl:when test="position() &lt; 10">
<xsl:text>0</xsl:text>
<xsl:value-of select="position()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="position()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<mets:fileGrp USE="ARCHIVE">
<xsl:for-each select="current-group()[self::table:table-row]">
<xsl:variable name="sideNum" select="position()"/>
<mets:file ID="{$METSid}_{$discNum}_0{$sideNum}"
MIMETYPE="audio/x-flac">
<mets:FLocat LOCTYPE="URL" xlink:type="simple">
<xsl:attribute name="xlink:href">
<xsl:value-of
select="concat(table:table-cell[14]/text:p,'.flac')"
/>
</xsl:attribute>
</mets:FLocat>
</mets:file>
</xsl:for-each>
</mets:fileGrp>
</xsl:for-each-group>
</mets:fileSec>
<mets:structMap TYPE="PHYSICAL">
<mets:div ID="set" TYPE="PHYSICAL">
<xsl:for-each-group select="//table:table-row"
group-adjacent="table:table-cell[6]/text:p">
<xsl:variable name="discNum">
<xsl:choose>
<xsl:when test="position() &lt; 10">
<xsl:text>0</xsl:text>
<xsl:value-of select="position()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="position()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<mets:div ID="disc{$discNum}" TYPE="PHYSICAL">
<xsl:for-each select="current-group()[self::table:table-row]">
<xsl:variable name="sideNum" select="position()"/>
<mets:div ID="disc{$discNum}_side{$sideNum}" TYPE="PHYSICAL"
ORDER="1"/>
</xsl:for-each>
</mets:div>
</xsl:for-each-group>
</mets:div>
</mets:structMap>
<mets:structMap TYPE="LOGICAL">
<mets:div ID="set_log" TYPE="LOGICAL" DMDID="Set_{$METSid}">
<xsl:for-each-group select="//table:table-row"
group-adjacent="table:table-cell[6]/text:p">
<xsl:variable name="discNum">
<xsl:choose>
<xsl:when test="position() &lt; 10">
<xsl:text>0</xsl:text>
<xsl:value-of select="position()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="position()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<mets:div ID="disc{$discNum}_log" TYPE="LOGICAL"
DMDID="Right_Disc_{$discNum}_{$METSid} Source_Disc_{$discNum}_{$METSid}">
<xsl:for-each select="current-group()[self::table:table-row]">
<xsl:variable name="sideNum" select="position()"/>
<mets:div ID="disc{$discNum}_side{$sideNum}_log" TYPE="LOGICAL"
ORDER="1"
DMDID="Disc_{$discNum}_Side0{$sideNum}_{$METSid} Disc_{$discNum}_Tech0{$sideNum}_{$METSid} Disc_{$discNum}_process0{$sideNum}_{$METSid}"
/>
</xsl:for-each>
</mets:div>
</xsl:for-each-group>
</mets:div>
</mets:structMap>
</mets:mets>
</xsl:result-document>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment