Hi Mika,
you have to define the following global variables in template.xsl:
<xsl:variable name="externalMetadataURL">
<xsl:choose>
<xsl:when test="/dri:document/dri:body/dri:div[@n='item-view']/dri:referenceSet[@type='summaryView']/dri:reference[@type='DSpace Item']">
<!-- DSpace item -->
<xsl:value-of select="/dri:document/dri:body/dri:div[@n='item-view']/dri:referenceSet[@type='summaryView']/dri:reference[@type='DSpace Item']/@url"/>
</xsl:when>
<xsl:otherwise>
<xsl:text></xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- get number of files -->
<xsl:variable name="filecount">
<xsl:if test="$externalMetadataURL!=''">
<xsl:value-of select="count(document(concat('cocoon:/', $externalMetadataURL, 'sections=fileSec&fileGrpTypes=CONTENT'))/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']/mets:file)"/>
</xsl:if>
</xsl:variable>
<!-- get mimetypes -->
<xsl:variable name="mimetypes">
<xsl:if test="$externalMetadataURL!=''">
<xsl:for-each select="document(concat('cocoon:/', $externalMetadataURL, 'sections=fileSec&fileGrpTypes=CONTENT'))/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']/mets:file[not(preceding::mets:file/@MIMETYPE = @MIMETYPE)]">
<xsl:value-of select="@MIMETYPE"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:if>
</xsl:variable>
Since they are global, you can examine the variables wherever you want!
-Andi
Perhaps someone could give me a hint on following issues:
1) I need to count the number of items attached to an item in template.xsl?
2) If an item has many different files attached to it, I would like to
create a concatenated string of the file mime-types (and examine this
string later on). After spending many days trying to achieve this Im
asking if someone knows a way to do this? I can actually loop through
the files and write out the mimetypes, but I am not able to
concatenate them into a string that I could then examine.
Thanks for help once again,
Mika
------------------------------------------------------------------------------
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech