Changeset 4187
- Timestamp:
- 12/13/13 16:33:02 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
metadata/trunk/toolkit/xslt/imdi2clarin.xsl
r4137 r4187 137 137 <Resources> 138 138 <ResourceProxyList> 139 <!-- A landing page can only be created when either 1) 140 the file has an MPI handle or 2) $uri-base is 141 defined. Note especially that files are not required to 142 have a handle at all. That is not an error condition; 143 simply skip landing page creation. --> 144 <xsl:if test="(@ArchiveHandle and MPI:is_MPI_handle(@ArchiveHandle)) or not(normalize-space($uri-base)='')"> 139 145 <ResourceProxy id="{generate-id()}"> 140 <ResourceType><xsl:text>LandingPage</xsl:text></ResourceType> 141 <xsl:choose> 142 <!-- ArchiveHandle attribute has MPI handle prefix? If so, generate a LandingPage resource to the original IMDI --> 143 <xsl:when 144 test="MPI:is_MPI_handle(@ArchiveHandle)"> 145 <xsl:choose> 146 <xsl:when 147 test="ends-with($MdSelfLink,'@format=cmdi')"> 148 <ResourceRef><xsl:value-of 149 select="concat(substring-before($MdSelfLink,'@format=cmdi'),'@view')"/></ResourceRef> 150 </xsl:when> 151 <xsl:otherwise> 152 <ResourceRef><xsl:value-of 153 select="concat($MdSelfLink,'@view')"/></ResourceRef> 154 <!-- <ResourceRef><xsl:value-of 155 select="MPI:URL_to_view_in_IMDI_Browser_by_handle(@ArchiveHandle)"/></ResourceRef> --> 156 </xsl:otherwise> 157 </xsl:choose> 158 </xsl:when> 159 <!-- When ArchiveHandle is not an MPI handle, it is necessarily a (non-MPI) handle. Use $uri-base as LandingPage, because the IMDI Browser cannot show external resources. --> 160 <xsl:when test="not(MPI:is_MPI_handle(@ArchiveHandle)) and not(normalize-space($uri-base)='')"> 161 <ResourceRef><xsl:value-of 162 select="MPI:URL_to_view_in_IMDI_Browser_by_path($uri-base)"/></ResourceRef> 146 <ResourceType><xsl:text>LandingPage</xsl:text></ResourceType> 147 <xsl:choose> 148 <!-- Does ArchiveHandle attribute *exist* and does 149 it have an MPI handle prefix? Then generate a 150 LandingPage resource to the original IMDI --> 151 <xsl:when test="@ArchiveHandle and MPI:is_MPI_handle(@ArchiveHandle)"> 152 <xsl:choose> 153 <xsl:when test="ends-with($MdSelfLink,'@format=cmdi')"> 154 <ResourceRef><xsl:value-of 155 select="concat(substring-before($MdSelfLink,'@format=cmdi'),'@view')"/></ResourceRef> 163 156 </xsl:when> 164 157 <xsl:otherwise> 165 <xsl:message 166 terminate="yes"> 167 <xsl:text>ERROR: @ArchiveHandle is not an MPI handle, but $uri-base is empty. </xsl:text><xsl:value-of select="name()"/> 168 </xsl:message></xsl:otherwise> 169 </xsl:choose> 158 <ResourceRef><xsl:value-of select="concat($MdSelfLink,'@view')"/></ResourceRef> 159 </xsl:otherwise> 160 </xsl:choose> 161 </xsl:when> 162 <!-- Either there is no handle or it is not an MPI 163 one; however $uri-base is available. Use it 164 as LandingPage, because the IMDI Browser 165 cannot show external resources.--> 166 <xsl:otherwise> 167 <ResourceRef><xsl:value-of 168 select="MPI:URL_to_view_in_IMDI_Browser_by_path($uri-base)"/></ResourceRef> 169 </xsl:otherwise> 170 </xsl:choose> 170 171 </ResourceProxy> 171 172 </xsl:if> 173 172 174 <xsl:apply-templates 173 175 select="//Resources" … … 212 214 <!-- MPI handle prefix? Use handle + @format=cmdi suffix --> 213 215 <xsl:when 214 test=" MPI:is_MPI_handle(@ArchiveHandle)">216 test="@ArchiveHandle and MPI:is_MPI_handle(@ArchiveHandle)"> 215 217 <xsl:call-template 216 218 name="METATRANSCRIPT_rec">
Note: See TracChangeset
for help on using the changeset viewer.