Changeset 2554 for metadata/branches
- Timestamp:
- 02/08/13 13:14:40 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
metadata/branches/clarin2imdi-resourcerefs/toolkit/xslt/imdi2clarin.xsl
r2552 r2554 24 24 URI. Omit this if you are unsure. --> 25 25 <xsl:param name="uri-base"/> 26 26 27 27 <!-- definition of the SRU-searchable collections at TLA (for use later on) --> 28 28 <xsl:variable name="SruSearchable">childes,ESF corpus,IFA corpus,MPI CGN,talkbank</xsl:variable> … … 187 187 <!-- to be called during the creation of the ResourceProxyList (in linking mode) --> 188 188 <xsl:template name="CreateResourceProxyTypeResource"> 189 190 <xsl:variable name="resourceId">191 <xsl:choose>192 <xsl:when test="$keep-resource-refs and string-length(@ResourceId) > 0">193 <xsl:value-of select="@ResourceId" />194 </xsl:when>195 <xsl:otherwise>196 <xsl:value-of select="generate-id()"/>197 </xsl:otherwise>198 </xsl:choose>199 </xsl:variable>200 201 189 <ResourceProxy> 202 190 <xsl:attribute name="id"> 203 <xsl: value-of select="$resourceId"/>191 <xsl:apply-templates mode="CreateRefFromResourceId" select="."/> 204 192 </xsl:attribute> 205 193 <ResourceType> … … 229 217 </ResourceProxy> 230 218 </xsl:template> 231 232 <!-- Used to create the ResourceRef (single ref) attribute on actors and languages --> 219 220 <!-- 221 Used to create id on ResourceProxy elements and ref on MediaFile and WrittenResource elements 222 from ResourceId attribute on original MediaFile and WritteResource elements 223 --> 224 <xsl:template match="MediaFile|WrittenResource" mode="CreateRefFromResourceId"> 225 <xsl:choose> 226 <xsl:when test="$keep-resource-refs and string-length(@ResourceId) > 0"> 227 <xsl:value-of select="@ResourceId" /> 228 </xsl:when> 229 <xsl:otherwise> 230 <xsl:value-of select="generate-id()"/> 231 </xsl:otherwise> 232 </xsl:choose> 233 </xsl:template> 234 235 <!-- Used to create the ref attribute on actors and languages from the original ResourceRef (single ref) --> 233 236 <xsl:template match="@ResourceRef" mode="CreateResourceRefAttribute"> 234 237 <xsl:choose> … … 244 247 </xsl:template> 245 248 246 <!-- Used to create the ResourceRefs attribute (multiple refs) on sources-->249 <!-- Used to create the ref attribute on sources from the original ResourceRefs attribute (multiple refs) --> 247 250 <xsl:template match="@ResourceRefs" mode="CreateResourceRefAttribute"> 248 251 <xsl:variable name="resourceRefsValid"> … … 669 672 670 673 <xsl:template match="MediaFile"> 671 672 <xsl:variable name="resourceRef">673 <xsl:choose>674 <xsl:when test="$keep-resource-refs and string-length(@ResourceId) > 0">675 <xsl:value-of select="@ResourceId" />676 </xsl:when>677 <xsl:otherwise>678 <xsl:value-of select="generate-id()"/>679 </xsl:otherwise>680 </xsl:choose>681 </xsl:variable>682 683 674 <MediaFile> 684 <xsl:attribute name="ref"> 685 <xsl: value-of select="$resourceRef"/>675 <xsl:attribute name="ref"> 676 <xsl:apply-templates mode="CreateRefFromResourceId" select="."/> 686 677 </xsl:attribute> 687 678 <ResourceLink> … … 757 748 758 749 <xsl:template match="WrittenResource"> 759 760 <xsl:variable name="resourceRef"> 761 <xsl:choose> 762 <xsl:when test="$keep-resource-refs and string-length(@ResourceId) > 0"> 763 <xsl:value-of select="@ResourceId" /> 764 </xsl:when> 765 <xsl:otherwise> 766 <xsl:value-of select="generate-id()"/> 767 </xsl:otherwise> 768 </xsl:choose> 769 </xsl:variable> 770 771 <WrittenResource> 772 <xsl:attribute name="ref"> 773 <xsl:value-of select="$resourceRef"/> 750 <WrittenResource> 751 <xsl:attribute name="ref"> 752 <xsl:apply-templates mode="CreateRefFromResourceId" select="."/> 774 753 </xsl:attribute> 775 754 <ResourceLink>
Note: See TracChangeset
for help on using the changeset viewer.