Changeset 4137 for metadata


Ignore:
Timestamp:
12/03/13 14:17:35 (10 years ago)
Author:
larlam
Message:

Changed handling of corpus links: for mpi handles, add @format=cmdi (if there is no part identifier already), for plain URLs add a call to the translation service.

File:
1 edited

Legend:

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

    r4064 r4137  
    7373        select="'http://corpus1.mpi.nl/'"
    7474        as="xs:string"/>
     75
     76    <!-- A URL pointing to the imdi-to-cmdi translation service, with
     77    'IMDI' to be replaced by the URL or handle of the IMDI file. -->
     78    <xsl:param name="translation_service_url"
     79               select="'http://corpus1.mpi.nl/ds/TranslationService/translate?in=IMDI&amp;outFormat=cmdi'"
     80               as="xs:string"/>
    7581
    7682    <!-- A prefix for the MdCollectionDisplayName with a meaning similar to the old 'Data provider' facet in the Virtual Language Observatory. -->
     
    338344                    <xsl:choose>
    339345                        <xsl:when test="not(normalize-space(./@ArchiveHandle)='')">
    340                             <xsl:text>test-</xsl:text><xsl:value-of select="./@ArchiveHandle"/>
     346                          <xsl:choose>
     347                            <xsl:when test="MPI:is_MPI_handle(@ArchiveHandle) and not(contains(./@ArchiveHandle, '@'))">
     348                              <xsl:value-of select="./@ArchiveHandle"/><xsl:text>@format=cmdi</xsl:text>
     349                            </xsl:when>
     350                            <xsl:otherwise>
     351                              <xsl:value-of select="./@ArchiveHandle"/>
     352                            </xsl:otherwise>
     353                          </xsl:choose>
    341354                        </xsl:when>
    342355                        <xsl:when test="starts-with(., 'hdl:')">
    343356                            <xsl:value-of select="."/>
    344357                        </xsl:when>
    345                         <xsl:when test="$uri-base=''"><xsl:value-of select="."/><xsl:text>.cmdi</xsl:text></xsl:when>
     358                        <xsl:when test="$uri-base=''"><xsl:value-of select="replace($translation_service_url, 'IMDI', .)"/></xsl:when>
    346359                        <xsl:otherwise>
    347360                            <xsl:value-of
    348                                 select="concat(resolve-uri(normalize-space(.), $uri-base), '.cmdi')"/>
     361                                select="replace($translation_service_url,'IMDI',resolve-uri(normalize-space(.), $uri-base))"/>
    349362                        </xsl:otherwise>
    350363                    </xsl:choose>
Note: See TracChangeset for help on using the changeset viewer.