xslt 1.0 - How to access or retrieve mets content of an item from another item? -


my use case have item has link in item. example, item 123456789/152 has metadata field dc.relation.hasversion=123456789/717. within item view of 123456789/152, how can retrieve values of metadata of 123456789/717? example, want retrieve dc.language.iso value of 123456789/717 123456789/152.

i looked @ related items feature in dspace don't know how metadata displayed in related items list pulled items in list.

i using dspace version 5.3 mirage 2 theme.

edit

based on schweerelos answer, below actual code. using custom metadata field dc.relation.languageversion. basically, want link other version instead of displaying value, display dc.language.iso of other version in item-view.xsl. i've incorporated answer of schweerelos question in code just displaying value of dc.relation.languageversion. sample values of dc.relation.languageversion 10665.1/9843; 10665.1/9844 ie not complete uri handle.

thanks in advance!

actual code

<xsl:template name="itemsummaryview-dim-other-language">     <xsl:if test="dim:field[@element='relation' , @qualifier='languageversion' , descendant::text()]">         <div class="col-sm-6 col-print-4 item-page-field-wrapper">             <h5><i18n:text>xmlui.dri2xhtml.mets-1.0.item-languageversion</i18n:text></h5>             <span>                 <xsl:for-each select="dim:field[@element='relation' , @qualifier='languageversion']">                     <xsl:apply-templates  select="./node()" mode="showrelatedlang"/>                     <xsl:if test="count(following-sibling::dim:field[@element='relation' , @qualifier='languageversion']) != 0">                         <xsl:text>; </xsl:text>                     </xsl:if>                 </xsl:for-each>             </span>         </div>     </xsl:if> </xsl:template>  <xsl:template match="dim:field[@element='relation' , @qualifier='languageversion' , descendant::text()]" mode="showrelatedlang">     <xsl:variable name="otheritemmetadataurl">         <xsl:text>cocoon:/metadata/handle/</xsl:text>         <xsl:value-of select="."/>         <xsl:text>/mets.xml</xsl:text>     </xsl:variable>     <xsl:apply-templates select="document($otheritemmetadataurl)" mode="showlang"/> </xsl:template>  <xsl:template match="dim:field[@element='language' , @qualifier='iso' , descendant::text()]" mode="showlang">     <xsl:value-of select="util:isolanguagetodisplay(node())"/> </xsl:template> 

the related items feature uses discovery solr index, "relatedness" calculated comparing metadata. related items' metadata comes solr index, not can re-use purpose.

you're not saying dspace ui variant you're using -- other questions i'm assuming xmlui (your questions might more helpful other stack overflow users if included dspace version + ui variant every time).

to retrieve metadata of item handle know, use document() function load item's mets file. can apply templates whole thing or specific metadata fields.

something (totally untested, have modify make work):

say item-view.xsl has templates (and code ensure template called):

<xsl:template match="dim:field[@element='relation' , @qualifier='hasversion' , descendant::text()]" mode="showrelatedlang">             <xsl:variable name="otheritemmetadataurl">                 <xsl:text>cocoon://metadata/handle/</xsl:text>         <xsl:value-of select="."/>         <xsl:text>/mets.xml</xsl:text>     </xsl:variable>             <xsl:apply-templates select="document($otheritemmetadataurl)" mode="showlang"/> </xsl:template>  <xsl:template match="dim:field[@element='language' , @qualifier='iso' , descendant::text()]" mode="showlang">     <xsl:value-of select="."/> </xsl:template> 

the first template reads handle first item's dc.relation.hasversion, constructs url second item's mets file , loads mets file. calls second template result of loading second item's mets file. second template reads value dc.language.iso; because it's called on result of document() call, select second item's language.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -