Changeset 1390 for metadata


Ignore:
Timestamp:
06/03/11 14:07:23 (13 years ago)
Author:
dietuyt
Message:

Fixes problems with erroneous OAI providers (providing 2 records per
OAI envelope) and maps the OAI identifier to a fulltext descripton
(which is placed in the MdCollectionDisplayname?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • metadata/trunk/toolkit/xslt/olac2cmdi.xsl

    r1365 r1390  
    1414
    1515    <xsl:key name="iso-lookup" match="lang" use="sil"/>
     16    <xsl:key name="provider-lookup" match="prov" use="identifier"/>
    1617
    1718    <!--
     
    2122    <xsl:param name="iso_xml_path"/>
    2223    <xsl:variable name="lang-top" select="document(concat($iso_xml_path,'sil_to_iso6393.xml'))/languages"/>
     24
     25    <xsl:param name="providers_path"/>
     26    <xsl:variable name="id-top" select="document(concat($providers_path,'id_to_name.xml'))/providers"/>
     27   
    2328
    2429    <xsl:template match="/">
     
    2934                <MdCreationDate>
    3035                    <xsl:variable name="date">
    31                         <xsl:value-of select="//defns:datestamp"/>
     36                        <xsl:value-of select="/defns:OAI-PMH/defns:GetRecord[1]/defns:record[1]/defns:header[1]/defns:datestamp[1]"/>
    3237                    </xsl:variable>
    3338                    <xsl:choose>
     
    4146                </MdCreationDate>
    4247                <MdSelfLink>
    43                     <xsl:value-of select="//defns:identifier"/>
     48                    <xsl:value-of select="/defns:OAI-PMH/defns:GetRecord[1]/defns:record[1]/defns:header[1]/defns:identifier[1]"/>
    4449                </MdSelfLink>
    4550                <MdProfile>clarin.eu:cr1:p_1288172614026</MdProfile>
     51                <xsl:variable name="oai_id">
     52                    <xsl:value-of select="tokenize(/defns:OAI-PMH/defns:GetRecord[1]/defns:record[1]/defns:header[1]/defns:identifier[1], ':')[2]"/>
     53                </xsl:variable>
     54                <MdCollectionDisplayName>
     55                    <xsl:apply-templates select="$id-top">
     56                        <xsl:with-param name="curr-label" select="$oai_id"/>
     57                    </xsl:apply-templates>
     58                </MdCollectionDisplayName>
    4659            </Header>
    4760            <Resources>
     
    191204        <xsl:value-of select="key('iso-lookup', $silcode)/iso"/>
    192205    </xsl:template>
     206   
     207    <xsl:template match="providers">
     208        <xsl:param name="curr-label"/>
     209        <xsl:variable name="id">
     210            <xsl:value-of select="$curr-label"/>
     211        </xsl:variable>
     212        <xsl:value-of select="key('provider-lookup', $id)/name"/>
     213    </xsl:template>
     214   
    193215
    194216
Note: See TracChangeset for help on using the changeset viewer.